News for hackers. Stuff that matters.
Re:Haskell's kind system: a primer by MaxBarraclough on Thursday October 18, 2018 @04:43AM (#18246896)
I had no idea Haskell used 'kind' to refer to something codified and concrete in this way -- usually we see the word 'type' used to refer to the concrete type-systems stuff, and 'kind' to refer to the fuzzier, less precise idea of, uh, what it is the data is.

Type theorists say things like "Type systems let us reify what kind of data we are dealing with".

It's a bit like when Java took the fuzzy term 'interface' and made it a concrete technical concept, or when Apple added closures to Objective-C and called them 'blocks', which was previously a fuzzy term.

Will we have to start using another word to refer to the fuzzier concept, if not 'kind'? 'Sort' is already taken. 'Category' is already taken. Perhaps the 'nature' of the data?

Re:Haskell's kind system: a primer by hiker on Thursday October 18, 2018 @05:19AM (#18247005)
Going further one will need a word for "the kind of a kind", "the kind of a kind of a kind" and so on.

One solution is TypeInType, that is the type of a type is another type (not kind or something else). That's where Haskell is going with the work of adding Dependent Types to the language.

The problem with TypeInType is that it is logically inconsistent - it leads to Girard's paradox, analog to Russel's paradox in set theory.

The correct solution is type universes where every type lives in some type universe indexed by a natural number. For example terms are of type 'Type 1', 'Type 1' types are of type 'Type 2' and so on. The usual 'Type' is then just the first universe level 'Type 1' and 'Kind' is 'Type 2'.

Type universes is what most proof assistants employ, e.g. Agda, Coq, Lean. Idris uses TypeInType which is easier to use and there's no need to massage your program until all type universes type check but is logically inconsistent so one has to be careful to not reproduce Girard's paradox in some form or another.

Re:Haskell's kind system: a primer by lmm on Thursday October 18, 2018 @04:56AM (#18246936)
Kinds are a distinct concept from types, and that concept needs a name, and it's best to choose a name where the intuitive meaning of the name aligns with the technical one (indeed Haskell attracts a lot of criticism when it uses names like "monad" that don't have a "fuzzy" meaning).

It goes even further: types-of-kinds are called "sorts", though in Haskell there's only one possible sort of kind.

There are only two hard problems in computer science, after all.

Re:Haskell's kind system: a primer by Intermernet on Thursday October 18, 2018 @08:12AM (#18247588)
>There are only two hard problems in computer science, after all.

Including off-by-one errors, there are four.

Re:Haskell's kind system: a primer by MaxBarraclough on Thursday October 18, 2018 @09:40AM (#18248193)
Maybe we should add 'induction' to the list.
Re:Haskell's kind system: a primer by jacobush on Thursday October 18, 2018 @05:51AM (#18247112)
Naming and ??

(Computability?)

Re:Haskell's kind system: a primer by hiker on Thursday October 18, 2018 @06:04AM (#18247146)
"There are only two hard things in Computer Science: cache invalidation and naming things." -- Phil Karlton

But I do like "Computability and naming things" better.

Re:Haskell's kind system: a primer by gpderetta on Thursday October 18, 2018 @07:22AM (#18247390)
There are only two hard things in Computer Science: cache invalidation, naming things and off by one errors. -- Anonymous
Re:Haskell's kind system: a primer by kccqzy on Thursday October 18, 2018 @11:48AM (#18249308)
Are you just saying you don't like the term "kind" or something else? The name has been used since the last century.
Re:Haskell's kind system: a primer by MaxBarraclough on Thursday October 18, 2018 @12:42PM (#18249837)
I suppose I wasn't clear.

In my experience, in computer science, "kind" is generally used in an informal way, whereas "type" is used to refer to the technical concept of type in type systems.

If Haskell gives a precise meaning to "kind", I'm going to have be careful which word I use to refer to the informal concept.

As I said, type theorists say things like "Type systems let us reify what kind of data we are dealing with".

Re:Haskell's kind system: a primer by kccqzy on Thursday October 18, 2018 @12:59PM (#18250006)
I see. I think it's fine to overload an English word to have both a precise meaning or an informal one.
Re:Haskell's kind system: a primer by hiiq on Thursday October 18, 2018 @12:59PM (#18250007)
Objective-C called closures blocks because that is what they are called in Smalltalk.

Objective-C was modelled on Smalltalk.

Re:Haskell's kind system: a primer by imh on Thursday October 18, 2018 @08:06PM (#18253392)
The same happens with all sorts of collectiony words. You could have a set of things, or a group of them, or a variety or a category or a kind or a sort or a class or type. We're running out of collection words without formal definitions!
Re:Haskell's kind system: a primer by mlazos on Thursday October 18, 2018 @06:44AM (#18247265)
actually I’ve seen sort used for kinds of kinds in some PL papers that I’ve read. Not sure how official it is, some PL researchers I’ve talked to say that they don’t go higher than sorts.