Sense |>! (flash forward)

While watching Websharper online examples, I came across such examples:

Div [Attr.Style "padding: 5px;"] -< [
    P [Text "Type a name in the input field below:"]
    Form [
        label "First Name: "
        input
        |>! OnKeyUp (fun _ _ -> update ())
    ]
    P [
        label "Suggestions: "
        hint
    ]
]

We do not seem to be in the expression of calculation, and for some reason this is not particularly easy for Google to value |>!.

What effect does the modifier have !in this context? How will this change the outcome of the straight pipe?

+4
source share
1 answer

The mystery is solved. This is not a native F # operator; This is the Websharper operator.

From the source code ( https://github.com/intellifactory/websharper/blob/master/src/stdlib/WebSharper.Main/Pervasives.fs#L105 ):

/// Implements piping with mutation.
[<Inline "($f($x), $x)">]
let ( |>! ) x f = f x; x
+2
source

Source: https://habr.com/ru/post/1538284/


All Articles