IzumiSy/elm-typed/1.1.0

NOTE: the latest version is 4.1.0

Typed

Types

type Typed tag a p

A definition of Typed data.

Users can control data modifiability by giving permission to the type variable p.

Permissions

ReadOnly permission prohibits users to call all functions that do constructing and updating such as new, map and andThen.

ReadWrite permission allows users to call all functions.

Constructor

new : a -> Typed tag a ReadWrite

Manipulation

value : Typed tag a p -> a
map : (a -> a) -> Typed tag a ReadWrite -> Typed tag a ReadWrite
(a -> Typed tag b ReadWrite)
-> Typed tag a ReadWrite
-> Typed tag b ReadWrite

Serialization

encode : (a -> Value) -> Typed tag a p -> Value
decode : Decoder a -> Decoder (Typed tag a p)
encodeStrict : tag -> (a -> Value) -> Typed tag a p -> Value

Stricter version of encode that accepts a tag to check.

decodeStrict : tag -> Decoder a -> Decoder (Typed tag a p)

Stricter version of decode that accepts a tag to check.