Verified Commit 4f022227 authored by Camil Staps's avatar Camil Staps 🙂

Remove strictness from mapSt

parent 7c487b5e
Pipeline #15686 passed with stage
in 1 minute and 52 seconds
......@@ -51,7 +51,7 @@ seqSt :: !(a .st -> .st) ![a] !.st -> .st
* @param The initial state.
* @result The value results and the final state.
*/
mapSt :: !(a .st -> (!b,!.st)) ![a] !.st -> (![b],!.st)
mapSt :: !(a .st -> (!b,!.st)) ![a] !.st -> (![b],.st)
/**
* The fixed point combinator, reducing `fix f` to `f (fix f)`.
*/
......
......@@ -31,11 +31,11 @@ seqSt :: !(a .st -> .st) ![a] !.st -> .st
seqSt f [] st = st
seqSt f [x:xs] st = seqSt f xs (f x st)
mapSt :: !(a .st -> (!b,!.st)) ![a] !.st -> (![b],!.st)
mapSt :: !(a .st -> (!b,!.st)) ![a] !.st -> (![b],.st)
mapSt f [] st = ([], st)
mapSt f [x:xs] st
#! (y, st) = f x st
#! (ys, st) = mapSt f xs st
# (y, st) = f x st
# (ys, st) = mapSt f xs st
= ([y:ys], st)
fix :: !(a -> a) -> a
......
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