Idris2Doc : Prelude.Interfaces

# Prelude.Interfaces

(\$>) : Functorf => fa -> b -> fb
Flipped version of `<\$`.
Totality: total
Fixity Declaration: infixr operator, level 4
(*>) : Applicativef => fa -> fb -> fb
Totality: total
Fixity Declaration: infixl operator, level 3
(<\$) : Functorf => b -> fa -> fb
Run something for effects, replacing the return value with a given parameter.
Totality: total
Fixity Declaration: infixr operator, level 4
(<\$>) : Functorf => (a -> b) -> fa -> fb
An infix alias for `map`, applying a function across everything of type 'a'
in a parameterised type.
@ f the parameterised type
@ func the function to apply
Totality: total
Fixity Declaration: infixr operator, level 4
(<&>) : Functorf => fa -> (a -> b) -> fb
Flipped version of `<\$>`, an infix alias for `map`, applying a function across
everything of type 'a' in a parameterised type.
@ f the parameterised type
@ func the function to apply
Totality: total
Fixity Declaration: infixl operator, level 1
(<*) : Applicativef => fa -> fb -> fa
Totality: total
Fixity Declaration: infixl operator, level 3
(<*>) : Applicativef => f (a -> b) -> fa -> fb
Totality: total
Fixity Declaration: infixl operator, level 3
(<+>) : Semigroupty => ty -> ty -> ty
Totality: total
Fixity Declaration: infixl operator, level 8
(<=<) : Monadm => (b -> mc) -> (a -> mb) -> a -> mc
Right-to-left Kleisli composition of monads, flipped version of `>=>`.
Totality: total
Fixity Declaration: infixl operator, level 1
(<|>) : Alternativef => fa -> Lazy (fa) -> fa
Totality: total
Fixity Declaration: infixr operator, level 2
(=<<) : Monadm => (a -> mb) -> ma -> mb
Right-to-left monadic bind, flipped version of `>>=`.
Totality: total
Fixity Declaration: infixl operator, level 1
(>=>) : Monadm => (a -> mb) -> (b -> mc) -> a -> mc
Totality: total
Fixity Declaration: infixl operator, level 1
(>>) : Monadm => mUnit -> Lazy (mb) -> mb
Sequencing of effectful composition
Totality: total
Fixity Declaration: infixl operator, level 1
(>>=) : Monadm => ma -> (a -> mb) -> mb
Also called `bind`.
Totality: total
Fixity Declaration: infixl operator, level 1
Alternative : (Type -> Type) -> Type
Parameters: f
Constraints: Applicative f
Methods:
empty : fa
(<|>) : fa -> Lazy (fa) -> fa

Implementations:
AlternativeMaybe
AlternativeList
Applicative : (Type -> Type) -> Type
Parameters: f
Constraints: Functor f
Methods:
pure : a -> fa
(<*>) : f (a -> b) -> fa -> fb

Implementations:
ApplicativeIO
Monoida => Applicative (Paira)
ApplicativeMaybe
Applicative (Eithere)
ApplicativeList
Bifoldable : (Type -> Type -> Type) -> Type
`Bifoldable` identifies foldable structures with two different varieties
of elements (as opposed to `Foldable`, which has one variety of element).
Common examples are `Either` and `Pair`.
Parameters: p
Methods:
bifoldr : (a -> acc -> acc) -> (b -> acc -> acc) -> acc -> pab -> acc
bifoldl : (acc -> a -> acc) -> (acc -> b -> acc) -> acc -> pab -> acc
binull : pab -> Lazy Bool

Implementations:
BifoldablePair
BifoldableEither
Bifunctor : (Type -> Type -> Type) -> Type
Bifunctors
@f The action of the Bifunctor on pairs of objects
Parameters: f
Methods:
bimap : (a -> c) -> (b -> d) -> fab -> fcd
The action of the Bifunctor on pairs of morphisms

````idris example
bimap (\x => x + 1) reverse (1, "hello") == (2, "olleh")
````
mapFst : (a -> c) -> fab -> fcb
The action of the Bifunctor on morphisms pertaining to the first object

````idris example
mapFst (\x => x + 1) (1, "hello") == (2, "hello")
````
mapSnd : (b -> d) -> fab -> fad
The action of the Bifunctor on morphisms pertaining to the second object

````idris example
mapSnd reverse (1, "hello") == (1, "olleh")
````

Implementations:
BifunctorPair
BifunctorEither
Bitraversable : (Type -> Type -> Type) -> Type
Parameters: p
Constraints: Bifunctor p, Bifoldable p
Methods:
bitraverse : {auto {i_con:0} : Applicativef} -> (a -> fc) -> (b -> fd) -> pab -> f (pcd)
Map each element of a structure to a computation, evaluate those
computations and combine the results.

Implementations:
BitraversablePair
BitraversableEither
Foldable : (Type -> Type) -> Type
The `Foldable` interface describes how you can iterate over the elements in
a parameterised type and combine the elements together, using a provided
function, into a single result.
@ t The type of the 'Foldable' parameterised type.
Parameters: t
Methods:
foldr : (func : (elem -> acc -> acc)) -> (init : acc) -> (input : telem) -> acc
Successively combine the elements in a parameterised type using the
provided function, starting with the element that is in the final position
i.e. the right-most position.
@ func The function used to 'fold' an element into the accumulated result
@ init The starting value the results are being combined into
@ input The parameterised type
foldl : (func : (acc -> elem -> acc)) -> (init : acc) -> (input : telem) -> acc
The same as `foldr` but begins the folding from the element at the initial
position in the data structure i.e. the left-most position.
@ func The function used to 'fold' an element into the accumulated result
@ init The starting value the results are being combined into
@ input The parameterised type
null : telem -> Lazy Bool
Test whether the structure is empty.
@ acc The accumulator value which is specified to be lazy
foldlM : {auto {i_con:0} : Monadm} -> (funcM : (acc -> elem -> macc)) -> (init : acc) -> (input : telem) -> macc
Similar to `foldl`, but uses a function wrapping its result in a `Monad`.
Consequently, the final value is wrapped in the same `Monad`.

Implementations:
FoldableMaybe
Foldable (Eithere)
FoldableList
Functor : (Type -> Type) -> Type
Functors allow a uniform action over a parameterised type.
@ f a parameterised type
Parameters: f
Methods:
map : (func : (a -> b)) -> fa -> fb
Apply a function across everything of type 'a' in a parameterised type
@ f the parameterised type
@ func the function to apply

Implementations:
FunctorIO
Functor (Paira)
FunctorMaybe
Functor (Eithere)
FunctorList
FunctorStream
Monad : (Type -> Type) -> Type
Parameters: m
Constraints: Applicative m
Methods:
(>>=) : ma -> (a -> mb) -> mb
Also called `bind`.
join : m (ma) -> ma
Also called `flatten` or mu.

Implementations:
Monoid : Type -> Type
Sets equipped with a single binary operation that is associative, along with
a neutral element for that binary operation. Must satisfy the following
laws:

+ Associativity of `<+>`:
forall a b c, a <+> (b <+> c) == (a <+> b) <+> c
+ Neutral for `<+>`:
forall a, a <+> neutral == a
forall a, neutral <+> a == a
Parameters: ty
Constraints: Semigroup ty
Methods:
neutral : ty

Implementations:
MonoidUnit
MonoidOrdering
Monoidb => Monoid (a -> b)
Monoid (Maybea)
Monoid (Lista)
Monoid String
Semigroup : Type -> Type
Sets equipped with a single binary operation that is associative. Must
satisfy the following laws:

+ Associativity of `<+>`:
forall a b c, a <+> (b <+> c) == (a <+> b) <+> c
Parameters: ty
Methods:
(<+>) : ty -> ty -> ty

Implementations:
SemigroupUnit
SemigroupOrdering
Semigroupb => Semigroup (a -> b)
Semigroup (Maybea)
Semigroup (Lista)
Semigroup String
Traversable : (Type -> Type) -> Type
Parameters: t
Constraints: Functor t, Foldable t
Methods:
traverse : {auto {i_con:0} : Applicativef} -> (a -> fb) -> ta -> f (tb)
Map each element of a structure to a computation, evaluate those
computations and combine the results.

Implementations:
TraversableMaybe
Traversable (Eithere)
TraversableList
all : Foldablet => (a -> Bool) -> ta -> Bool
The disjunction of the collective results of applying a predicate to all
elements of a structure. `all` short-circuits from left to right.
Totality: total
and : Foldablet => t Lazy Bool -> Bool
The conjunction of all elements of a structure containing lazy boolean
values. `and` short-circuits from left to right, evaluating until either an
element is `False` or no elements remain.
Totality: total
any : Foldablet => (a -> Bool) -> ta -> Bool
The disjunction of the collective results of applying a predicate to all
elements of a structure. `any` short-circuits from left to right.
Totality: total
bifoldl : Bifoldablep => (acc -> a -> acc) -> (acc -> b -> acc) -> acc -> pab -> acc
Totality: total
bifoldr : Bifoldablep => (a -> acc -> acc) -> (b -> acc -> acc) -> acc -> pab -> acc
Totality: total
bifor : (Bitraversablep, Applicativef) => pab -> (a -> fc) -> (b -> fd) -> f (pcd)
Like `bitraverse` but with the arguments flipped.
Totality: total
bimap : Bifunctorf => (a -> c) -> (b -> d) -> fab -> fcd
The action of the Bifunctor on pairs of morphisms

````idris example
bimap (\x => x + 1) reverse (1, "hello") == (2, "olleh")
````

Totality: total
binull : Bifoldablep => pab -> Lazy Bool
Totality: total
bisequence : (Bitraversablep, Applicativef) => p (fa) (fb) -> f (pab)
Evaluate each computation in a structure and collect the results.
Totality: total
bitraverse : Bitraversablep => Applicativef => (a -> fc) -> (b -> fd) -> pab -> f (pcd)
Map each element of a structure to a computation, evaluate those
computations and combine the results.
Totality: total
choice : (Foldablet, Alternativef) => t Lazy (fa) -> fa
Fold using Alternative.

If you have a left-biased alternative operator `<|>`, then `choice` performs
left-biased choice from a list of alternatives, which means that it
evaluates to the left-most non-`empty` alternative.

If the list is empty, or all values in it are `empty`, then it evaluates to
`empty`.

Example:

```
-- given a parser expression like:
expr = literal <|> keyword <|> funcall

-- choice lets you write this as:
expr = choice [literal, keyword, funcall]
```

Note: In Haskell, `choice` is called `asum`.
Totality: total
choiceMap : (Foldablet, Alternativef) => (a -> fb) -> ta -> fb
A fused version of `choice` and `map`.
Totality: total
concat : (Foldablet, Monoida) => ta -> a
Combine each element of a structure into a monoid.
Totality: total
concatMap : (Foldablet, Monoidm) => (a -> m) -> ta -> m
Combine into a monoid the collective results of applying a function to each
element of a structure.
Totality: total
empty : Alternativef => fa
Totality: total
foldMap : (Foldablet, Monoidm) => (a -> m) -> ta -> m
Maps each element to a value and combine them
Totality: total
foldl : Foldablet => (acc -> elem -> acc) -> acc -> telem -> acc
The same as `foldr` but begins the folding from the element at the initial
position in the data structure i.e. the left-most position.
@ func The function used to 'fold' an element into the accumulated result
@ init The starting value the results are being combined into
@ input The parameterised type
Totality: total
foldlM : Foldablet => Monadm => (acc -> elem -> macc) -> acc -> telem -> macc
Similar to `foldl`, but uses a function wrapping its result in a `Monad`.
Consequently, the final value is wrapped in the same `Monad`.
Totality: total
foldr : Foldablet => (elem -> acc -> acc) -> acc -> telem -> acc
Successively combine the elements in a parameterised type using the
provided function, starting with the element that is in the final position
i.e. the right-most position.
@ func The function used to 'fold' an element into the accumulated result
@ init The starting value the results are being combined into
@ input The parameterised type
Totality: total
for : (Traversablet, Applicativef) => ta -> (a -> fb) -> f (tb)
Like `traverse` but with the arguments flipped.
Totality: total
for_ : (Foldablet, Applicativef) => ta -> (a -> fb) -> fUnit
Like `traverse_` but with the arguments flipped.
Totality: total
guard : Alternativef => Bool -> fUnit
`guard a` is `pure ()` if `a` is `True` and `empty` if `a` is `False`.
Totality: total
ignore : Functorf => fa -> fUnit
Run something for effects, throwing away the return value.
Totality: total
join : Monadm => m (ma) -> ma
Also called `flatten` or mu.
Totality: total
map : Functorf => (a -> b) -> fa -> fb
Apply a function across everything of type 'a' in a parameterised type
@ f the parameterised type
@ func the function to apply
Totality: total
mapFst : Bifunctorf => (a -> c) -> fab -> fcb
The action of the Bifunctor on morphisms pertaining to the first object

````idris example
mapFst (\x => x + 1) (1, "hello") == (2, "hello")
````

Totality: total
mapHom : Bifunctorf => (a -> b) -> faa -> fbb
Totality: total
mapSnd : Bifunctorf => (b -> d) -> fab -> fad
The action of the Bifunctor on morphisms pertaining to the second object

````idris example
mapSnd reverse (1, "hello") == (1, "olleh")
````

Totality: total
neutral : Monoidty => ty
Totality: total
null : Foldablet => telem -> Lazy Bool
Test whether the structure is empty.
@ acc The accumulator value which is specified to be lazy
Totality: total
or : Foldablet => t Lazy Bool -> Bool
The disjunction of all elements of a structure containing lazy boolean
values. `or` short-circuits from left to right, evaluating either until an
element is `True` or no elements remain.
Totality: total
product : (Foldablet, Numa) => ta -> a
Multiply together all elements of a structure.
Totality: total
product' : (Foldablet, Numa) => ta -> a
Multiply together all elements of a structure.
Same as `product` but tail recursive.
Totality: total
pure : Applicativef => a -> fa
Totality: total
sequence : (Traversablet, Applicativef) => t (fa) -> f (ta)
Evaluate each computation in a structure and collect the results.
Totality: total
sequence_ : (Foldablet, Applicativef) => t (fa) -> fUnit
Evaluate each computation in a structure and discard the results.
Totality: total
sum : (Foldablet, Numa) => ta -> a
Add together all the elements of a structure.
Totality: total
sum' : (Foldablet, Numa) => ta -> a
Add together all the elements of a structure.
Same as `sum` but tail recursive.
Totality: total
traverse : Traversablet => Applicativef => (a -> fb) -> ta -> f (tb)
Map each element of a structure to a computation, evaluate those
computations and combine the results.
Totality: total
traverse_ : (Foldablet, Applicativef) => (a -> fb) -> ta -> fUnit
Map each element of a structure to a computation, evaluate those