curry-base-0.4.2: Functions for manipulating Curry programs

Copyright(c) 2009, Holger Siegel
LicenseBSD-3-clause
Maintainerbjp@informatik.uni-kiel.de
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Curry.ExtendedFlat.CurryArithmetics

Description

 

Synopsis

Documentation

data CurryInt Source #

Data type for curry's Int representation

Constructors

Neg CurryNat

negative integer

Zero

zero

Pos CurryNat

positive integer

data CurryNat Source #

Data type for curry's representation of natural numbers

Constructors

IHi

highest one bit

O CurryNat

zero bit

I CurryNat

one bit

trNat :: Integral n => a -> (a -> a) -> (a -> a) -> n -> a Source #

Translate a natural number into its algebraic representation, providing functions for representing the highest bit, a zero bit and a one bit.

trInt :: Integral n => (nat -> t) -> t -> (nat -> t) -> nat -> (nat -> nat) -> (nat -> nat) -> n -> t Source #

Translate an Integral number into its algebraic representation, providing functions for representing negative numbers, zero, positive numbers, highest bit, a zero bit and a one bit.

toCurryInt :: Integral a => a -> CurryInt Source #

Convert an Integral value into its algebraic representation.

toIntExpression :: Integral a => a -> Expr Source #

Convert an Integral value into an expression constructing its algebraic representation.