Re:Why Generics?
by sli on Wednesday July 31, 2019 @03:44PM
(#20577629)
Generics are to types what HKT are to type signatures. In functions, they usually map to arity. That is, an arity mismatch is are a higher-kinded type mismatch. An easy (if not totally accurate) way to view them is like doubly-generic types.
If you have some type A, it has the kind * . If you have some function from A -> B, it has the kind * -> * .
Re:Why Generics?
by jsjolen on Wednesday July 31, 2019 @04:09PM
(#20577946)
I've decided that it's the same as having a simply-typed lambda calculus with one type (*) and function types living inside of your type system. Is this correct at all?
If you have some type A, it has the kind * . If you have some function from A -> B, it has the kind * -> * .