Module

Record.Studio.MapKind

Package
purescript-heterogeneous-extrablatt
Repository
sigma-andex/purescript-heterogeneous-extrablatt

#MapRecordKind Source

data MapRecordKind :: forall k. (k -> Type) -> (k -> Type) -> Typedata MapRecordKind f g

Constructors

Instances

#mapRecordKind Source

mapRecordKind :: forall f g rin rout. HFoldlWithIndex (MapRecordKind f g) (Builder (Record ()) (Record ())) (Record rin) (Builder (Record ()) (Record rout)) => (f ~> g) -> Record rin -> Record rout

Recursively mapK a record using a natural transformation. E.g.

let
  nt :: Either String ~> Maybe
  nt = hush
mapRecordKind { a : { b : { c : { d: Right 10, e : Left "hello" }, f : Right true }
-- Just { a : { b : { c : { d: Just 10, e : Nothing }, f : Just true }