-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ derive ] Do not pass values of arguments on which someone else depends
- Loading branch information
Showing
14 changed files
with
146 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/derivation/least-effort/print/regression/underscore-in-cons-impl-full/DerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module DerivedGen | ||
|
||
import Data.Fin | ||
|
||
import Deriving.DepTyCheck.Gen | ||
|
||
%default total | ||
|
||
data IsFS : Fin n -> Type where | ||
ItIsFS : IsFS (FS i) | ||
|
||
%language ElabReflection | ||
|
||
%logging "deptycheck.derive.print" 5 | ||
%runElab deriveGenPrinter @{MainCoreDerivator @{LeastEffort}} $ | ||
Fuel -> {n : Nat} -> (v : Fin n) -> Gen MaybeEmpty $ IsFS v |
1 change: 1 addition & 0 deletions
1
...s/derivation/least-effort/print/regression/underscore-in-cons-impl-full/RunDerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/print/regression/underscore-in-cons-impl-full/derive.ipkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/derive.ipkg |
68 changes: 68 additions & 0 deletions
68
tests/derivation/least-effort/print/regression/underscore-in-cons-impl-full/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
1/1: Building DerivedGen (DerivedGen.idr) | ||
LOG deptycheck.derive.print:5: type: (arg : Fuel) -> (v : Fin n) -> Gen MaybeEmpty (IsFS v) | ||
MkArg MW ExplicitArg (Just "^outmost-fuel^") (var "Data.Fuel.Fuel") | ||
.=> MkArg MW ImplicitArg (Just "outer^<n>") implicitTrue | ||
.=> MkArg MW ExplicitArg (Just "outer^<v>") implicitTrue | ||
.=> local | ||
{ decls = | ||
[ IClaim | ||
emptyFC | ||
MW | ||
Export | ||
[] | ||
(mkTy | ||
{ name = "<DerivedGen.IsFS>[0, 1]" | ||
, type = | ||
MkArg MW ExplicitArg Nothing (var "Data.Fuel.Fuel") | ||
.-> MkArg MW ExplicitArg (Just "n") (var "Prelude.Types.Nat") | ||
.-> MkArg MW ExplicitArg (Just "{arg:1}") (var "Data.Fin.Fin" .$ var "n") | ||
.-> var "Test.DepTyCheck.Gen.Gen" | ||
.$ var "Test.DepTyCheck.Gen.Emptiness.MaybeEmpty" | ||
.$ (var "DerivedGen.IsFS" .! ("n", var "n") .$ var "{arg:1}") | ||
}) | ||
, IDef | ||
emptyFC | ||
"<DerivedGen.IsFS>[0, 1]" | ||
[ var "<DerivedGen.IsFS>[0, 1]" .$ bindVar "^fuel_arg^" .$ bindVar "inter^<n>" .$ bindVar "inter^<{arg:1}>" | ||
.= local | ||
{ decls = | ||
[ IClaim | ||
emptyFC | ||
MW | ||
Export | ||
[] | ||
(mkTy | ||
{ name = "<<DerivedGen.ItIsFS>>" | ||
, type = | ||
MkArg MW ExplicitArg Nothing (var "Data.Fuel.Fuel") | ||
.-> MkArg MW ExplicitArg (Just "n") (var "Prelude.Types.Nat") | ||
.-> MkArg MW ExplicitArg (Just "{arg:1}") (var "Data.Fin.Fin" .$ var "n") | ||
.-> var "Test.DepTyCheck.Gen.Gen" | ||
.$ var "Test.DepTyCheck.Gen.Emptiness.MaybeEmpty" | ||
.$ (var "DerivedGen.IsFS" .! ("n", var "n") .$ var "{arg:1}") | ||
}) | ||
, IDef | ||
emptyFC | ||
"<<DerivedGen.ItIsFS>>" | ||
[ var "<<DerivedGen.ItIsFS>>" | ||
.$ bindVar "^cons_fuel^" | ||
.$ (var "Prelude.Types.S" .$ bindVar "^bnd^{k:3639}") | ||
.$ (var "Data.Fin.FS" .! ("k", implicitTrue) .$ bindVar "i") | ||
.= var "Test.DepTyCheck.Gen.label" | ||
.$ (var "fromString" .$ primVal (Str "DerivedGen.ItIsFS (orders)")) | ||
.$ ( var "Prelude.pure" | ||
.! ("f", var "Test.DepTyCheck.Gen.Gen" .$ implicitTrue) | ||
.$ (var "DerivedGen.ItIsFS" .! ("{k:3639}", implicitTrue) .! ("i", var "i"))) | ||
, var "<<DerivedGen.ItIsFS>>" .$ implicitTrue .$ implicitTrue .$ implicitTrue .= var "empty" | ||
] | ||
] | ||
, scope = | ||
var "Test.DepTyCheck.Gen.label" | ||
.$ (var "fromString" .$ primVal (Str "DerivedGen.IsFS[0, 1] (non-recursive)")) | ||
.$ (var "<<DerivedGen.ItIsFS>>" .$ var "^fuel_arg^" .$ var "inter^<n>" .$ var "inter^<{arg:1}>") | ||
} | ||
] | ||
] | ||
, scope = var "<DerivedGen.IsFS>[0, 1]" .$ var "^outmost-fuel^" .$ var "outer^<n>" .$ var "outer^<v>" | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/print/regression/underscore-in-cons-impl-full/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/derivation/least-effort/run/regression/underscore-in-cons-impl-full/DerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module DerivedGen | ||
|
||
import RunDerivedGen | ||
|
||
import Data.Fin | ||
|
||
%default total | ||
|
||
data IsFS : Fin n -> Type where | ||
ItIsFS : IsFS (FS i) | ||
|
||
Show (IsFS vs) where show ItIsFS = "ItIsFS" | ||
|
||
%language ElabReflection | ||
|
||
checkedGen : Fuel -> {n : Nat} -> (v : Fin n) -> Gen MaybeEmpty $ IsFS v | ||
checkedGen = deriveGen @{MainCoreDerivator @{LeastEffort}} | ||
|
||
main : IO () | ||
main = runGs | ||
[ G $ \fl => checkedGen fl $ the (Fin 4) 3 | ||
, G $ \fl => checkedGen fl $ the (Fin 3) 0 | ||
] |
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/run/regression/underscore-in-cons-impl-full/RunDerivedGen.idr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/RunDerivedGen.idr |
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/run/regression/underscore-in-cons-impl-full/derive.ipkg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/derive.ipkg |
25 changes: 25 additions & 0 deletions
25
tests/derivation/least-effort/run/regression/underscore-in-cons-impl-full/expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Generated values: | ||
----- | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- | ||
ItIsFS | ||
----- |
1 change: 1 addition & 0 deletions
1
tests/derivation/least-effort/run/regression/underscore-in-cons-impl-full/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_common/run |