We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 653ede3 + d203746 commit d09d0ddCopy full SHA for d09d0dd
src/Constrained/AbstractSyntax.hs
@@ -104,6 +104,10 @@ runTermE env = \case
104
V v -> case Env.lookup env v of
105
Just a -> Right a
106
Nothing -> Left (pure ("Couldn't find " ++ show v ++ " in " ++ show env))
107
+ -- The first two cases here are an optimization to avoid dispatching to `mapMList` (which does all sorts of
108
+ -- unpacking and packing and doesn't fuse nicely with `uncurryList_`)
109
+ App f (ta :> Nil) -> semantics f <$> runTermE env ta
110
+ App f (ta :> tb :> Nil) -> semantics f <$> runTermE env ta <*> runTermE env tb
111
App f ts -> do
112
vs <- mapMList (fmap Identity . runTermE env) ts
113
pure $ uncurryList_ runIdentity (semantics f) vs
0 commit comments