Re:The limits of type theory: computation vs. interaction
by danghica on Monday June 08, 2015 @09:42AM
(#9678950)
I am aware of this -- I teach Agda :) But I think Agda is not quite as accessible as Python, that's what I meant. Cheers!
Re:The limits of type theory: computation vs. interaction
by murbard2 on Monday June 08, 2015 @09:35AM
(#9678908)
It's great to have an example, but could you add inline comments for those of us who aren't familiar with Agda's syntax?
Re:The limits of type theory: computation vs. interaction
by Retra on Monday June 08, 2015 @11:57AM
(#9679893)
It's basically Haskell with unicode identifiers and mixed-fixity. (I.e., _::_ is an infix function of two arguments, and the _'s represent "holes" for the arguments.)
Re:The limits of type theory: computation vs. interaction
by ngrilly on Monday June 08, 2015 @11:18AM
(#9679618)
How can you compare that code with the Python one liner in the original article? It's interesting, of course, but it's not "easy to work with".
Re:The limits of type theory: computation vs. interaction
by TheCoelacanth on Tuesday June 09, 2015 @12:13PM
(#9686735)
Only the two lines starting with ex1 for heterogeneous if and the two lines starting with ex2 for heterogeneous lists are directly comparable to the Python examples. The rest is just defining what a boolean is, what a natural number is, what a character is, what if is, what a list is, what a heterogeneous list is, etc., to provide a full foundation for the examples.
Re:The limits of type theory: computation vs. interaction
by Dewie3 on Monday June 08, 2015 @12:53PM
(#9680359)
He explicitly gives standard machinery like the a boolean type and natural numbers, presumably to show more clearly what the parts are built up from. You probably wouldn't need to write all of that to use HList at a later point.
> People who think they understand something about the theory of programming languages, including me, tend to agree that what Python does is wrong.
> In fact you can program heterogeneous lists in dependently typed languages, but it’s unreasonably complicated.
Here's some Agda code that shows that both heterogeneous if statements and lists make sense and are easy to work with in type theory.