1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

Define a default implementation of gsequenceAlt.

This commit is contained in:
Rob Rix 2016-07-22 15:42:31 -04:00
parent ff869ec517
commit bc5f05494d

View File

@ -1,3 +1,4 @@
{-# LANGUAGE DefaultSignatures #-}
module Data.Sequenceable.Generic where
import GHC.Generics
@ -7,6 +8,8 @@ import Prologue
class GSequenceable t where
gsequenceAlt :: Alternative f => t (f a) -> f (t a)
default gsequenceAlt :: (Generic1 t, GSequenceable (Rep1 t), Alternative f) => t (f a) -> f (t a)
gsequenceAlt = fmap to1 . gsequenceAlt . from1
-- Instances