Module
Justifill
- Package
- purescript-justifill
- Repository
- i-am-the-slime/purescript-justifill
#justifill Source
justifill :: forall to via from. Fillable (Record via) (Record to) => Justifiable (Record from) (Record via) => Record from -> Record toCompletes records by wrapping provided optional keys in Just
and filling out non-provided keys with Nothings
Example:
x :: { name :: Maybe String, age :: Maybe Int, id :: Int }
x = justifill { name: "Mark", id: 12 }
-- { name: Just "Mark", age: Nothing, id: 12 }
#justifillVia Source
justifillVia :: forall to via from. Fillable (Record via) (Record to) => Justifiable (Record from) (Record via) => Proxy (Record via) -> Record from -> Record toA version of justifill that helps type inference along
by receiving a Proxy of the thru type
This is useful if you write a wrapper around justifill because
it allows to write simpler type annotations