A primitive: the single bit
One of 2 states:
I
O
This right here is really the core of this library. Representing bits safely is now quite readable!
ArraySized.l8 O I I I O O I O
--: ArraySized Bit (In (Up8 minX_) (Up8 maxX_))
for an example of using this to represent an Id
,
visit the readme
random : Random.Generator Bit
Uniform Random.Generator
for either I
or O
fuzz : Fuzzer Bit
Uniform Fuzzer
for either I
or O
N
fromN : N (N.In min_ (N.Up maxTo1_ N.To N1)) -> Bit
toN : Bit -> N (N.In (N.Up0 minX_) (N.Up1 maxX_))
Convert O
to n0
, I
to 1
.
N (In (Up0 minX_) (Up1 maxX_))
means that the result will be between 0 & 1
toInt =
Bit.toN >> N.toInt
opposite : Bit -> Bit
Switch O
↔ I
. Often called the NOT operator