From: Matthijs Kooijman Date: Thu, 9 Apr 2009 16:23:23 +0000 (+0200) Subject: Properly save state propagated flat functions. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=404a426540aef7f29b8dee73140b8ce897dc470f;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Properly save state propagated flat functions. Previously, the propagated state was not properly saved, resulting in stateful functions being defined, while stateless versions were instantiated. --- diff --git a/Translator.hs b/Translator.hs index c4bcdbd..071e9d2 100644 --- a/Translator.hs +++ b/Translator.hs @@ -176,7 +176,7 @@ flattenBind hsfunc bind@(NonRec var expr) = do -- Propagate state variables let flatfunc' = propagateState hsfunc flatfunc -- Store the flat function in the session - modA tsFlatFuncs (Map.insert hsfunc flatfunc) + modA tsFlatFuncs (Map.insert hsfunc flatfunc') -- Flatten any functions used let used_hsfuncs = Maybe.mapMaybe usedHsFunc (flat_defs flatfunc') mapM_ resolvFunc used_hsfuncs