mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-22 03:01:31 +03:00
15cc8243f7
The prelude interfaces that have default definitions for all of their fields are declared total so that users are forced to think about meeting the minimal requirements for an implementation to be valid.
59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
Main> Prelude.== : Eq ty => ty -> ty -> Bool
|
|
Totality: total
|
|
Fixity Declaration: infix operator, level 6
|
|
Main> Prelude.negate : Neg ty => ty -> ty
|
|
The underlying of unary minus. `-5` desugars to `negate (fromInteger 5)`.
|
|
Totality: total
|
|
Fixity Declaration: prefix operator, level 10
|
|
Prelude.- : Neg ty => ty -> ty -> ty
|
|
Totality: total
|
|
Fixity Declarations:
|
|
infixl operator, level 8
|
|
prefix operator, level 10
|
|
Main> Prelude.<$> : Functor f => (a -> b) -> f a -> f b
|
|
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
|
|
Main> interface Prelude.Monad : (Type -> Type) -> Type
|
|
Monad
|
|
@m The underlying functor
|
|
A minimal definition includes either `(>>=)` or `join`.
|
|
Parameters: m
|
|
Constraints: Applicative m
|
|
Constructor: MkMonad
|
|
Methods:
|
|
(>>=) : m a -> (a -> m b) -> m b
|
|
Also called `bind`.
|
|
Fixity Declaration: infixl operator, level 1
|
|
join : m (m a) -> m a
|
|
Also called `flatten` or mu.
|
|
Implementations:
|
|
Monad IO
|
|
Monoid a => Monad (Pair a)
|
|
Monad Maybe
|
|
Monad (Either e)
|
|
Monad List
|
|
Main> Prelude.div : Integral ty => ty -> ty -> ty
|
|
Totality: total
|
|
Fixity Declaration: infixl operator, level 9
|
|
Main> Prelude.>>= : Monad m => m a -> (a -> m b) -> m b
|
|
Also called `bind`.
|
|
Totality: total
|
|
Fixity Declaration: infixl operator, level 1
|
|
Main> Prelude.>> : Monad m => m () -> Lazy (m b) -> m b
|
|
Sequencing of effectful composition
|
|
Totality: total
|
|
Fixity Declaration: infixl operator, level 1
|
|
Main> Main> Main> Main> Main.@@ : (t : a) -> DPair a (\u => t = u)
|
|
|
|
Fixity Declaration: prefix operator, level 10
|
|
Main> Prelude.<$ : Functor f => b -> f a -> f b
|
|
Run something for effects, replacing the return value with a given parameter.
|
|
Totality: total
|
|
Fixity Declaration: infixr operator, level 4
|
|
Main>
|
|
Bye for now!
|