3

For the new scheme-like, dependently-typed language 'Pie', I purchased the language's companion book: The Little Typer (http://thelittletyper.com/)

I'm trying to follow along with the code using DrRacket, but I'm getting on errors when I type the code in the book.

(cons 'ratatouille 'baguette)

I get this error: "Can't determine a type"

Since both of the symbols are Atoms, shouldn't that call to cons work?

Also, the '+' function is undefined, even for numbers. Does Pie have prelude that can be imported to provide such basic things.

soegaard
  • 30,661
  • 4
  • 57
  • 106
Dess
  • 2,064
  • 19
  • 35

1 Answers1

5

Try

#lang pie
(the (Pair Atom Atom)
  (cons 'foo 'foo))
soegaard
  • 30,661
  • 4
  • 57
  • 106
  • I'm not sure if this the right answer, even if it makes the error go away, honestly. Since I'm unsure, I'll leave this response unaccepted, for now. – Dess Jun 13 '19 at 22:59
  • In my opinion this is the correct answer. This is discussed further in [The Little Typer](http://thelittletyper.com/) in the chapter titled "A Forkful of Pie", around frame 11. – banbh Jan 20 '20 at 03:06