Skip to content

Instantly share code, notes, and snippets.

@seanparsons
Created February 8, 2017 00:34
Show Gist options
  • Save seanparsons/a919851e3666b1ae91e1ff40145d13b4 to your computer and use it in GitHub Desktop.
Save seanparsons/a919851e3666b1ae91e1ff40145d13b4 to your computer and use it in GitHub Desktop.
Could not match type
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
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