diff options
Diffstat (limited to 'backend/backendsupport.icl')
-rw-r--r-- | backend/backendsupport.icl | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/backend/backendsupport.icl b/backend/backendsupport.icl index ba7677b..a7c9bee 100644 --- a/backend/backendsupport.icl +++ b/backend/backendsupport.icl @@ -2,73 +2,3 @@ module owner: Ronny Wichers Schreur */ implementation module backendsupport - -import StdArray -/*2.0 -from StdInt import class + (..),class == (..) -0.2*/ -//1.3 -from StdInt import +, == -//3.1 -from StdFunc import `bind` - -identity - :== \x -> x - -// binding sugar -(==>) infix -(==>) f g - :== f `bind` g - -// o` :== flip o -(o`) infixr -(o`) f g - :== \x -> g (f x) - -(:-) infixl -(:-) a f - :== f a - -foldState function list - :== foldState list - where - foldState [] - = identity - foldState [hd:tl] - = function hd - o` foldState tl - -foldStateA function array - :== foldStateA 0 - where - arraySize - = size array - foldStateA index - | index == arraySize - = identity - // otherwise - = function array.[index] - o` foldStateA (index+1) - -foldStateWithIndexA function array - :== foldStateWithIndexA 0 - where - arraySize - = size array - foldStateWithIndexA index - | index == arraySize - = identity - // otherwise - = function index array.[index] - o` foldStateWithIndexA (index+1) - -foldrA function result array - :== foldrA 0 - where - arraySize - = size array - foldrA index - | index == arraySize - = result - // otherwise - = function array.[index] (foldrA (index+1)) |