[Haskell-cafe] Strange error message with PolyKinds
Jonas Scholl
anselm.scholl at tu-harburg.de
Fri Jul 17 19:53:46 UTC 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
I would guess the two arguments are a kind and a type of that kind. The
kind is given implicitly, so this corresponds to your one given
argument. If we specify a kind, we get the following:
Prelude> :set -XPolyKinds -XDataKinds -XKindSignatures
Prelude> type Test a = a
Prelude> type Huh a = Test (a :: Bool)
Prelude> type Bar = Huh
<interactive>:5:1:
Type synonym ‘Huh’ should have 1 argument, but has been given none
In the type declaration for ‘Bar’
So it really takes two arguments and we can specify one, leaving one to
be specified. Maybe a better error message would be useful, but I would
not say this is a bug.
On 07/17/2015 08:37 PM, Nikolay Amiantov wrote:
> Hi Cafe, > > I've bumped into a strange error message -- it looks like an
obvious > bug, but maybe there's something that I'm just not aware of: >
> GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help > ghci>
type Test a = a > ghci> type Huh = Test > > <interactive>:3:1: >
Type synonym ‘Test’ should have 1 argument, but has been given none
> In the type declaration for ‘Huh’ > > So far, so good: > > ghci>
:set -XPolyKinds > ghci> type Test a = a > ghci> type Huh = Test > >
<interactive>:6:1: > Type synonym ‘Test’ should have 2 arguments,
but has been given 1 > In the type declaration for ‘Huh’ > > (Notice
the number of arguments reported in the second case) >
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJVqV0gAAoJEM0PYZBmfhoBEYYH/2dbUfsM9X9EKRaGdrsGmRlx
Yj51KkvO8uGDfoFfu++JuCY/o0poD3/NQLUtHOrUx9tKrGD+Kksoqs5+3jKdKWhb
x4SITIShOOd31qwwKdfs7QaTdrP1cyr/km9U5wP5o8Zgf9XCUI337RC6HRuhphcb
Ytk+We3ZODy1+SewMjYvJvOiTfzTAa3u4zW1arEcXMXaaIcyMwtfH+UMgSljbBUt
K9nfWE73klyftae3duSonML0fwTgUepnhRrZ+weIS0fEHqfJDsy4KJKqJGm2ee8T
w72D69FNVvwkL46TH7rZKhHyh3k7Ct5SHb14IqyDDduobFtswfhCpGjdLXyfn3o=
=5hgl
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe
mailing list