1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 20:41:38 +03:00

Define Sequenceable over [] in terms of GSequenceable over [].

This commit is contained in:
Rob Rix 2016-07-22 16:14:27 -04:00
parent dabffff7d0
commit f959917ae3

View File

@ -1,5 +1,6 @@
module Data.Sequenceable where module Data.Sequenceable where
import Data.Sequenceable.Generic
import Prologue import Prologue
-- Classes -- Classes
@ -10,6 +11,4 @@ class Functor t => Sequenceable t where
-- Instances -- Instances
instance Sequenceable [] where instance Sequenceable [] where sequenceAlt = gsequenceAlt
sequenceAlt (x:xs) = ((:) <$> x <|> pure identity) <*> sequenceAlt xs
sequenceAlt [] = pure []