1

I have the following type class

class BoolHolding h where
  data MyBool b :: 'Bool

However, I keep getting the error: Not in scope: data constructor ‘Bool’. Does Haskell not permit this for some reason, or is there away to include the data constructor? If not, why not?

Anders Miltner
  • 253
  • 3
  • 12

1 Answers1

2

Ok, there are 2 issues with what I did.

1: DataKinds only requires lifting the constructors, not the data types. So, the 'Bool needs only be Bool.

2: Kind signatures for data must have a return kind of *. I can insert data into the kind, but after all the applications have been done, I must eventually have a type. I did not have this.

For 2, all I had to do was change data to type and this restriction is no longer present.

Benjamin Hodgson
  • 42,952
  • 15
  • 108
  • 157
Anders Miltner
  • 253
  • 3
  • 12