on master help sign in
Add String as an appendable type
commitdce5e3eadea35d49bee2f60d7fca9cea9b15a00f authorEvan Czaplicki <info@elm-lang.org> dateWed 2 Oct 2013, 16:04 (13 years ago) parent402f048
1 file changed+4−2
compiler/Type/Unify.hs+4−2
compiler/Type/Unify.hs+4−2
@@ -129,8 +129,10 @@ actuallyUnify span variable1 variable2 = do
129129 (Is Comparable, _, _, _) -> unifyComparableStructure variable1 variable2
130130 (_, Is Comparable, _, _) -> unifyComparableStructure variable2 variable1
131131
132− (Is Appendable, _, _, Just "Text.Text") -> flexAndUnify variable1
133− (_, Is Appendable, Just "Text.Text", _) -> flexAndUnify variable2
132+ (Is Appendable, _, _, Just ctor)
133+ | ctor `elem` ["Text.Text","String"] -> flexAndUnify variable1
134+ (_, Is Appendable, Just ctor, _)
135+ | ctor `elem` ["Text.Text","String"] -> flexAndUnify variable2
134136 (Is Appendable, _, _, _) -> unifyAppendable variable1 variable2
135137 (_, Is Appendable, _, _) -> unifyAppendable variable2 variable1
136138