package preface
Module Preface_stdlib.Nonempty_listSource
Implementation for Nonempty_list.t.
A Nonempty_list.t is a list that contains at least one element. Therefore, the head and tails functions are total and safe.
Type
Implementation
Functor
module Functor : Preface_specs.FUNCTOR with type 'a t = 'a tAlt
module Alt : Preface_specs.ALT with type 'a t = 'a tApplicative
Nonempty_list.t implements Preface_specs.APPLICATIVE and introduces an interface to define Preface_specs.TRAVERSABLE using Nonempty_list as an iterable structure.
module Applicative :
Preface_specs.Traversable.API_OVER_APPLICATIVE with type 'a t = 'a tSelective
module Selective : Preface_specs.SELECTIVE with type 'a t = 'a tMonad
Nonempty_list.t implements Preface_specs.MONAD and introduces an interface to define Preface_specs.TRAVERSABLE using Nonempty_list as an iterable structure.
module Monad : Preface_specs.Traversable.API_OVER_MONAD with type 'a t = 'a tComonad
module Comonad : Preface_specs.COMONAD with type 'a t = 'a tFoldable
module Foldable : Preface_specs.FOLDABLE with type 'a t = 'a tInvariant Functor
module Invariant : Preface_specs.INVARIANT with type 'a t = 'a tDelayed implementation
By setting the inner type type of Nonempty_list.t it is possible to get implementations for abstractions without type parameter.
Semigroup
Additional functions
Additional functions to facilitate practical work with Nonempty_list.t.
rev_append a b is a tail-recursive version of append (rev a) b.
Formatter for pretty-printing for Nonempty_list.t.