Skip to content

Commit 1f45f78

Browse files
committed
[ elab ] Make %runElab expressions have unrestricted quantity
1 parent 75716cd commit 1f45f78

File tree

8 files changed

+34
-3
lines changed

8 files changed

+34
-3
lines changed

src/Algebra/Preorder.idr

+6
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,9 @@ public export
2929
interface Preorder a => Top a where
3030
top : a
3131
topAbs : {x : a} -> x <= top = True
32+
33+
||| The least bound of a bounded lattice
34+
public export
35+
interface Preorder a => Bot a where
36+
bot : a
37+
botAbs : {x : a} -> bot <= x = True

src/Algebra/ZeroOneOmega.idr

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ Top ZeroOneOmega where
7070
topAbs {x = Rig1} = Refl
7171
topAbs {x = RigW} = Refl
7272

73+
||| The bottm value of a lattice
74+
export
75+
Bot ZeroOneOmega where
76+
bot = Rig0
77+
botAbs {x = Rig0} = Refl
78+
botAbs {x = Rig1} = Refl
79+
botAbs {x = RigW} = Refl
80+
7381
----------------------------------------
7482

7583
rigPlusAssociative : (x, y, z : ZeroOneOmega) ->

src/TTImp/Elab/RunElab.idr

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ checkRunElab rig elabinfo nest env fc script exp
211211
let ttn = reflectiontt "TT"
212212
elabtt <- appCon fc defs n [expected]
213213
(stm, sty) <- runDelays (const True) $
214-
check rig elabinfo nest env script (Just (gnf env elabtt))
214+
check bot elabinfo nest env script (Just (gnf env elabtt))
215215
defs <- get Ctxt -- checking might have resolved some holes
216216
ntm <- elabScript fc nest env
217217
!(nfOpts withAll defs env stm) (Just (gnf env expected))

src/TTImp/ProcessRunElab.idr

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ processRunElab eopts nest env fc tm
3636
unit <- getCon fc defs (builtin "Unit")
3737
exp <- appCon fc defs n [unit]
3838

39-
stm <- checkTerm tidx InExpr eopts nest env tm (gnf env exp)
39+
stm <- checkTerm tidx InType eopts nest env tm (gnf env exp)
4040
ignore $ elabScript fc nest env !(nfOpts withAll defs env stm) Nothing

tests/Main.idr

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ idrisTests = MkTestPool "Misc" [] Nothing
211211
-- Quotation and reflection
212212
"reflection001", "reflection002", "reflection003", "reflection004",
213213
"reflection005", "reflection006", "reflection007", "reflection008",
214-
"reflection009", "reflection010", "reflection011",
214+
"reflection009", "reflection010", "reflection011", "reflection012",
215215
-- The 'with' rule
216216
"with001", "with002", "with004", "with005", "with006",
217217
-- with-disambiguation
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module RunElab0
2+
3+
import Language.Reflection
4+
5+
%language ElabReflection
6+
7+
0 elabScript : Elab Unit
8+
elabScript = pure ()
9+
10+
x : Unit
11+
x = %runElab elabScript
12+
13+
%runElab elabScript

tests/idris2/reflection012/expected

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1/1: Building RunElab0 (RunElab0.idr)

tests/idris2/reflection012/run

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rm -rf build
2+
3+
$1 --no-color --console-width 0 --check RunElab0.idr

0 commit comments

Comments
 (0)