Created
February 8, 2017 00:34
-
-
Save seanparsons/a919851e3666b1ae91e1ff40145d13b4 to your computer and use it in GitHub Desktop.
Could not match type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Could not match type | |
{ "third" :: Map t0 t1 | |
| t2 | |
} | |
with type | |
Model | |
while checking that type Model | |
is at least as general as type { "third" :: Map t0 t1 | |
| t2 | |
} | |
while checking that expression firstModel | |
has type { "third" :: Map t0 t1 | |
| t2 | |
} | |
while checking type of property accessor firstModel."third" | |
in value declaration semigroupModel | |
where t1 is an unknown type | |
t0 is an unknown type | |
t2 is an unknown type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype Model = Model | |
{ first :: Map String String | |
, second :: Map String String | |
, third :: Map String String | |
, fourth :: Map String String | |
} | |
instance semigroupModel :: Semigroup Model where | |
append firstModel secondModel = | |
let newFirst = union firstModel.first secondModel.first | |
newSecond = union firstModel.second secondModel.second | |
newThird = union firstModel.third secondModel.third | |
newFourth = union firstModel.fourth secondModel.fourth | |
in Model { first: newFirst, second: newSecond, third: newThird, fourth: newFourth} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment