Integer.dcl 860 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/// BigInt implementation for Clean
/// Written by John van Groningen
/// Ported from the Haskell frontend by Tim Steenvoorden
definition module Data.Integer

import StdOverloaded

:: Integer = {integer_s ::!Int, integer_a ::!.{#Int}};

instance +				Integer
instance *  			Integer
instance zero			Integer
instance one			Integer

instance ~				Integer
instance -  			Integer

instance abs			Integer
instance sign			Integer

instance /				Integer
instance rem            Integer

24
instance ^				Integer
25 26 27 28

instance ==				Integer
instance <  			Integer

29 30
instance isEven Integer

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
class toInteger a :: !a -> Integer

instance toChar Integer
instance toInt Integer
//instance toReal Integer
instance toString Integer

instance toInteger Char
instance toInteger Int
//instance toInteger Real
instance toInteger String

/*
integer_a_to_double :: !Int !{#Int} -> Real
*/