Commit 573355a7 authored by Jan-Hendrik Matthes's avatar Jan-Hendrik Matthes 😄

Remove duplicate code in the dictionary transformation of patterns

parent fb099944
......@@ -816,9 +816,9 @@ instance DictTrans Pattern where
dictTrans (VariablePattern _ pty v) =
return $ VariablePattern NoSpanInfo (transformPredType $ unpredType pty) v
dictTrans (ConstructorPattern _ pty c ts) = do
pls <- matchPredList (conType c) $
foldr (TypeArrow . typeOf) (transformPredType $ unpredType pty) ts
ConstructorPattern NoSpanInfo (transformPredType $ unpredType pty) c <$> addDictArgs pls ts
let tpty = transformPredType (unpredType pty)
pls <- matchPredList (conType c) $ foldr (TypeArrow . typeOf) tpty ts
ConstructorPattern NoSpanInfo tpty c <$> addDictArgs pls ts
dictTrans (AsPattern _ v t) =
AsPattern NoSpanInfo v <$> dictTrans t
dictTrans t =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment