From: Matthijs Kooijman Date: Mon, 7 Dec 2009 10:43:31 +0000 (+0100) Subject: Add an intermezzo about the id function. X-Git-Tag: final-thesis~62 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=39d85ed266bd73954be058cd713f16ea9bada3b0;p=matthijs%2Fmaster-project%2Freport.git Add an intermezzo about the id function. --- 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