mirror of
https://github.com/github/semantic.git
synced 2024-12-19 04:41:47 +03:00
Implement GSequenceable over [] directly.
This commit is contained in:
parent
609a90fb90
commit
dabffff7d0
@ -1,7 +1,6 @@
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
module Data.Sequenceable.Generic where
|
||||
|
||||
import Data.Sequenceable
|
||||
import GHC.Generics
|
||||
import Prologue
|
||||
|
||||
@ -38,4 +37,6 @@ instance (GSequenceable f, GSequenceable g) => GSequenceable (f :+: g) where
|
||||
instance (GSequenceable f, GSequenceable g) => GSequenceable (f :*: g) where
|
||||
gsequenceAlt (a :*: b) = (:*:) <$> gsequenceAlt a <*> gsequenceAlt b
|
||||
|
||||
instance GSequenceable [] where gsequenceAlt = sequenceAlt
|
||||
instance GSequenceable [] where
|
||||
gsequenceAlt (x:xs) = ((:) <$> x <|> pure identity) <*> gsequenceAlt xs
|
||||
gsequenceAlt [] = pure []
|
||||
|
Loading…
Reference in New Issue
Block a user