Module

Simple.JSON

#E

type E a = Either MultipleErrors a

An alias for the Either result of decoding

#readJSON

readJSON :: forall a. ReadForeign a => String -> E a

Read a JSON string to a type a while returning a MultipleErrors if the parsing failed.

#readJSON'

readJSON' :: forall a. ReadForeign a => String -> F a

Read a JSON string to a type a using F a. Useful with record types.

#readJSON_

readJSON_ :: forall a. ReadForeign a => String -> Maybe a

Read a JSON string to a type a while returning Nothing if the parsing failed.

#writeJSON

writeJSON :: forall a. WriteForeign a => a -> String

Write a JSON string from a type a.

#write

write :: forall a. WriteForeign a => a -> Foreign

#read

read :: forall a. ReadForeign a => Foreign -> E a

Read a Foreign value to a type

#read'

read' :: forall a. ReadForeign a => Foreign -> F a

#read_

read_ :: forall a. ReadForeign a => Foreign -> Maybe a

Read a Foreign value to a type, as a Maybe of type

#readAsForeign

readAsForeign :: forall a b. ReadForeign a => b -> E a

Read a value of any type as Foreign to a type

#parseJSON

#undefined

#ReadForeignFields

class ReadForeignFields :: RowList Type -> Row Type -> Row Type -> Constraintclass ReadForeignFields (xs :: RowList Type) (from :: Row Type) (to :: Row Type) | xs -> from to where

A class for reading foreign values from properties

Members

Instances

#ReadForeignVariant

class ReadForeignVariant :: RowList Type -> Row Type -> Constraintclass ReadForeignVariant (xs :: RowList Type) (row :: Row Type) | xs -> row where

Members

Instances

#WriteForeignFields

class WriteForeignFields :: RowList Type -> Row Type -> Constraintclass WriteForeignFields (rl :: RowList Type) row | rl -> row where

Members

Instances

#WriteForeignVariant

class WriteForeignVariant :: RowList Type -> Row Type -> Constraintclass WriteForeignVariant (rl :: RowList Type) (row :: Row Type) | rl -> row where

Members

Instances

Modules