mirror of
https://github.com/github/semantic.git
synced 2025-01-02 20:41:38 +03:00
Define a Monoid instance for Assignment.
This commit is contained in:
parent
ddb5518878
commit
d06927f604
@ -333,6 +333,10 @@ makeState = State 0 (Info.Pos 1 1) []
|
||||
|
||||
-- Instances
|
||||
|
||||
instance (Enum grammar, Eq (ast (AST ast grammar)), Ix grammar) => Monoid (Assignment ast grammar a) where
|
||||
mempty = empty
|
||||
mappend = (<|>)
|
||||
|
||||
instance (Enum grammar, Eq (ast (AST ast grammar)), Ix grammar) => Alternative (Assignment ast grammar) where
|
||||
empty :: HasCallStack => Assignment ast grammar a
|
||||
empty = tracing (Alt []) `Then` return
|
||||
|
Loading…
Reference in New Issue
Block a user