Module

Foreign.ReadWrite

Package
purescript-foreign-readwrite
Repository
artemisSystem/purescript-foreign-readwrite

#ReadForeign Source

class ReadForeign a  where

Members

Instances

#Default Source

newtype Default :: forall defaultType. defaultType -> Type -> Typenewtype Default default a

The ReadForeign and WriteForeign instances for Default will consider the type default the default value and read/write it as undefined. So undefined read into the type Default 0 Int will be the value Default 0, and writing it back to foreign writes undefined.

Constructors

Instances

#default Source

default :: forall default a. Reflectable default a => Default default a

The default value of a given type. For example, default :: Default 0 Int has the value Default 0

#MonoidProxy Source

data MonoidProxy t0

Instances

#DefaultMonoid Source

type DefaultMonoid a = Default (MonoidProxy a) a

This uses Default (with MonoidProxy) to read/write mempty values when encountering undefined. See Default for more info.

#IncompleteRecord Source

newtype IncompleteRecord r

Constructors

Instances

#ReadForeignRecord Source

class ReadForeignRecord :: RowList Type -> Row Type -> Constraintclass ReadForeignRecord rl row | rl -> row where

Members

Instances

#readForeignRecord Source

readForeignRecord :: forall proxy rl row m. Monad m => RowToList row rl => ReadForeignRecord rl row => proxy rl -> Boolean -> Foreign -> FT m (Record row)

#WriteForeignRecord Source

class WriteForeignRecord :: RowList Type -> Row Type -> Constraintclass WriteForeignRecord rl row | rl -> row where

Members

Instances

#writeForeignRecord Source

writeForeignRecord :: forall proxy rl row. WriteForeignRecord rl row => proxy rl -> Record row -> Foreign