Skip to content

Commit c553053

Browse files
byorgeylambdageek
authored andcommitted
Add Alpha and Subst instances for NonEmpty
1 parent 7ce8463 commit c553053

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Unbound/Generics/LocallyNameless/Alpha.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import Data.Function (on)
6060
import Data.Functor.Contravariant (Contravariant(..))
6161
import Data.Foldable (Foldable(..))
6262
import Data.List (intersect)
63+
import Data.List.NonEmpty (NonEmpty)
6364
import Data.Monoid (Monoid(..), All(..))
6465
import Data.Ratio (Ratio)
6566
import Data.Semigroup as Sem
@@ -687,6 +688,7 @@ instance Alpha Bool
687688

688689
instance Alpha a => Alpha (Maybe a)
689690
instance Alpha a => Alpha [a]
691+
instance Alpha a => Alpha (NonEmpty a)
690692
instance Alpha ()
691693
instance (Alpha a,Alpha b) => Alpha (Either a b)
692694
instance (Alpha a,Alpha b) => Alpha (a,b)

src/Unbound/Generics/LocallyNameless/Subst.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ module Unbound.Generics.LocallyNameless.Subst (
5353
import GHC.Generics
5454

5555
import Data.List (find)
56+
import Data.List.NonEmpty (NonEmpty)
5657

5758
import Unbound.Generics.LocallyNameless.Name
5859
import Unbound.Generics.LocallyNameless.Alpha
@@ -195,6 +196,7 @@ instance (Subst c a, Subst c b, Subst c d, Subst c e) => Subst c (a,b,d,e)
195196
instance (Subst c a, Subst c b, Subst c d, Subst c e, Subst c f) =>
196197
Subst c (a,b,d,e,f)
197198
instance (Subst c a) => Subst c [a]
199+
instance (Subst c a) => Subst c (NonEmpty a)
198200
instance (Subst c a) => Subst c (Maybe a)
199201
instance (Subst c a, Subst c b) => Subst c (Either a b)
200202

0 commit comments

Comments
 (0)