Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Field r a x y = Field (a -> x -> y) (r -> a)
- newtype Build r f x y = Build (f (x -> y))
- data Con r x = Con x (r -> Bool)
- ($>>) :: (Functor f, Buildable r y) => x -> Build r f x y -> f r
- (>>>) :: Category k cat => cat a b -> cat b c -> cat a c
- done :: Applicative f => Build r f x x
- data X = X
- class Buildable r a where
- give :: a -> r
- having :: Functor f => Field r a x y -> f a -> Build r f x y
- build :: (Functor f, Buildable r y) => x -> Build r f x y -> f r
First-class record construction
Describes how to apply a constructor argument and how to extract from a record.
y
should be x
with one argument knocked out: e. g.
Field MyType Int (Int -> a2 -> MyType) (X -> a2 -> MyType)
Field (a -> x -> y) (r -> a) |
An ongoing record construction of an r
in context f
.
Applicative actions are sequenced in the direction of >>>
.
Build (f (x -> y)) |
Applicative f => Category * (Build r f) |
A constructor for a given record and a way to check whether it has it.
($>>) :: (Functor f, Buildable r y) => x -> Build r f x y -> f r infixr 1 Source
Infix version of build
.
Field
s partially apply constructors and replace arguments with this type.