X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=Chapters%2FPrototype.tex;h=b391d4fcbc6951c2c86af451b805cec8187aae28;hp=3d8fb678c23406138162f1ac3fdc4affb5ccc21b;hb=39d85ed266bd73954be058cd713f16ea9bada3b0;hpb=75d1001c7a7809c80bc4113477ad90b12f23b80f diff --git a/Chapters/Prototype.tex b/Chapters/Prototype.tex index 3d8fb67..b391d4f 100644 --- a/Chapters/Prototype.tex +++ b/Chapters/Prototype.tex @@ -622,14 +622,6 @@ The value of a cast is the value of its body, unchanged. The type of this value is equal to the target type, not the type of its body. - - \todo{Move and update this paragraph} - Note that this syntax is also used sometimes to indicate that a particular - expression has a particular type, even when no cast expression is - involved. This is then purely informational, since the only elements that - are explicitly typed in the Core language are the binder references and - cast expressions, the types of all other elements are determined at - runtime. \stopdesc \startdesc{Note} @@ -685,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