@@ -97,6 +97,12 @@ actuallyUnify variable1 variable2 = do
97 cmpVars <- liftIO $ forM [1..length vs] $ \_ -> var (Is Comparable)
97 cmpVars <- liftIO $ forM [1..length vs] $ \_ -> var (Is Comparable)
98 zipWithM_ unify vs cmpVars
98 zipWithM_ unify vs cmpVars
100+ unifyAppendable varSuper varFlex =
101+ do struct <- liftIO $ collectApps varFlex
103+ List _ -> flexAndUnify varSuper
104+ _ -> comparableError ""
100 superUnify =
106 superUnify =
101 case (flex desc1, flex desc2, name desc1, name desc2) of
107 case (flex desc1, flex desc2, name desc1, name desc2) of
102 (Is super1, Is super2, _, _)
108 (Is super1, Is super2, _, _)
@@ -112,6 +118,11 @@ actuallyUnify variable1 variable2 = do
112 (Is Comparable, _, _, _) -> unifyComparableStructure variable1 variable2
118 (Is Comparable, _, _, _) -> unifyComparableStructure variable1 variable2
113 (_, Is Comparable, _, _) -> unifyComparableStructure variable2 variable1
119 (_, Is Comparable, _, _) -> unifyComparableStructure variable2 variable1
121+ (Is Appendable, _, _, Just "Text") -> flexAndUnify variable1
122+ (_, Is Appendable, Just "Text", _) -> flexAndUnify variable2
123+ (Is Appendable, _, _, _) -> unifyAppendable variable1 variable2
124+ (_, Is Appendable, _, _) -> unifyAppendable variable2 variable1
115 _ -> TS.addError "" variable1 variable2
126 _ -> TS.addError "" variable1 variable2
117 case (structure desc1, structure desc2) of
128 case (structure desc1, structure desc2) of