Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example of composition with Superscribe in F#
type NameBeginningWith(letter) as this =
inherit GraphNode()
this.ActivationFunction <- fun data segment -> segment.StartsWith(letter)
fun data segment -> data.Parameters?Add("Name", segment));
type Startup() =
member x.Configuration(app: Owin.IAppBuilder) =
let define = OwinRouteEngineFactory.Create();
app.UseSuperscribeRouter(define).UseSuperscribeHandler(define) |> ignore
let hello = ConstantNode("hello")
hello / NameBeginningWith "p",
fun o ->
"Hello " + o?Parameters?Name + ", great first letter!" :> obj) |> ignore
hello / String "Name",
fun o ->
"Hello " + o?Parameters?Name :> obj) |> ignore
[<assembly: OwinStartup(typeof<Startup>)>]
do ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.