Copyright | Gautier DI FOLCO |
---|---|
License | ISC |
Maintainer | Gautier DI FOLCO <gautier.difolco@gmail.com> |
Stability | Unstable |
Portability | not portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Provide a simple record library working with HasField
Example:
import Data.Records.Yarl.LinkedList type Person = Record '[Field "name" String, Field "age" Int] marvin :: Person marvin = Field "marvin" :> Field 42 :> RNil desc :: Person -> String desc p = "My name is " <> p.name <> " and I'm " <> show p.age
Documentation
data Record :: [Type] -> Type where Source #
Full extensible record
RNil :: Record '[] | |
(:>) :: HasNotField fieldName fields => Field fieldName a -> Record fields -> Record (Field fieldName a ': fields) infixr 5 |
class HasField (x :: k) r a | x r -> a where #
Constraint representing the fact that the field x
belongs to
the record type r
and has field type a
. This will be solved
automatically, but manual instances may be provided as well.