mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
Missing one case for this monoid instance to be associative
This commit is contained in:
parent
bee7d1ee6a
commit
e53a8342a3
@ -181,6 +181,7 @@ instance Monoid Value where
|
||||
mempty = Null
|
||||
mappend a b | Null <- b = A.Array (singleton a)
|
||||
| Null <- a = A.Array (singleton b)
|
||||
| A.Array a' <- a, A.Array b' <- b = A.Array (a' ++ b')
|
||||
| A.Array b' <- b = A.Array (singleton a ++ b')
|
||||
| A.Array a' <- a = A.Array (a' ++ singleton b)
|
||||
| otherwise = A.Array (fromList [a, b])
|
||||
|
Loading…
Reference in New Issue
Block a user