Conversation

Indeed, they are both types, just like 42 and True are both values. But they are different "kinds" of type * -> * and * resp. You can get a static "compile time" kind error, which is like a type error "one level up" so to speak. i.e. the type annotations themselves are incoherent
1
One of the things my students of Haskell consistently have trouble with is understanding why a declaration like "instance Monoid Either where..." isn't allowed.
1
Maybe the mental model error is related to the inelegance that the kind system is not polymorphic. e.g. you can 'map' a unary or binary function, so why not Monoid Either?
1
1
Yeah the special rules around type level programming in haskell is annoying. I think the dependent haskell stuff aims to make it a bit less janky? I dunno though.
1
1
Would you call `Int` an 'integer wildcard'? I guess to me it seemed like some weird scary thing, and I assumed I couldn't use my existing knowledge about how types worked in order to understand it.
1
Show replies