summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/Forest.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-10-21 15:01:52 +0000
committerkrasimir <krasimir@chalmers.se>2010-10-21 15:01:52 +0000
commit822a70cf7a5971cc9d60239f98243bc1a07e12a5 (patch)
treeb336ae60bd56ed189e661b164c23b655ba396f4a /src/runtime/haskell/PGF/Forest.hs
parent4f3b4bb19f1fb7f7d22ac52b230b7333a6a6c41d (diff)
change the TcM monad to continuation passing style. The old monad caused stack overflow for large search spaces
Diffstat (limited to 'src/runtime/haskell/PGF/Forest.hs')
-rw-r--r--src/runtime/haskell/PGF/Forest.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/haskell/PGF/Forest.hs b/src/runtime/haskell/PGF/Forest.hs
index 5d06f4e97..a4a9266f7 100644
--- a/src/runtime/haskell/PGF/Forest.hs
+++ b/src/runtime/haskell/PGF/Forest.hs
@@ -119,7 +119,7 @@ isLindefCId id
getAbsTrees :: Forest -> PArg -> Maybe Type -> Maybe Int -> Either [(FId,TcError)] [Expr]
getAbsTrees (Forest abs cnc forest root) arg@(PArg _ fid) ty dp =
let (err,res) = runTcM abs (do e <- go Set.empty emptyScope (fmap (TTyp []) ty) arg
- generateForForest (prove dp) e) fid IntMap.empty
+ generateForForest (prove dp) e) emptyMetaStore fid
in if null res
then Left (nub err)
else Right (nubsort [e | (_,_,e) <- res])
@@ -205,7 +205,7 @@ instance Selector FId where
splitSelector s = (s,s)
select cat scope dp = do
gens <- typeGenerators scope cat
- TcM (\abstr s ms -> iter s ms gens)
+ TcM (\abstr k h -> iter k gens)
where
- iter s ms [] = Zero
- iter s ms ((_,e,tty):fns) = Plus (Ok s ms (e,tty)) (iter s ms fns)
+ iter k [] ms s = id
+ iter k ((_,e,tty):fns) ms s = k (e,tty) ms s . iter k fns ms s