@@ -274,6 +274,16 @@ execApp' env ctxt f@(EP _ (UN "mkForeign") _) args@(ty:fn:xs) | Just (FFun f arg
274274 Just r -> return (mkEApp r (drop (length argTs) xs))
275275 | otherwise = return (mkEApp f args)
276276
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+
282+execApp' env ctxt c@(EP (TCon _ arity) n _) args =
283+ do args' <- mapM tryForce (take arity args)
284+ let restArgs = drop arity args
285+ execApp' env ctxt (mkEApp c args') restArgs
286+
277287execApp' env ctxt f@(EP _ n _) args =
278288 do let val = lookupDef n ctxt
279289 case val of
@@ -350,7 +360,7 @@ execApp' env ctxt f@(EP _ n _) args =
350360 return (EConstant (Str line))
351361 getOp (UN "prim__readString") [EHandle h] =
352362 Just $ do contents <- execIO $ hGetLine h
353− return (EConstant (Str contents))
363+ return (EConstant (Str (contents ++ "\n")))
354364 getOp (UN "prim__shLInt") [EConstant (I i1), EConstant (I i2)] =
355365 primRes I (shiftL i1 i2)
356366 getOp (UN "prim__shRInt") [EConstant (I i1), EConstant (I i2)] =