Add an intermezzo about the id function.
[matthijs/master-project/report.git] / Chapters / Prototype.tex
index 3d8fb678c23406138162f1ac3fdc4affb5ccc21b..b391d4fcbc6951c2c86af451b805cec8187aae28 100644 (file)
 
       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.
 
       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}
     \stopdesc
 
     \startdesc{Note}
       families and other non-standard Haskell stuff which we do not (plan to)
       support.
 
       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
       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