@@ -30,7 +30,6 @@ effectTypes :: TS.Env -> ErrorT [P.Doc] IO (Map.Map String ST.CanonicalType)
30effectTypes environment =
30effectTypes environment =
31 do environment' <- liftIO $ Traverse.traverse TT.toSrcType environment
31 do environment' <- liftIO $ Traverse.traverse TT.toSrcType environment
32 mainCheck environment'
32 mainCheck environment'
33− performCheck environment'
34 return environment'
33 return environment'
@@ -111,39 +110,6 @@ badMainMessage typeOfMain =
118− => Map.Map String ST.CanonicalType
119− -> ErrorT [P.Doc] m ()
121− let check (name, tipe) =
122− case Var.fromEffectName name of
127− case ST.deepDealias tipe of
128− ST.App (ST.Type task) [_, _]
129− | Var.isTask task ->
132− throwError [ badPerformMessage lineNumber tipe ]
134− mapM_ check (Map.toList env)
137−badPerformMessage :: String -> ST.CanonicalType -> P.Doc
138−badPerformMessage lineNumber tipe =
140− [ P.text $ "Type Error: the 'perform' declaration on line " ++ lineNumber
141− , P.text "It must have type Task, but instead it has type:\n"
142− , P.nest 4 (PP.pretty tipe)
147-- INFINITE TYPES
113-- INFINITE TYPES
149occurs :: (String, TT.Variable) -> StateT TS.SolverState IO ()
115occurs :: (String, TT.Variable) -> StateT TS.SolverState IO ()