|
| Test.ChasingBottoms.Nat | | Portability | non-portable (GHC-specific) | | Stability | experimental | | Maintainer | http://www.cs.chalmers.se/~nad/ |
|
|
|
| Description |
| A simple implementation of natural numbers on top of Integers.
Note that since Integers are used there is no infinite natural
number; in other words, succ is strict.
|
|
| Synopsis |
|
|
|
| Documentation |
|
|
Natural numbers.
No Data.Generics.Basics.Data instance is provided since the
implementation should be abstract.
| Instances | |
|
|
|
| isSucc 0 == False, for other total natural numbers it is True.
|
|
|
| fromSucc 0 == Nothing, fromSucc (n+1) == Just n for a
total natural number n.
|
|
|
| natrec performs primitive recursion on natural numbers.
|
|
|
foldN is a fold on natural numbers:
foldN g h = natrec g (curry $ h . snd)
|
|
| Produced by Haddock version 2.4.2 |