@@ -4,6 +4,7 @@ import ProjectM36.Base
44import qualified ProjectM36.TypeConstructorDef as TCD
55import qualified ProjectM36.TypeConstructor as TC
66import qualified ProjectM36.DataConstructorDef as DCD
7+import ProjectM36.MiscUtils
78import ProjectM36.Error
89import qualified ProjectM36.Attribute as A
910import qualified Data.Vector as V
@@ -128,12 +129,6 @@ validateTypeConstructorDef tConsDef dConsList = execWriter $ do
128129 mapM_ tell [map DataConstructorUsesUndeclaredTypeVariable (S.toList varsDiff)]
129130 pure ()
130131
131−--returns duplicates of a pre-sorted list
132−dupes :: Eq a => [a] -> [a]
133−dupes [] = []
134−dupes (_:[]) = []
135−dupes (x:y:[]) = if x == y then [x] else []
136−dupes (x:y:xs) = dupes(x:[y]) ++ dupes(xs)
137132
138133-- | Create an atom type iff all type variables are provided.
139134-- Either Int Text -> ConstructedAtomType "Either" {Int , Text}