on master help sign in
Remove dead code, only collect canonical lambdas
037bd14Evan Czaplicki
src/AST/Type.hs+4−23
@@ -143,31 +143,12 @@ dealiasHelp typeTable tipe =
143
143
144collectLambdas :: Canonical -> [Canonical]
144collectLambdas :: Canonical -> [Canonical]
145collectLambdas tipe =
145collectLambdas tipe =
146− gatherLambda getCanLambda tipe
147−
148−
149−gatherLambda :: (t -> Maybe (t,t)) -> t -> [t]
150−gatherLambda get tipe =
151− case get tipe of
152− Just (arg, body) ->
153− arg : gatherLambda get body
154−
155− Nothing ->
156− [tipe]
157−
158−
159−getRawLambda :: Raw -> Maybe (Raw, Raw)
160−getRawLambda (A.A _ tipe) =
161 case tipe of
146 case tipe of
162− RLambda arg body -> Just (arg, body)
147+ Lambda arg result ->
163− _ -> Nothing
148+ arg : collectLambdas result
164−
165
149
166−getCanLambda :: Canonical -> Maybe (Canonical, Canonical)
150+ _ ->
167−getCanLambda tipe =
151+ []
168− case tipe of
169− Lambda arg body -> Just (arg, body)
170− _ -> Nothing
171
152
172
153
173
154