Fugue.Bits.Bit

Module Members

and

(Function)

And two bits together.

Type Signature

 fun (Bit, Bit) -> Bit
Argument: x
Type: Bit
Argument: y
Type: Bit
Returns:
Type: Bit

eq

(Function)

Compare two Bits for equality.

Type Signature

 fun (Bit, Bit) -> Bool
Argument: x
Type: Bit
Argument: y
Type: Bit
Returns:

True if x and y are equal. False otherwise.

Type: Bool

fromInt

(Function)

Convert an Int to an Bit.

Type Signature

 fun (Int) -> Bit
Argument: x

The Int to convert. Must be 0 or 1.

Type: Int

Returns:

Zero or One.

Example:

zero: Bit.fromInt(0) # => Bit.Zero
one: Bit.fromInt(1)  # => Bit.One

Type: Bit

toString

(Function)

Convert a Bit to a String.

Type Signature

 fun (Bit) -> String
Argument: x

the Bit to convert.

Type: Bit

Returns:

“0” or “1”

Example:

one: Bit.toString(bit.fromInt(1))  # => "1"
zero: Bit.toString(bit.fromInt(0)) # => "0"

Type: String

Bit

(Type)

type Bit:
  | One
  | Zero

One

(Constructor)

Zero

(Constructor)

A Bit is either Zero or One.