summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-07-31 17:15:10 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-07-31 17:15:10 +0200
commita66e1ba60d9be67dda2a57a71bde96bc6f8dc5f0 (patch)
treed1d3dff85caa1d79aa60cfe305e9dcb46e80779d
parenta442800fd27952bff9bf9773f514ee062f4b55d0 (diff)
downloadhaskell-a66e1ba60d9be67dda2a57a71bde96bc6f8dc5f0.tar.gz
User's guide: delete ancient "Core syntax" example
-rw-r--r--docs/users_guide/debugging.xml106
1 files changed, 0 insertions, 106 deletions
diff --git a/docs/users_guide/debugging.xml b/docs/users_guide/debugging.xml
index 4e33987dcb..fd12e1d79a 100644
--- a/docs/users_guide/debugging.xml
+++ b/docs/users_guide/debugging.xml
@@ -672,112 +672,6 @@
</variablelist>
</sect2>
- <sect2>
- <title>How to read Core syntax (from some <option>-ddump</option>
- flags)</title>
-
- <indexterm><primary>reading Core syntax</primary></indexterm>
- <indexterm><primary>Core syntax, how to read</primary></indexterm>
-
- <para>Let's do this by commenting an example. It's from doing
- <option>-ddump-ds</option> on this code:
-
-<programlisting>
-skip2 m = m : skip2 (m+2)
-</programlisting>
-
- Before we jump in, a word about names of things. Within GHC,
- variables, type constructors, etc., are identified by their
- &ldquo;Uniques.&rdquo; These are of the form `letter' plus
- `number' (both loosely interpreted). The `letter' gives some idea
- of where the Unique came from; e.g., <literal>&lowbar;</literal>
- means &ldquo;built-in type variable&rdquo;; <literal>t</literal>
- means &ldquo;from the typechecker&rdquo;; <literal>s</literal>
- means &ldquo;from the simplifier&rdquo;; and so on. The `number'
- is printed fairly compactly in a `base-62' format, which everyone
- hates except me (WDP).</para>
-
- <para>Remember, everything has a &ldquo;Unique&rdquo; and it is
- usually printed out when debugging, in some form or another. So
- here we go&hellip;</para>
-
-<programlisting>
-Desugared:
-Main.skip2{-r1L6-} :: _forall_ a$_4 =&#62;{{Num a$_4}} -&#62; a$_4 -&#62; [a$_4]
-
---# `r1L6' is the Unique for Main.skip2;
---# `_4' is the Unique for the type-variable (template) `a'
---# `{{Num a$_4}}' is a dictionary argument
-
-_NI_
-
---# `_NI_' means "no (pragmatic) information" yet; it will later
---# evolve into the GHC_PRAGMA info that goes into interface files.
-
-Main.skip2{-r1L6-} =
- /\ _4 -&#62; \ d.Num.t4Gt -&#62;
- let {
- {- CoRec -}
- +.t4Hg :: _4 -&#62; _4 -&#62; _4
- _NI_
- +.t4Hg = (+{-r3JH-} _4) d.Num.t4Gt
-
- fromInt.t4GS :: Int{-2i-} -&#62; _4
- _NI_
- fromInt.t4GS = (fromInt{-r3JX-} _4) d.Num.t4Gt
-
---# The `+' class method (Unique: r3JH) selects the addition code
---# from a `Num' dictionary (now an explicit lambda'd argument).
---# Because Core is 2nd-order lambda-calculus, type applications
---# and lambdas (/\) are explicit. So `+' is first applied to a
---# type (`_4'), then to a dictionary, yielding the actual addition
---# function that we will use subsequently...
-
---# We play the exact same game with the (non-standard) class method
---# `fromInt'. Unsurprisingly, the type `Int' is wired into the
---# compiler.
-
- lit.t4Hb :: _4
- _NI_
- lit.t4Hb =
- let {
- ds.d4Qz :: Int{-2i-}
- _NI_
- ds.d4Qz = I#! 2#
- } in fromInt.t4GS ds.d4Qz
-
---# `I# 2#' is just the literal Int `2'; it reflects the fact that
---# GHC defines `data Int = I# Int#', where Int# is the primitive
---# unboxed type. (see relevant info about unboxed types elsewhere...)
-
---# The `!' after `I#' indicates that this is a *saturated*
---# application of the `I#' data constructor (i.e., not partially
---# applied).
-
- skip2.t3Ja :: _4 -&#62; [_4]
- _NI_
- skip2.t3Ja =
- \ m.r1H4 -&#62;
- let { ds.d4QQ :: [_4]
- _NI_
- ds.d4QQ =
- let {
- ds.d4QY :: _4
- _NI_
- ds.d4QY = +.t4Hg m.r1H4 lit.t4Hb
- } in skip2.t3Ja ds.d4QY
- } in
- :! _4 m.r1H4 ds.d4QQ
-
- {- end CoRec -}
- } in skip2.t3Ja
-</programlisting>
-
- <para>(&ldquo;It's just a simple functional language&rdquo; is an
- unregisterised trademark of Peyton Jones Enterprises, plc.)</para>
-
- </sect2>
-
</sect1>
<!-- Emacs stuff: