on master help sign in
Remove dead code, only collect canonical lambdas
commit037bd143a1e227340fd43f45120b8c9a30109b11 authorEvan Czaplicki <info@elm-lang.org> dateTue 20 Oct 2015, 14:32 (11 years ago) parent2b52f51
1 file changed+4−23
src/AST/Type.hs+4−23
src/AST/Type.hs+4−23
@@ -143,31 +143,12 @@ dealiasHelp typeTable tipe =
143143
144144collectLambdas :: Canonical -> [Canonical]
145145collectLambdas 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) =
161146 case tipe of
162− RLambda arg body -> Just (arg, body)
163− _ -> Nothing
164−
147+ Lambda arg result ->
148+ arg : collectLambdas result
165149
166−getCanLambda :: Canonical -> Maybe (Canonical, Canonical)
167−getCanLambda tipe =
168− case tipe of
169− Lambda arg body -> Just (arg, body)
170− _ -> Nothing
150+ _ ->
151+ []
171152
172153
173154