on master help sign in
Get rid of dead code regarding perform
c8532b9Evan Czaplicki
src/AST/Variable.hs−12
@@ -42,18 +42,6 @@ fromModule home name =
42 Canonical (Module home) name
42 Canonical (Module home) name
43
43
44
44
45−toEffectName :: Int -> String
46−toEffectName lineNumber =
47− "$perform$" ++ show lineNumber
48−
49−
50−fromEffectName :: String -> Maybe String
51−fromEffectName name =
52− case List.splitAt 9 name of
53− ("$perform$", number) -> Just number
54− _ -> Nothing
55−
56−
57-- VARIABLE RECOGNIZERS
45-- VARIABLE RECOGNIZERS
58
46
59is :: [String] -> String -> Canonical -> Bool
47is :: [String] -> String -> Canonical -> Bool
src/Type/ExtraChecks.hs−34
@@ -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'
35
34
36
35
@@ -111,39 +110,6 @@ badMainMessage typeOfMain =
111 ]
110 ]
112
111
113
112
114−-- PERFORM TYPE
115−
116−performCheck
117− :: (Monad m)
118− => Map.Map String ST.CanonicalType
119− -> ErrorT [P.Doc] m ()
120−performCheck env =
121− let check (name, tipe) =
122− case Var.fromEffectName name of
123− Nothing ->
124− return ()
125−
126− Just lineNumber ->
127− case ST.deepDealias tipe of
128− ST.App (ST.Type task) [_, _]
129− | Var.isTask task ->
130− return ()
131− _ ->
132− throwError [ badPerformMessage lineNumber tipe ]
133− in
134− mapM_ check (Map.toList env)
135−
136−
137−badPerformMessage :: String -> ST.CanonicalType -> P.Doc
138−badPerformMessage lineNumber tipe =
139− P.vcat
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)
143− , P.text " "
144− ]
145−
146−
147-- INFINITE TYPES
113-- INFINITE TYPES
148
114
149occurs :: (String, TT.Variable) -> StateT TS.SolverState IO ()
115occurs :: (String, TT.Variable) -> StateT TS.SolverState IO ()