2

So I came across dependent typing at Scala Exchange (at this talk), and the speaker went through an example where he indexed a vector using Peano numbers and used it to encode properties about operations on vector in the types of those operations - I've also seen this a few other places since as well. I read more about dependent types on Wikipedia, but I couldn't quite translate the example above into sigma/pi dependent type distinction.

So, my question is: are the types being used in the Peano-indexed vector sigma or pi dependent types? Also, could someone please provide or point me to an example of the kind that they're not so I have a examples of both? (preferably in Scala)

Logician
  • 93
  • 1
  • 7
  • Wikipedia's presentation of dependent type theory is a bit reductionist in my opinion. Not everything we use in dependently typed programming is a pi-type or a sigma-type. Vectors are an _inductive family_. – Benjamin Hodgson Jan 04 '17 at 17:10
  • Okay, well, do you perhaps know of a good place to get a better overview? So far most of my research has only produced quite involved papers and documents that I don't have the time to get my head around. – Logician Jan 07 '17 at 16:20
  • 1
    My favourite introduction is Oury and Swierstra's [_The Power of Pi_](https://cs.ru.nl/~wouters/Publications/ThePowerOfPi.pdf) which gives some examples of dependently-typed programs with real-world applicability. [The Agda tutorial](http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf) is also quite good. And Brady has [a work-in-progress book](https://www.manning.com/books/type-driven-development-with-idris) about Idris. – Benjamin Hodgson Jan 07 '17 at 16:24
  • I think [this answer](http://stackoverflow.com/a/12937819/1374461) to a different question might interest you. – Jasper-M Jan 20 '17 at 12:53

0 Answers0