@@ -48,28 +48,20 @@ The following is a walkthough looking at the state after each tactic:
48 * - The term is:
48 * - The term is:
49 - ?{hole_0} ≈ ? {hole_2} . {hole_2} . {hole_0}
49 - ?{hole_0} ≈ ? {hole_2} . {hole_2} . {hole_0}
51− * - It is possible to read the state from the script by calling getEnv, getGoal and getHoles. To show the results I hacked this: `my code`_.
51+ * - It is possible to read the state from the script by calling getEnv, getGoal and getHoles.
53+ - The output of these calls contain structures with TT code. To show the results I hacked this: `my code`_. TT code is not really designed to be readable by humans, all the names are fully expanded, everything has a type down to universes (type of types). This is shown here to illustrate the information available.
53− - .. code-block:: idris
55+ .. code-block:: idris
57− getGoal=({hole_2}, {TT:Bind
59+ getGoal=(hole_2, __pi_arg:(Nat.["Nat", "Prelude"]:{
58− name=`{{__pi_arg}}
60+ type constructor tag=8 number=0}.Type:U=(20:./Prelude/Nat.idr)->.
60− Π ({`{{Nat}}.["Nat", "Prelude"]}:{type const tag=8,0}).{
61− TT:TType tt=ext=./Prelude/Nat.idr#20
65− TT:Parameter name ref
66− NameType={type const tag=8,0}
67− TTName={`{{Nat}}.["Nat","Prelude"]}
61+ {name ref{type constructor tag=8 number=0}Nat.["Nat","Prelude"]:
69− tt=ext=./Prelude/Nat.idr#20
62+ Type:U=(20:./Prelude/Nat.idr)
74 getHoles=[{hole_2},{hole_0}]
66 getHoles=[{hole_2},{hole_0}]
@@ -96,24 +88,14 @@ The following is a walkthough looking at the state after each tactic:
97 - .. code-block:: idris
89 - .. code-block:: idris
101− λ ({`{{Nat}}.["Nat", "Prelude"]}:{type const tag=8,0}).
91+ getEnv=[(x, {λ (Nat.["Nat", "Prelude"]:{
102− {TT:TType
92+ type constructor tag=8 number=0}).
103− tt=ext=./Prelude/Nat.idr#20
93+ Type:U=(20:./Prelude/Nat.idr)
108− getGoal=({hole_2},{
96+ getGoal=(hole_2, {name ref{type constructor tag=8 number=0}
109− TT:Parameter name ref
110− NameType={type const tag=8,0}
111− TTName={`{{Nat}}.["Nat", "Prelude"]}
97+ Nat.["Nat","Prelude"]:Type:U=(20:./Prelude/Nat.idr)
113− tt=ext=./Prelude/Nat.idr#20
118 getHoles=[{hole_2},{hole_0}]
100 getHoles=[{hole_2},{hole_0}]
@@ -140,38 +122,24 @@ The following is a walkthough looking at the state after each tactic:
141 - .. code-block:: idris
123 - .. code-block:: idris
143− getEnv=[(`{{x}}, {λ ({`{{Nat}}.["Nat", "Prelude"]}:
125+ getEnv=[(x, {λ (Nat.["Nat", "Prelude"]:
144− {type const tag=8,0}).
126+ {type constructor tag=8 number=0}).
146− tt=ext=./Prelude/Nat.idr#20
127+ Type:U=(20:./Prelude/Nat.idr)
151− getGoal=({hole_2},
130+ getGoal=(hole_2, {name ref{type constructor tag=8 number=0}
152− {TT:Parameter name ref
153− NameType={type const tag=8,0}
154− TTName={`{{Nat}}.["Nat", "Prelude"]}
131+ Nat.["Nat","Prelude"]:Type:U=(20:./Prelude/Nat.idr)
156− tt=ext=./Prelude/Nat.idr#20
160 getHoles=[{hole_2}, {hole_0}]
134 getHoles=[{hole_2}, {hole_0}]
162 * - getGuess
136 * - getGuess
163 - .. code-block:: idris
137 - .. code-block:: idris
165− {TT:Parameter name ref
139+ {name ref bound x:
166− NameType=NameType just bound by intro
140+ {name ref{type constructor tag=8 number=0}
168− TT={TT:Parameter name ref
169− NameType={type const tag=8,0}
170− TTName={`{{Nat}}.["Nat", "Prelude"]}
141+ Nat.["Nat","Prelude"]:Type:U=(20:./Prelude/Nat.idr)
172− tt=ext=./Prelude/Nat.idr#20
177 * - Substitute a guess into a hole.
145 * - Substitute a guess into a hole.
@@ -195,45 +163,30 @@ The following is a walkthough looking at the state after each tactic:
196 getEnv=[]
164 getEnv=[]
198− getGoal=({hole_0}, {TT:Bind
201− Π ({`{{Nat}}.["Nat", "Prelude"]}:
166+ getGoal=(hole_0, __pi_arg:(Nat.["Nat", "Prelude"]:{
202− {type const tag=8,0}).{TT:TType
167+ type constructor tag=8 number=0}.
203− tt=ext=./Prelude/Nat.idr#20
168+ Type:U=(20:./Prelude/Nat.idr)
206− tt={TT:Parameter name ref
169+ ->.{name ref
207− NameType={type const tag=8,0}
170+ {type constructor tag=8 number=0}
208− TTName={`{{Nat}}.["Nat","Prelude"]}
171+ Nat.["Nat","Prelude"]:Type:U=(20:./Prelude/Nat.idr)
209− TT={TT:TType tt=ext=./Prelude/Nat.idr#20}
213 getHoles=[{hole_0}]
175 getHoles=[{hole_0}]
215 * - getGuess
177 * - getGuess
216 - .. code-block:: idris
178 - .. code-block:: idris
220− binder={λ ({`{{Nat}}.["Nat","Prelude"]}:{type const tag=8,0}).{
180+ x:({λ (Nat.["Nat", "Prelude"]:{
221− TT:TType
181+ type constructor tag=8 number=0}).
182+ Type:U=(20:./Prelude/Nat.idr)
185+ x:{name ref {type constructor tag=8 number=0}
222− tt=ext=./Prelude/Nat.idr#20
186+ Nat.["Nat","Prelude"]:Type:U=(20:./Prelude/Nat.idr)
225− tt={TT:Parameter name ref
226− NameType=NameType just bound by intro
228− TT={TT:Parameter name ref
229− NameType={type const tag=8,0}
230− TTName={`{{Nat}}.["Nat", "Prelude"]}
232− tt=ext=./Prelude/Nat.idr#20
238.. target-notes::
191.. target-notes::
239.. _`my code`: https://github.com/martinbaker/Idris-dev/blob/uglyTTPrinter/libs/prelude/Language/Reflection/TTPrinter.idr
192.. _`my code`: https://github.com/martinbaker/Idris-dev/blob/uglyTTPrinter/libs/prelude/Language/Reflection/TTPrinter.idr