Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Zero = Zero
- data Succ nat = Succ nat
- class TypeNat nat where
- toValueNat :: Num i => nat -> i
- typeNat :: nat
- type family AddNat x y
- type family MaxNat x y
- data MinLen nat mono
- unMinLen :: MinLen nat mono -> mono
- toMinLenZero :: mono -> MinLen Zero mono
- toMinLen :: (MonoFoldable mono, TypeNat nat) => mono -> Maybe (MinLen nat mono)
- unsafeToMinLen :: mono -> MinLen nat mono
- mlcons :: IsSequence seq => Element seq -> MinLen nat seq -> MinLen (Succ nat) seq
- mlappend :: IsSequence seq => MinLen x seq -> MinLen y seq -> MinLen (AddNat x y) seq
- mlunion :: GrowingAppend mono => MinLen x mono -> MinLen y mono -> MinLen (MaxNat x y) mono
- head :: MonoTraversable mono => MinLen (Succ nat) mono -> Element mono
- last :: MonoTraversable mono => MinLen (Succ nat) mono -> Element mono
- tailML :: IsSequence seq => MinLen (Succ nat) seq -> MinLen nat seq
- initML :: IsSequence seq => MinLen (Succ nat) seq -> MinLen nat seq
- class (Semigroup mono, MonoFoldable mono) => GrowingAppend mono
- ofoldMap1 :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> MinLen (Succ nat) mono -> m
- ofold1 :: (MonoFoldable mono, Semigroup (Element mono)) => MinLen (Succ nat) mono -> Element mono
- ofoldr1 :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> MinLen (Succ nat) mono -> Element mono
- ofoldl1' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> MinLen (Succ nat) mono -> Element mono
- maximum :: MonoFoldableOrd mono => MinLen (Succ nat) mono -> Element mono
- minimum :: MonoFoldableOrd mono => MinLen (Succ nat) mono -> Element mono
- maximumBy :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> MinLen (Succ nat) mono -> Element mono
- minimumBy :: MonoFoldable mono => (Element mono -> Element mono -> Ordering) -> MinLen (Succ nat) mono -> Element mono
Type level naturals
TypeNat Zero | |
MonoPointed mono => MonoPointed (MinLen (Succ Zero) mono) | |
MonoPointed mono => MonoPointed (MinLen Zero mono) | |
type MaxNat x Zero = x | |
type MaxNat Zero y = y | |
type AddNat Zero y = y |
Succ nat |
class TypeNat nat where Source
toValueNat :: Num i => nat -> i Source
Minimum length newtype wrapper
Functor (MinLen nat) | |
Eq mono => Eq (MinLen nat mono) | |
(Data nat, Data mono) => Data (MinLen nat mono) | |
Ord mono => Ord (MinLen nat mono) | |
Read mono => Read (MinLen nat mono) | |
Show mono => Show (MinLen nat mono) | |
GrowingAppend mono => Semigroup (MinLen nat mono) | |
MonoPointed mono => MonoPointed (MinLen (Succ Zero) mono) | |
MonoPointed mono => MonoPointed (MinLen Zero mono) | |
MonoTraversable mono => MonoTraversable (MinLen nat mono) | |
MonoFoldableOrd mono => MonoFoldableOrd (MinLen nat mono) | |
MonoFoldable mono => MonoFoldable (MinLen nat mono) | |
MonoFunctor mono => MonoFunctor (MinLen nat mono) | |
GrowingAppend mono => GrowingAppend (MinLen nat mono) | |
SemiSequence seq => SemiSequence (MinLen nat seq) | |
Typeable (* -> * -> *) MinLen | |
type Element (MinLen nat mono) = Element mono | |
type Index (MinLen nat seq) = Index seq |
toMinLenZero :: mono -> MinLen Zero mono Source
unsafeToMinLen :: mono -> MinLen nat mono Source
Although this function itself cannot cause a segfault, it breaks the
safety guarantees of MinLen
and can lead to a segfault when using
otherwise safe functions.
class (Semigroup mono, MonoFoldable mono) => GrowingAppend mono Source
olength (x <> y) >= olength x + olength y
GrowingAppend ByteString | |
GrowingAppend ByteString | |
GrowingAppend IntSet | |
GrowingAppend Text | |
GrowingAppend Text | |
GrowingAppend [a] | |
GrowingAppend (IntMap v) | |
Ord v => GrowingAppend (Set v) | |
GrowingAppend (Seq a) | |
GrowingAppend (DList a) | |
GrowingAppend (NonEmpty a) | |
(Eq v, Hashable v) => GrowingAppend (HashSet v) | |
GrowingAppend (Vector a) | |
Unbox a => GrowingAppend (Vector a) | |
Storable a => GrowingAppend (Vector a) | |
Ord k => GrowingAppend (Map k v) | |
(Eq k, Hashable k) => GrowingAppend (HashMap k v) | |
GrowingAppend mono => GrowingAppend (MinLen nat mono) |
ofoldMap1 :: (MonoFoldable mono, Semigroup m) => (Element mono -> m) -> MinLen (Succ nat) mono -> m Source
ofold1 :: (MonoFoldable mono, Semigroup (Element mono)) => MinLen (Succ nat) mono -> Element mono Source
ofoldr1 :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> MinLen (Succ nat) mono -> Element mono Source
ofoldl1' :: MonoFoldable mono => (Element mono -> Element mono -> Element mono) -> MinLen (Succ nat) mono -> Element mono Source
maximum :: MonoFoldableOrd mono => MinLen (Succ nat) mono -> Element mono Source
like Data.List, but not partial on a MonoFoldable
minimum :: MonoFoldableOrd mono => MinLen (Succ nat) mono -> Element mono Source
like Data.List, but not partial on a MonoFoldable