wakame-0.1.0.0: Functions to manipulate records

Safe HaskellNone
LanguageHaskell2010

Wakame.Merge

Synopsis

Documentation

>>> import GHC.Generics
>>> import Wakame
>>> data Point = Point { x :: Double, y :: Double } deriving (Show, Generic)
>>> pt = Point 1.2 8.3

class (Union l r (l ++ r), Nub (l ++ r) m) => Merge l r m where Source #

Typeclass of the combination of Union and Nub Use this typeclass and function if the intermediate row is not necessary.

>>> merge (toRow $ keyed @"x" 42.0) (toRow pt) :: Row (Of Point)
(x: 42.0) :* (y: 8.3) :* Nil

Methods

merge :: Row l -> Row r -> Row m Source #

Instances
(Union l r (l ++ r), Nub (l ++ r) m) => Merge l r m Source # 
Instance details

Defined in Wakame.Merge

Methods

merge :: Row l -> Row r -> Row m Source #