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