snap framework - What is <|> in haskell? -
i still learning haskell , looking @ snap web framework. in hello world example there thingy looks <|>
site :: snap () site = iftop (writebs "hello world") <|> route [ ("foo", writebs "bar") , ("echo/:echoparam", echohandler) ] <|> dir "static" (servedirectory ".")
googling surprisingly challenging, , snap documentation uses <|>
noun. it, , do?
it's method in alternative
typeclass in module control.applicative
in base
package.
typically means you're dealing kind of computation can fail , continue. if both x
, y
typed m a
m
tags kind of computation we're talking then
x <|> y :: m
is computation "tries" x
, if fails "tries" y
. such kinds of computation instantiate alternative
.
Comments
Post a Comment