Date: 2018-12-14 07:14 pm (UTC)
From: [personal profile] sassa_nf
"различие между types и kinds"

Like,

List = Set -> Set -- so now you can have List Int, List Bool, etc; in Haskell you can't express that as a type expression, so you end up talking about kinds, * -> *, so at least one can talk about parameterising on some of them, or matching the parameters.

Read literally, this means that given a type (Set), List produces a type (Set). But is it possible to have a List List? (Hence paradox akin to Russel)

The solution is to have towers of types. In Agda, Set implies Set 1. So List = Set 1 -> Set 1. But the type (Set 1 -> Set 1) is itself a Set 2 - next level universe of types. Although List is in a different universe, List Int is in the same universe as Int. Then at type level it is impossible to have List List, because List accepts an argument of type from universe 1 (Set 1), not universe 2 (Set 2, such as List).

It is possible to generalize List, though, by capturing the universe from which the argument is: List = Set a -> Set a. Now it is possible to express something like List List, but the two Lists are from two different universes.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
181920 21 222324
25262728293031

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 23rd, 2025 07:04 am
Powered by Dreamwidth Studios