[typecheck] [E] /mnt/data/depot/git/haskell/experiments/recuest/src/HStructures.hs:35:34: error:
• Expected kind 'forall k. (k -> *) -> k -> *',
but 'Compose m' has kind '(k10 -> *) -> k10 -> *'
• In the first argument of 'Composative', namely '(Compose m)'
In the instance declaration for 'Composative (Compose m)'
however, as Reed discovered, if you move the quantification in the definition of Compose around, it does:
The following code fails to compile, but probably should: ```hs {-# LANGUAGE RankNTypes, TypeInType #-} import Data.Kind data Foo :: forall k . (* -> *) -> k -> *...
Copy pasting some discussion with @Reed Mullanix from Slack.
It seems like something like the following should work, but it doesn't:
here's the error:
however, as Reed discovered, if you move the quantification in the definition of
Compose
around, it does:Is this an expected limitation? Bug in GHC? Something we're doing wrong?
@Reed Mullanix this works too btw:
@Asad Saeeduddin does this compile on older versions of GHC?
I don't really know, but I was pointed to the gitlab issue that explains how this is expected behavior: https://gitlab.haskell.org/ghc/ghc/issues/13399