lue-bird/elm-bits/2.0.4

NOTE: the latest version is 10.1.1

Lue.Bit

type Bit
= I
| O

One of 2 states.

  • 1, on: I
  • 0, off: O

create

random : Generator Bit

Random.Generator for either I or O.

shape

toNat : Bit -> Nat (In Nat0 (Nat1Plus a))

Convert O to zero, I to one. Nat (In Nat0 (Nat1Plus a)) means that the result will be between 0 & 1.

toInt bit =
    bit |> Bit.toNat |> val

val is from Typed.

extra

serialize : Codec error Bit

A Codec to serialize 1 Bit.

 

Lue. is just the github username to avoid overlaps in module names.