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:
- 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
- list :: [Expression] -> Expression
- let'in :: [LetBinding] -> Expression -> Expression
- let'eq :: Text -> Expression -> LetBinding
- let'inherit'from :: Expression -> [Text] -> LetBinding
- dict :: [DictBinding] -> Expression
- rec'dict :: [DictBinding] -> Expression
- dict'eq :: Expression -> Expression -> DictBinding
- dict'inherit'from :: Expression -> [Text] -> DictBinding
- dict'inherit :: [Text] -> DictBinding
- str :: [Str'1'IsString] -> Expression
- antiquote :: Expression -> Str'1'IsString
- newtype Str'1'IsString = Str'1'IsString {}
- str'indented :: [InStr'1] -> Expression
- indent :: Natural -> [Str'1'IsString] -> Maybe Text -> InStr'1
- newtype Param'Builder = Param'Builder (NonEmpty Param)
- param :: Text -> Param'Builder
- pattern :: [DictPattern'1] -> Param'Builder
- dict'param :: Text -> DictPattern'1
- def :: Expression -> DictPattern'1 -> DictPattern'1
- ellipsis :: Param'Builder
- data Expression
- (<>) :: Semigroup a => a -> a -> a
- (&) :: a -> (a -> b) -> b
- data Maybe a :: * -> *
Lambdas
lambda :: Param'Builder -> Expression -> Expression Source #
Function application
apply :: Expression -> Expression -> Expression Source #
Variables
var :: Text -> Expression Source #
Dot
dot :: Expression -> Expression -> Expression Source #
List
list :: [Expression] -> Expression Source #
Let
let'in :: [LetBinding] -> Expression -> Expression Source #
let'eq :: Text -> Expression -> LetBinding Source #
let'inherit'from :: Expression -> [Text] -> LetBinding Source #
Dict
dict :: [DictBinding] -> Expression Source #
rec'dict :: [DictBinding] -> Expression Source #
dict'eq :: Expression -> Expression -> DictBinding Source #
dict'inherit'from :: Expression -> [Text] -> DictBinding Source #
dict'inherit :: [Text] -> DictBinding Source #
Dynamic strings
str :: [Str'1'IsString] -> Expression Source #
antiquote :: Expression -> Str'1'IsString Source #
newtype Str'1'IsString Source #
Indented strings
str'indented :: [InStr'1] -> Expression Source #
Param builder
param :: Text -> Param'Builder Source #
pattern :: [DictPattern'1] -> Param'Builder Source #
dict'param :: Text -> DictPattern'1 Source #
def :: Expression -> DictPattern'1 -> DictPattern'1 Source #
Re-exports
data Expression Source #
Show Expression Source # | This instance is designed for doctests and REPL experimentation. The format
is designed to strike a balance in verbosity between the derived |
The Maybe
type encapsulates an optional value. A value of type
either contains a value of type Maybe
aa
(represented as
),
or it is empty (represented as Just
aNothing
). Using Maybe
is a good way to
deal with errors or exceptional cases without resorting to drastic
measures such as error
.
The Maybe
type is also a monad. It is a simple kind of error
monad, where all errors are represented by Nothing
. A richer
error monad can be built using the Either
type.
Monad Maybe | Since: 2.1 |
Functor Maybe | Since: 2.1 |
Applicative Maybe | Since: 2.1 |
Foldable Maybe | Since: 2.1 |
Alternative Maybe | Since: 2.1 |
MonadPlus Maybe | Since: 2.1 |
Eq a => Eq (Maybe a) | |
Ord a => Ord (Maybe a) | |
Show a => Show (Maybe a) | |
Semigroup a => Semigroup (Maybe a) | Since: 4.9.0.0 |
Monoid a => Monoid (Maybe a) | Lift a semigroup into Since: 2.1 |
type (==) (Maybe k) a b | |