lue-bird/elm-bits/4.0.2

NOTE: the latest version is 10.1.1

Lue.Bit

To import as Bit exposing (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.