### StdClass, StdFile, StdFunc, StdOrdList and _SystemArray

parent 3e1a5743
 definition module StdClass definition module StdClass /** * Meta-classes with derived functions. */ // **************************************************************************************** // **************************************************************************************** // Concurrent Clean Standard Library Module Version 2.0 // Concurrent Clean Standard Library Module Version 2.0 // Copyright 1998 University of Nijmegen // Copyright 1998 University of Nijmegen ... @@ -12,40 +16,97 @@ from StdBool import not ... @@ -12,40 +16,97 @@ from StdBool import not // For the time-being, macro definitions are used for this purpose // For the time-being, macro definitions are used for this purpose // This may cause misleading error messages in case of type errors // This may cause misleading error messages in case of type errors /** * Meta-class describing interval types with an absolute zero. */ class PlusMin a | + , - , zero a class PlusMin a | + , - , zero a /** * Meta-class describing ratio types. */ class MultDiv a | * , / , one a class MultDiv a | * , / , one a /** * Meta-class describing arithmetical types. */ class Arith a | PlusMin , MultDiv , abs , sign , ~ a class Arith a | PlusMin , MultDiv , abs , sign , ~ a /** * Meta-class describing types that can be incremented and decremented. */ class IncDec a | + , - , one , zero a class IncDec a | + , - , one , zero a where where /** * Increment a value by one. */ inc :: !a -> a | + , one a inc :: !a -> a | + , one a inc x :== x + one inc x :== x + one /** * Decrement a value by one. */ dec :: !a -> a | - , one a dec :: !a -> a | - , one a dec x :== x - one dec x :== x - one /** * Meta-class describing types that can be enumerated. */ class Enum a | < , IncDec a class Enum a | < , IncDec a /** * Equality. * * @var The type for which values can be equated */ class Eq a | == a class Eq a | == a where where /** * Inequality. * * @result True iff the parameters are not equal */ (<>) infix 4 :: !a !a -> Bool | Eq a (<>) infix 4 :: !a !a -> Bool | Eq a (<>) x y :== not (x == y) (<>) x y :== not (x == y) /** * Ordering. * * @var The type that can be ordered. */ class Ord a | < a class Ord a | < a where where /** * Greater than. * * @result True iff the first value is strictly greater than the second value. */ (>) infix 4 :: !a !a -> Bool | Ord a (>) infix 4 :: !a !a -> Bool | Ord a (>) x y :== y < x (>) x y :== y < x /** * Smaller than or equal to. * * @result True iff the first value is smaller than or equal to the second value. */ (<=) infix 4 :: !a !a -> Bool | Ord a (<=) infix 4 :: !a !a -> Bool | Ord a (<=) x y :== not (y=) infix 4 :: !a !a -> Bool | Ord a (>=) infix 4 :: !a !a -> Bool | Ord a (>=) x y :== not (x=) x y :== not (x a | Ord a min::!a !a -> a | Ord a min x y :== case (x a | Ord a max::!a !a -> a | Ord a max x y :== case (x