sdeframond / elm-store / Id


type Id a

An Id for a given value.

Technically just a wrapper around Int with a phantom type parameter.

one : Id a

The first possible Id.

next : Id a -> Id a

Returns the next Id.

equalsInt : Basics.Int -> Id a -> Basics.Bool

Checks equality between an Int and an Id's inner value.

toInt : Id a -> Basics.Int

Unwrap the inner Int value.

fromInt : Basics.Int -> Id a

Wraps an Int into an Id.

Use with caution. In most cases, one, next and equalsInt are enough.

A possible use case would be to deserialize ids from JSON.