@@ -62,7 +62,7 @@ monoscheme headers = Scheme [] [] (noneNoDocs CTrue) headers
62infixl 8 /\
62infixl 8 /\
64(/\) :: Constraint a b -> Constraint a b -> Constraint a b
64(/\) :: Constraint a b -> Constraint a b -> Constraint a b
65−a@(L s1 c1) /\ b@(L s2 c2) =
65+a@(L _ c1) /\ b@(L _ c2) =
66 case (c1, c2) of
66 case (c1, c2) of
67 (CTrue, _) -> b
67 (CTrue, _) -> b
68 (_, CTrue) -> a
68 (_, CTrue) -> a
@@ -95,6 +95,7 @@ data Flex = Rigid | Flexible | Constant | Is SuperType
95data SuperType = Number | Comparable | Appendable
95data SuperType = Number | Comparable | Appendable
96 deriving (Show, Eq)
96 deriving (Show, Eq)
98+namedVar :: Flex -> String -> IO Variable
98namedVar flex name = UF.fresh $ Descriptor {
99namedVar flex name = UF.fresh $ Descriptor {
99 structure = Nothing,
100 structure = Nothing,
100 rank = noRank,
101 rank = noRank,
@@ -104,6 +105,7 @@ namedVar flex name = UF.fresh $ Descriptor {
104 mark = noMark
105 mark = noMark
108+var :: Flex -> IO Variable
107var flex = UF.fresh $ Descriptor {
109var flex = UF.fresh $ Descriptor {
108 structure = Nothing,
110 structure = Nothing,
109 rank = noRank,
111 rank = noRank,
@@ -113,6 +115,7 @@ var flex = UF.fresh $ Descriptor {
113 mark = noMark
115 mark = noMark
118+structuredVar :: Term1 Variable -> IO Variable
116structuredVar structure = UF.fresh $ Descriptor {
119structuredVar structure = UF.fresh $ Descriptor {
117 structure = Just structure,
120 structure = Just structure,
118 rank = noRank,
121 rank = noRank,
@@ -368,8 +371,8 @@ toSrcType variable = do
368 Src.Record fs'' <$> toSrcType ext
371 Src.Record fs'' <$> toSrcType ext
369 Nothing ->
372 Nothing ->
370 case name desc of
373 case name desc of
371− Just x@(c:cs) | Char.isLower c -> return (Src.Var x)
374+ Just x@(c:_) | Char.isLower c -> return (Src.Var x)
372− | otherwise -> return (Src.Data x [])
375+ | otherwise -> return (Src.Data x [])
373 _ -> error $ concat
376 _ -> error $ concat
374 [ "Problem converting the following type "
377 [ "Problem converting the following type "
375 , "from a type-checker type to a source-syntax type:"
378 , "from a type-checker type to a source-syntax type:"
@@ -383,12 +386,12 @@ collectApps variable = go [] variable
383 go vars variable = do
386 go vars variable = do
384 desc <- UF.descriptor variable
387 desc <- UF.descriptor variable
385 case (structure desc, vars) of
388 case (structure desc, vars) of
386− (Nothing, [v] ) -> case name desc of
389+ (Nothing, [v]) -> case name desc of
387 Just "_List" -> return (List v)
390 Just "_List" -> return (List v)
388 _ -> return Other
391 _ -> return Other
389− (Nothing, vs ) -> case name desc of
392+ (Nothing, vs) -> case name desc of
390 Just ctor | isTuple ctor -> return (Tuple vs)
393 Just ctor | isTuple ctor -> return (Tuple vs)
391 _ -> return Other
394 _ -> return Other
392− (Just term, vs) -> case term of
395+ (Just term, _) -> case term of
393− App1 a b -> go (vars ++ [b]) a
396+ App1 a b -> go (vars ++ [b]) a
394− _ -> return Other
397+ _ -> return Other