src/containers/types/bitlist.bend
bend-collections-laws-containers@1.0.0.0 · 28 lines · 0 definitions
1import Base
2
3# Neutral datatypes shared by src/containers/bitlist.bend and its spec.
4
5type Error is Data:
6 IndexOutOfRange{}
7 Full{}
8 Empty{}
9
10# One public operation, for arbitrary finite operation traces.
11type Op is Data:
12 Length{}
13 Limit{}
14 Get{index: Nat}
15 Assign{index: Nat, value: Bool}
16 Push{value: Bool}
17 Pop{}
18 Clear{}
19 Count{}
20 ToList{}
21
22# The observable answer of one operation.
23type Obs is Data:
24 ONat{value: Nat}
25 OLimit{limit: Maybe<&2, Nat>}
26 OBit{result: Result<&2, &2, Error, Bool>}
27 OUnit{result: Result<&2, &2, Error, Unit>}
28 OBits{bits: List<&2, Bool>}