outPatType (ConOpPat _ _ _ ty) = ty
outPatType (ListPat ty _) = mkListTy ty
outPatType (TuplePat pats) = mkTupleTy (length pats) (map outPatType pats)
+outPatType (RecPat _ ty _) = ty
outPatType (LitPat lit ty) = ty
outPatType (NPat lit ty _) = ty
-outPatType (DictPat ds ms) = case (length ds + length ms) of
+outPatType (DictPat ds ms) = case (length ds_ms) of
0 -> unitTy
- 1 -> idType (head (ds ++ ms))
- n -> mkTupleTy n (map idType (ds ++ ms))
+ 1 -> idType (head ds_ms)
+ n -> mkTupleTy n (map idType ds_ms)
+ where
+ ds_ms = ds ++ ms
\end{code}
collectTypedMonoBinders :: TypecheckedMonoBinds -> [Id]
collectTypedMonoBinders EmptyMonoBinds = []
collectTypedMonoBinders (PatMonoBind pat _ _) = collectTypedPatBinders pat
-collectTypedMonoBinders (FunMonoBind f _ _) = [f]
+collectTypedMonoBinders (FunMonoBind f _ _ _) = [f]
collectTypedMonoBinders (VarMonoBind v _) = [v]
collectTypedMonoBinders (AndMonoBinds bs1 bs2)
= collectTypedMonoBinders bs1 ++ collectTypedMonoBinders bs2
collectTypedPatBinders (ConOpPat p1 _ p2 _) = collectTypedPatBinders p1 ++ collectTypedPatBinders p2
collectTypedPatBinders (ListPat t pats) = concat (map collectTypedPatBinders pats)
collectTypedPatBinders (TuplePat pats) = concat (map collectTypedPatBinders pats)
+collectTypedPatBinders (RecPat _ _ fields) = concat (map (\ (f,pat,_) -> collectTypedPatBinders pat) fields)
collectTypedPatBinders (DictPat ds ms) = ds ++ ms
collectTypedPatBinders any_other_pat = [ {-no binders-} ]
\end{code}