Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides combinators for constructing Haskell expressions.
Synopsis
- overLabel :: String -> HsExpr'
- let' :: [RawValBind] -> HsExpr' -> HsExpr'
- case' :: HsExpr' -> [RawMatch] -> HsExpr'
- lambda :: [Pat'] -> HsExpr' -> HsExpr'
- lambdaCase :: [RawMatch] -> HsExpr'
- if' :: HsExpr' -> HsExpr' -> HsExpr' -> HsExpr'
- multiIf :: [GuardedExpr] -> HsExpr'
- do' :: [Stmt'] -> HsExpr'
- (@::@) :: HsExpr' -> HsType' -> HsExpr'
- tyApp :: HsExpr' -> HsType' -> HsExpr'
Documentation
overLabel :: String -> HsExpr' Source #
An overloaded label, as used with the OverloadedLabels
extension.
#foo ===== overLabel "foo"
lambdaCase :: [RawMatch] -> HsExpr' Source #
multiIf :: [GuardedExpr] -> HsExpr' Source #
A MultiWayIf expression.
if | f x = "f" | g x = "g" | otherwise = "h" ===== multiIf [ guardedStmt (var "f" @@ var "x") $ rhs (string "f") , guardedStmt (var "g" @@ var "x") $ rhs (string "g") , guardedStmt (var "otherwise") $ rhs (string "h") ]