mono-traversable-0.3.0.2: Type classes for mapping, folding, and traversing monomorphic containers

Safe HaskellNone

Data.MinLen

Contents

Synopsis

Type level naturals

data Zero Source

Constructors

Zero 

Instances

data Succ nat Source

Constructors

Succ nat 

Instances

TypeNat nat => TypeNat (Succ nat) 

class TypeNat nat whereSource

Methods

toValueNat :: Num i => nat -> iSource

Instances

TypeNat Zero 
TypeNat nat => TypeNat (Succ nat) 

Minimum length newtype wrapper

data MinLen nat mono Source

Instances

GrowingAppend mono => Semigroup (MinLen nat mono) 

unMinLen :: MinLen nat mono -> monoSource

toMinLen :: (MonoFoldable mono, TypeNat nat) => mono -> Maybe (MinLen nat mono)Source

mlcons :: IsSequence seq => Element seq -> MinLen nat seq -> MinLen (Succ nat) seqSource

mlappend :: IsSequence seq => MinLen x seq -> MinLen y seq -> MinLen (AddNat x y) seqSource

mlunion :: GrowingAppend mono => MinLen x mono -> MinLen y mono -> MinLen (MaxNat x y) monoSource

head :: MonoTraversable mono => MinLen (Succ nat) mono -> Element monoSource

last :: MonoTraversable mono => MinLen (Succ nat) mono -> Element monoSource

tail :: IsSequence seq => MinLen (Succ nat) seq -> MinLen nat seqSource

init :: IsSequence seq => MinLen (Succ nat) seq -> MinLen nat seqSource