From 39d85ed266bd73954be058cd713f16ea9bada3b0 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 7 Dec 2009 11:43:31 +0100 Subject: [PATCH] Add an intermezzo about the id function. --- Chapters/Prototype.tex | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Chapters/Prototype.tex b/Chapters/Prototype.tex index bad0d06..b391d4f 100644 --- a/Chapters/Prototype.tex +++ b/Chapters/Prototype.tex @@ -677,6 +677,22 @@ families and other non-standard Haskell stuff which we do not (plan to) support. + \placeintermezzo{}{ + \startframedtext[width=8cm,background=box,frame=no] + \startalignment[center] + {\tfa The \hs{id} function} + \stopalignment + \blank[medium] + A function that is probably present in every functional language, is + the \emph{identity} function. This is the function that takes a + single argument and simply returns it unmodified. In Haskell this + function is called \hs{id} and can take an argument of any type + (\ie, it is polymorphic). + + The \hs{id} function will be used in the examples every now and + then. + \stopframedtext + } In Core, every expression is typed. The translation to Core happens after the typechecker, so types in Core are always correct as well (though you could of course construct invalidly typed expressions -- 2.30.2