diff --git a/semialign/src/Data/Crosswalk.hs b/semialign/src/Data/Crosswalk.hs index ea28a1d..ea1400c 100644 --- a/semialign/src/Data/Crosswalk.hs +++ b/semialign/src/Data/Crosswalk.hs @@ -8,13 +8,12 @@ module Data.Crosswalk ( Bicrosswalk (..), ) where -import Control.Applicative (Applicative (pure, (<*>)), (<$>)) +import Control.Applicative (Applicative (pure, (<*>)), (<$>), Const(..)) import Control.Monad.Trans.Maybe (MaybeT (..)) import Data.Bifoldable (Bifoldable (..)) import Data.Bifunctor (Bifunctor (..)) import Data.Foldable (Foldable (..)) import Data.Functor.Compose (Compose (..)) -import Data.Functor.Const (Const (..)) import Data.Functor.Identity (Identity (..)) import Data.Functor.Sum (Sum (..)) import Data.Functor.These (These1 (..)) diff --git a/these-tests/test/Tests/Crosswalk.hs b/these-tests/test/Tests/Crosswalk.hs index 4d7affc..3078580 100644 --- a/these-tests/test/Tests/Crosswalk.hs +++ b/these-tests/test/Tests/Crosswalk.hs @@ -6,10 +6,10 @@ module Tests.Crosswalk (crosswalkProps) where import Prelude () import Prelude.Compat +import Control.Applicative (Const) import Control.Monad.Trans.Instances () import Control.Monad.Trans.Maybe (MaybeT) import Data.Functor.Compose (Compose (..)) -import Data.Functor.Const (Const) import Data.Functor.Identity (Identity (..)) import Data.Functor.Sum (Sum) import Data.Functor.These (These1) diff --git a/these-tests/test/Tests/Orphans.hs b/these-tests/test/Tests/Orphans.hs index 3a8471e..b1db45d 100644 --- a/these-tests/test/Tests/Orphans.hs +++ b/these-tests/test/Tests/Orphans.hs @@ -4,17 +4,35 @@ module Tests.Orphans where #if !(MIN_VERSION_base(4,7,0)) +import Control.Monad.Trans.Maybe (MaybeT) import Data.Typeable.Internal import Data.Functor.Compose (Compose) import Data.Functor.Product (Product) +import Data.Functor.Sum (Sum) +import Data.Functor.These (These1) instance (Typeable1 f, Typeable1 g) => Typeable1 (Product f g) where typeOf1 _ = mkTyConApp (mkTyCon3 "transformers" "Data.Functor.Product" "Product") [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())] +instance (Typeable1 f, Typeable1 g) => Typeable1 (Sum f g) where + typeOf1 _ = mkTyConApp + (mkTyCon3 "transformers" "Data.Functor.Sum" "Sum") + [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())] + +instance (Typeable1 f, Typeable1 g) => Typeable1 (These1 f g) where + typeOf1 _ = mkTyConApp + (mkTyCon3 "these" "Data.Functor.These" "These1") + [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())] + instance (Typeable1 f, Typeable1 g) => Typeable1 (Compose f g) where typeOf1 _ = mkTyConApp (mkTyCon3 "transformers" "Data.Functor.Compose" "Compose") [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())] + +instance Typeable1 f => Typeable1 (MaybeT f) where + typeOf1 _ = mkTyConApp + (mkTyCon3 "transformers" "Control.Monad.Trans.Maybe" "MaybeT") + [typeOf1 (undefined :: f ())] #endif