Module
Record.Optional.Fields
- Package
- purescript-record-ptional-fields
- Repository
- katsujukou/purescript-record-optional-fields
#Optional Source
class Optional :: (Type -> Context) -> Type -> Type -> Type -> Constraint
class Optional ctx t a b | ctx t a -> b where
Members
optionalWithContext :: Proxy (ctx t) -> a -> b
Instances
(RowToList r l, RowToList ri li, SetContextRow r ctx ctx', OptionalRecordProps ctx' r l li ri ro) => Optional ctx (Record r) (Record ri) (Maybe (Record ro))
(Optional ctx r a b) => Optional ctx r (Maybe a) b
(Optional ctx r a b) => Optional ctx (Maybe r) a b
(Optional ctx r a b) => Optional ctx (Maybe r) (Maybe a) b
Optional ctx a a (Maybe a)
(RenderError (TypeError (ctx a) (UnexpectedType a b)) error, Fail error) => Optional ctx a b err
#GetTypeWithDefault Source
class GetTypeWithDefault :: (Type -> Context) -> Type -> Symbol -> Row Type -> RowList Type -> Type -> Constraint
class GetTypeWithDefault ctx t prop row rl out | ctx t prop row rl -> out where
Members
getWithDefault :: Proxy (ctx t) -> Proxy rl -> t -> Proxy prop -> Record row -> out
Instances
(TypeEquals row (), Optional ctx t t out) => GetTypeWithDefault ctx t prop row Nil out
(Cons prop typ rest row, IsSymbol prop, Optional (AtProp ctx prop row) t typ out) => GetTypeWithDefault ctx t prop row (Cons prop typ tail) out
(Cons _1 _2 rest row, RowToList rest cdr, GetTypeWithDefault ctx t prop rest cdr out, IsSymbol _1, Lacks _1 rest) => GetTypeWithDefault ctx t prop row (Cons _1 _2 cdr) out
#OptionalRecordProps Source
class OptionalRecordProps :: (Type -> Context) -> Row Type -> RowList Type -> RowList Type -> Row Type -> Row Type -> Constraint
class OptionalRecordProps ctx r l li ri ro | ctx r l ri -> li ro where
Members
Instances
(TypeEquals emp (), TypeEquals (Record emp) (Record ())) => OptionalRecordProps ctx emp Nil Nil emp emp
(RowToList ri li, Cons prop typ rest r, RowToList rest tail, DropIfExists ri prop irest, RowToList irest litail, OptionalRecordProps ctx rest tail litail irest orest, GetTypeWithDefault ctx (Maybe typ) prop ri li typ', Cons prop typ' orest ro, IsSymbol prop) => OptionalRecordProps ctx r (Cons prop typ tail) li ri ro
(RenderError (TypeError (ctx row (Record r)) (UnsupportedProp label row)) doc, Fail doc) => OptionalRecordProps (ctx row) r Nil (Cons label typ _1) ri ro
#DropIfExists Source
class DropIfExists :: Row Type -> Symbol -> Row Type -> Constraint
class DropIfExists ri label ro | ri label -> ro
Instances
(RowToList ri rl, DropIfExistsRowList ri rl label ro) => DropIfExists ri label ro
#DropIfExistsRowList Source
class DropIfExistsRowList :: Row Type -> RowList Type -> Symbol -> Row Type -> Constraint
class DropIfExistsRowList r rl label ro | r rl label -> ro
Instances
(Cons label _1 ro r) => DropIfExistsRowList r (Cons label _1 _2) label ro
DropIfExistsRowList r Nil _1 r
(DropIfExistsRowList r tail label ro) => DropIfExistsRowList r (Cons _1 _2 tail) label ro