Commit 596ecb71 authored by John van Groningen's avatar John van Groningen

remove function accMaybe and type St (St will be removed from module StdEnv)

parent 072f056b
......@@ -4,7 +4,6 @@ definition module StdMaybe
// Clean StdLib library module, version 1.0
// ********************************************************************************
from StdFunc import :: St;
from StdOverloaded import class ==(..);
:: Maybe x
......@@ -19,10 +18,6 @@ fromJust :: !(Maybe .x) -> .x // \(Just x) -> x
u_isJust :: !u:(Maybe .x) -> (!Bool, !u:Maybe .x)
u_isNothing :: !u:(Maybe .x) -> (!Bool, !u:Maybe .x)
accMaybe :: .(St .x .a) !u:(Maybe .x) -> (!Maybe .a,!u:Maybe .x)
// accMaybe f (Just x) = (Just (fst (f x)),Just (snd (f x)))
// accMaybe f Nothing = (Nothing,Nothing)
mapMaybe :: .(.x -> .y) !(Maybe .x) -> Maybe .y
// mapMaybe f (Just x) = Just (f x)
// mapMaybe f Nothing = Nothing
......
......@@ -4,7 +4,6 @@ implementation module StdMaybe
// Clean StdLib library module, version 1.0
// ********************************************************************************
from StdFunc import :: St;
from StdOverloaded import class ==(..);
:: Maybe x
......@@ -34,13 +33,6 @@ u_isNothing just
fromJust :: !(Maybe .x) -> .x
fromJust (Just x) = x
accMaybe :: .(St .x .a) !u:(Maybe .x) -> (!Maybe .a,!u:Maybe .x)
accMaybe f (Just x)
# (a,x) = f x
= (Just a,Just x)
accMaybe _ nothing
= (Nothing,nothing)
mapMaybe :: .(.x -> .y) !(Maybe .x) -> Maybe .y
mapMaybe f (Just x) = Just (f x)
mapMaybe _ nothing = Nothing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment