Module
Data.Array.Unique
- Package
- purescript-substructural
- Repository
- rightfold/purescript-substructural
#UniqueArray Source
data UniqueArray :: Type -> Type
An array that has at most one live reference to it.
Instances
(Clone a) => Clone (UniqueArray a)
(Drop a) => Drop (UniqueArray a)
#singleton Source
singleton :: forall a. a -* (UniqueArray a)
O(1) memory, O(1) time. A singleton array.
#snoc Source
snoc :: forall a. (Tuple (UniqueArray a) a) -* (UniqueArray a)
O(1) memory, O(1) time. Append an element to an array.
#isEmpty Source
isEmpty :: forall a. (Borrow (UniqueArray a)) -* Boolean
O(1) memory, O(1) time. Return whether the array is empty.
#length Source
length :: forall a. (Borrow (UniqueArray a)) -* Int
O(1) memory, O(1) time. Return the length of an array.
#reverse Source
reverse :: forall a. (UniqueArray a) -* (UniqueArray a)
O(1) memory, O(n) time. Reverse an array.