Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems there are no Typeable1 Compose (GHC-7.4) #45

Open
phadej opened this issue Jun 1, 2019 · 2 comments
Open

Seems there are no Typeable1 Compose (GHC-7.4) #45

phadej opened this issue Jun 1, 2019 · 2 comments

Comments

@phadej
Copy link
Contributor

phadej commented Jun 1, 2019

Neither Typeable1 Product

Also with GHC-7.6

transformers-0.5.6.2 uses AutoDeriveTypeable GHC >=7.8
https://hackage.haskell.org/package/transformers-0.5.6.2/src/legacy/pre711/Data/Functor/Compose.hs


Oh, is it because

    Can't make a derived instance of `Typeable1 (Compose f g)':
      `Compose' must only have arguments of kind `*'
    In the stand-alone deriving instance for `Typeable1 (Compose f g)'
@phadej
Copy link
Contributor Author

phadej commented Jun 1, 2019

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 (Compose f g) where
    typeOf1 _ = mkTyConApp
        (mkTyCon3 "transformers" "Data.Functor.Compose" "Compose")
        [typeOf1 (undefined :: f ()), typeOf1 (undefined :: f ())]

seems to work, but not sure how correct it is. At least package name have to be #ifed, I guess.

@RyanGlScott
Copy link
Collaborator

Pull requests are welcome, if you're willing to figure out the right combination of CPP to make this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants