1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Define a Listable1 instance for NonEmpty.

This commit is contained in:
Rob Rix 2017-09-25 19:19:37 -04:00
parent b32a911484
commit b0c79efa9b

View File

@ -32,6 +32,7 @@ import Control.Monad.Trans.Free as FreeF
import Data.ByteString (ByteString)
import Data.Char (chr)
import Data.Functor.Both
import Data.List.NonEmpty
import Data.Range
import Data.Record
import Data.Semigroup
@ -136,6 +137,9 @@ instance Listable1 [] where
liftTiers tiers = go
where go = cons0 [] \/ liftCons2 tiers go (:)
instance Listable1 NonEmpty where
liftTiers tiers = liftCons2 tiers (liftTiers tiers) (:|)
instance Listable2 p => Listable1 (Join p) where
liftTiers tiers = liftCons1 (liftTiers2 tiers tiers) Join