kind signature in `class` bug? - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

rednaZ
{-# language
  PolyKinds,
  DataKinds,
  AllowAmbiguousTypes,
  TypeApplications
#-}

class Test a where
  test :: Bool
instance Test False where
  test = False
value :: Bool
value = test @False

works but

{-# language
  PolyKinds,
  DataKinds,
  AllowAmbiguousTypes,
  TypeApplications
#-}

class Test (a :: k) where -- changed
  test :: Bool
instance Test False where
  test = False
value :: Bool
value = test @False

yields

• Expected a type, but ‘False’ has kind ‘Bool’
• In the type ‘False’
  In the expression: test @False

. Is this crazy or am I going crazy?

Torsten Schmits

the k is the first type parameter

rednaZ

How can I thank you?

Torsten Schmits

your happiness is thanks enough!

rednaZ

I am happy indeed.