Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
>>>
import GHC.Generics
>>>
import Wakame
>>>
data Point = Point { x :: Double, y :: Double } deriving (Show, Generic)
>>>
pt = Point 1.2 8.3
class u ~ (l ++ r) => Union l r u | l r -> u where Source #
Typeclass for composing fields
>>>
union (toRow pt) (toRow (keyed @"z" 42.0))
(x: 1.2) :* (y: 8.3) :* (z: 42.0) :* Nil
>>>
ununion (toRow pt) :: (Row '[ '("x", Double)], Row '[ '("y", Double)])
((x: 1.2) :* Nil,(y: 8.3) :* Nil)>>>
ununion (toRow pt) :: (Row '[], Row '[ '("x", Double), '("y", Double)])
(Nil,(x: 1.2) :* (y: 8.3) :* Nil)