Here is a quick partial list off the top of my head. Hope this helps.

Standard WebSharper operators:

-<

Nests arbitrary client- and server-side HTML/XML when attributes are present on the parent node.

Example:

1
2
3
4
Div [Class "..."] -< [
    Div [...]
    Div [...]
]

--

Nests a single client- or server-side HTML/XML node inside another.

Example:

1
A [HRef "..." ] -- Text "Home"

|>!

Binds an event handler to a DOM node, without returning the updated DOM node (imperative).

Example:

1
2
3
4
Div [...]
|>! OnClick (fun e args ->
    ...
)

<*>

Combines two formlets.

Example:

1
2
3
Formlet.Yield (fun a b -> ...)
<*> Controls.Input ""
<*> Controls.Input ""

<|>

Combines two sitelets.

Example:

1
2
Sitelet.Content "/home" Action.Home Pages.Home
<|> Sitelet.Content "/contant" Action.Contact Pages.Contact

WebSharper Interface Generator (WIG) operators - used in defining WebSharper extensions for JavaScript code:

^->

Constructs a function type.

*

Constructs a sum type.

!?

Constructs an optional type.

?

Names a parameter.

=>

Defines a member.

=?

Defines a read-only property.

=!

Defines a write-only property.

=@

Defines a mutable (read+write) property.

Example:

1
2
3
4
5
6
Class "MyArgType"
|+> Protocol [
    "Url" =? T<string>
    "Name" =! T<string>
    "Age" =@ T<int>
]

|+>

Adds new members to a given type.

Example:

1
2
3
4
Class "FB"
|+> [
    "login" => (LoginResponse ^-> T<unit>) * !?LoginOptions?options ^-> T<unit>
]
By on 10/7/2012 1:15 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper