@@ -60,6 +60,7 @@ data ExecVal = EP NameType Name ExecVal
6060 | EBind Name (Binder ExecVal) (ExecVal -> Exec ExecVal)
6161 | EApp ExecVal ExecVal
6262 | EType UExp
63+ | EUType Universe
6364 | EErased
6465 | EConstant Const
6566 | forall a. EPtr (Ptr a)
@@ -72,6 +73,7 @@ instance Show ExecVal where
7273 show (EBind n b body) = "EBind " ++ show b ++ " <<fn>>"
7374 show (EApp e1 e2) = show e1 ++ " (" ++ show e2 ++ ")"
7475 show (EType _) = "Type"
76+ show (EUType _) = "UType"
7577 show EErased = "[__]"
7678 show (EConstant c) = show c
7779 show (EPtr p) = "<<ptr " ++ show p ++ ">>"
@@ -102,6 +104,7 @@ toTT (EApp e1 e2) = do e1' <- toTT e1
102104 e2' <- toTT e2
103105 return $ App e1' e2'
104106toTT (EType u) = return $ TType u
107+toTT (EUType u) = return $ UType u
105108toTT EErased = return Erased
106109toTT (EConstant c) = return (Constant c)
107110toTT (EThunk ctxt env tm) = do env' <- mapM toBinder env
@@ -205,6 +208,7 @@ doExec env ctxt (Proj tm i) = let (x, xs) = unApply tm in
205208doExec env ctxt Erased = return EErased
206209doExec env ctxt Impossible = fail "Tried to execute an impossible case"
207210doExec env ctxt (TType u) = return (EType u)
211+doExec env ctxt (UType u) = return (EUType u)
208212
209213execApp :: ExecEnv -> Context -> ExecVal -> [ExecVal] -> Exec ExecVal
210214execApp env ctxt v [] = return v -- no args is just a constant! can result from function calls
@@ -404,7 +408,7 @@ force = sUN "Force"
404408-- | Look up primitive operations in the global table and transform them into ExecVal functions
405409getOp :: Name -> [ExecVal] -> Maybe (Exec ExecVal)
406410getOp fn [_, _, x] | fn == pbm = Just (return x)
407−getOp fn [EP _ fn' _]
411+getOp fn [EP _ fn' _]
408412 | fn == prs && fn' == pstd =
409413 Just $ do line <- execIO getLine
410414 return (EConstant (Str line))
@@ -548,7 +552,7 @@ foreignFromTT t = case (unApplyV t) of
548552 _ -> trace ("failed to construct ffun") Nothing
549553
550554getFTy :: ExecVal -> Maybe FType
551−getFTy (EApp (EP _ (UN fi) _) (EP _ (UN intTy) _))
555+getFTy (EApp (EP _ (UN fi) _) (EP _ (UN intTy) _))
552556 | fi == txt "FIntT" =
553557 case str intTy of
554558 "ITNative" -> Just (FArith (ATInt ITNative))