Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functions for constructing Expression
s that match the Show
implementations.
This module is only designed for testing and REPL use. It isn't re-exported into the main Bricks API because it's a bit messy:
- It introduces some superfluous typeclasses for the sake of brevity.
- There are a lot of terse function names here that would clash with other things easily.
- Some functions are partial, such as those that require strings that can be rendered unquoted.
- It uses string overloading in a way that the regular API probably shouldn't.
- The functions are oriented toward constructing
Expression
s, skipping over the intermediary types they're composed of, which is convenient but may make them insufficient for some use cases.
- lambda :: Param'Builder -> Expression -> Expression
- apply :: Expression -> Expression -> Expression
- var :: Text -> Expression
- dot :: Expression -> Expression -> Expression
- let'in :: [LetBinding] -> Expression -> Expression
- dict :: [DictBinding] -> Expression
- rec'dict :: [DictBinding] -> Expression
- class Binding a b | b -> a where
- class IsInherit a where
- inherit :: IsInherit a => [Text] -> a
- inherit'from :: IsInherit a => Expression -> [Text] -> a
- str :: [Str'1'] -> Expression
- antiquote :: Expression -> Str'1'
- newtype Str'1' = Str'1' {}
- class IsParam a where
- newtype Param'Builder = Param'Builder (NonEmpty Param)
- buildParam :: Param'Builder -> Param
- paramBuilder :: Param -> Param'Builder
- pattern :: [DictPattern'1] -> Param'Builder
- def :: Expression -> DictPattern'1 -> DictPattern'1
- ellipsis :: Param'Builder
- mergeParams :: Param -> Param -> Param
- mergeDictPatterns :: DictPattern -> DictPattern -> DictPattern
Documentation
lambda :: Param'Builder -> Expression -> Expression Source #
apply :: Expression -> Expression -> Expression Source #
var :: Text -> Expression Source #
dot :: Expression -> Expression -> Expression Source #
let'in :: [LetBinding] -> Expression -> Expression Source #
dict :: [DictBinding] -> Expression Source #
rec'dict :: [DictBinding] -> Expression Source #
inherit'from :: IsInherit a => Expression -> [Text] -> a Source #
str :: [Str'1'] -> Expression Source #
antiquote :: Expression -> Str'1' Source #
newtype Param'Builder Source #
buildParam :: Param'Builder -> Param Source #
paramBuilder :: Param -> Param'Builder Source #
pattern :: [DictPattern'1] -> Param'Builder Source #
def :: Expression -> DictPattern'1 -> DictPattern'1 Source #
mergeParams :: Param -> Param -> Param Source #
Combine two params, merging dict patterns with mergeDictPatterns
and
preferring the right-hand-side when names conflict.
mergeDictPatterns :: DictPattern -> DictPattern -> DictPattern Source #
Combine two dict patterns, taking the concatenation of the item list, and the Boolean or of the ellipsis flag.