Skip to content

Commit

Permalink
Add Alpha and Subst instances for NonEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Mar 20, 2024
1 parent 7ce8463 commit cb282af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Unbound/Generics/LocallyNameless/Alpha.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import Data.Function (on)
import Data.Functor.Contravariant (Contravariant(..))
import Data.Foldable (Foldable(..))
import Data.List (intersect)
import Data.List.NonEmpty (NonEmpty)
import Data.Monoid (Monoid(..), All(..))
import Data.Ratio (Ratio)
import Data.Semigroup as Sem
Expand Down Expand Up @@ -687,6 +688,7 @@ instance Alpha Bool

instance Alpha a => Alpha (Maybe a)
instance Alpha a => Alpha [a]
instance Alpha a => Alpha (NonEmpty a)
instance Alpha ()
instance (Alpha a,Alpha b) => Alpha (Either a b)
instance (Alpha a,Alpha b) => Alpha (a,b)
Expand Down
2 changes: 2 additions & 0 deletions src/Unbound/Generics/LocallyNameless/Subst.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module Unbound.Generics.LocallyNameless.Subst (
import GHC.Generics

import Data.List (find)
import Data.List.NonEmpty (NonEmpty)

import Unbound.Generics.LocallyNameless.Name
import Unbound.Generics.LocallyNameless.Alpha
Expand Down Expand Up @@ -195,6 +196,7 @@ instance (Subst c a, Subst c b, Subst c d, Subst c e) => Subst c (a,b,d,e)
instance (Subst c a, Subst c b, Subst c d, Subst c e, Subst c f) =>
Subst c (a,b,d,e,f)
instance (Subst c a) => Subst c [a]
instance (Subst c a) => Subst c (NonEmpty a)
instance (Subst c a) => Subst c (Maybe a)
instance (Subst c a, Subst c b) => Subst c (Either a b)

Expand Down

0 comments on commit cb282af

Please sign in to comment.