Idris2/tests/idris2/docs001/expected
2021-10-13 13:17:48 +01:00

133 lines
3.4 KiB
Plaintext

Main> Prelude.plus : Nat -> Nat -> Nat
Add two natural numbers.
@ x the number to case-split on
@ y the other numberpublic export
Totality: total
Main> data Prelude.Nat : Type
Natural numbers: unbounded, unsigned integers which can be pattern matched.
Totality: total
Constructors:
Z : Nat
Zero.
S : Nat -> Nat
Successor.
Hints:
Cast Nat String
Cast Nat Integer
Cast Nat Int
Cast Nat Char
Cast Nat Double
Cast Nat Bits8
Cast Nat Bits16
Cast Nat Bits32
Cast Nat Bits64
Cast Nat Int8
Cast Nat Int16
Cast Nat Int32
Cast Nat Int64
Cast String Nat
Cast Double Nat
Cast Char Nat
Cast Int Nat
Cast Integer Nat
Cast Bits8 Nat
Cast Bits16 Nat
Cast Bits32 Nat
Cast Bits64 Nat
Cast Int8 Nat
Cast Int16 Nat
Cast Int32 Nat
Cast Int64 Nat
Eq Nat
Num Nat
Ord Nat
Range Nat
Show Nat
Main> data Prelude.List : Type -> Type
Generic lists.
Totality: total
Constructors:
Nil : List a
Empty list
(::) : a -> List a -> List a
A non-empty list, consisting of a head element and the rest of the list.
Hints:
Alternative List
Applicative List
Eq a => Eq (List a)
Foldable List
Functor List
Monad List
Monoid (List a)
Ord a => Ord (List a)
Semigroup (List a)
Show a => Show (List a)
Traversable List
Main> interface Prelude.Show : Type -> Type
Things that have a canonical `String` representation.
Parameters: ty
Constructor: MkShow
Methods:
show : ty -> String
Convert a value to its `String` representation.
@ x the value to convert
showPrec : Prec -> ty -> String
Convert a value to its `String` representation in a certain precedence
context.
A value should produce parentheses around itself if and only if the given
precedence context is greater than or equal to the precedence of the
outermost operation represented in the produced `String`. *This is
different from Haskell*, which requires it to be strictly greater. `Open`
should thus always produce *no* outermost parens, `App` should always
produce outermost parens except on atomic values and those that provide
their own bracketing, like `Pair` and `List`.
@ d the precedence context.
@ x the value to convert
Implementations:
Show Int
Show Integer
Show Bits8
Show Bits16
Show Bits32
Show Bits64
Show Int8
Show Int16
Show Int32
Show Int64
Show Double
Show Char
Show String
Show Nat
Show Bool
Show Void
Show ()
(Show a, Show b) => Show (a, b)
(Show a, Show (p y)) => Show (DPair a p)
Show a => Show (List a)
Show a => Show (Maybe a)
(Show a, Show b) => Show (Either a b)
Main> Prelude.show : Show ty => ty -> String
Convert a value to its `String` representation.
@ x the value to convert
Totality: total
Main> interface Prelude.Monad : (Type -> Type) -> Type
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> 1 : Integer
Primitive
Main> Bye for now!