mirror of
https://github.com/github/semantic.git
synced 2024-12-19 04:41:47 +03:00
Define a merge method in Mergeable which generalizes sequenceAlt.
This commit is contained in:
parent
8f8bf5dad9
commit
afd67dbbd9
@ -8,6 +8,10 @@ import Prologue
|
||||
-- Classes
|
||||
|
||||
class Functor t => Mergeable t where
|
||||
merge :: Alternative f => (a -> f b) -> t a -> f (t b)
|
||||
default merge :: (Generic1 t, GMergeable (Rep1 t), Alternative f) => (a -> f b) -> t a -> f (t b)
|
||||
merge = genericMerge
|
||||
|
||||
sequenceAlt :: Alternative f => t (f a) -> f (t a)
|
||||
default sequenceAlt :: (Generic1 t, GMergeable (Rep1 t), Alternative f) => t (f a) -> f (t a)
|
||||
sequenceAlt = genericSequenceAlt
|
||||
|
Loading…
Reference in New Issue
Block a user