on master help sign in
Strictly evaluate data constructor args
ed0ba83David Christiansen
src/Core/Execute.hs+5
@@ -274,6 +274,11 @@ execApp' env ctxt f@(EP _ (UN "mkForeign") _) args@(ty:fn:xs) | Just (FFun f arg
274 Just r -> return (mkEApp r (drop (length argTs) xs))
274 Just r -> return (mkEApp r (drop (length argTs) xs))
275 | otherwise = return (mkEApp f args)
275 | otherwise = return (mkEApp f args)
276
276
277+execApp' env ctxt c@(EP (DCon _ arity) n _) args =
278+ do args' <- mapM tryForce (take arity args)
279+ let restArgs = drop arity args
280+ execApp' env ctxt (mkEApp c args') restArgs
281+
277execApp' env ctxt f@(EP _ n _) args =
282execApp' env ctxt f@(EP _ n _) args =
278 do let val = lookupDef n ctxt
283 do let val = lookupDef n ctxt
279 case val of
284 case val of