-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
target type generator derivation from fused type generator added
- Loading branch information
1 parent
aca59a3
commit 84d7f0a
Showing
146 changed files
with
1,019 additions
and
16 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
tests/derivation/utils/fusion/print/generator/001 one var match/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 public Deriving.DepTyCheck.Util.Fusion | ||
import public Deriving.DepTyCheck.Gen.Core | ||
|
||
%default total | ||
|
||
data X : Type -> Type where | ||
MkX : X n | ||
|
||
data Y : Type -> Type where | ||
MkY : Y n | ||
|
||
data Z : Type where | ||
MkZ : (n : Type) -> X n -> Y n -> Z | ||
|
||
%language ElabReflection | ||
|
||
decl : Maybe FusionDecl | ||
decl = %runElab runFusion `{X} [`{n}] `{Y} [`{n}] | ||
|
||
main : IO () | ||
main = putPretty $ getGen decl |
File renamed without changes.
58 changes: 58 additions & 0 deletions
58
tests/derivation/utils/fusion/print/generator/001 one var match/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,58 @@ | ||
1/1: Building DerivedGen (DerivedGen.idr) | ||
[ IClaim | ||
emptyFC | ||
MW | ||
Export | ||
[] | ||
(mkTy | ||
{ name = "genXY" | ||
, type = | ||
MkArg MW ExplicitArg Nothing (var "Fuel") | ||
.-> var "Gen" | ||
.$ var "MaybeEmpty" | ||
.$ ( var "DPair" | ||
.$ type | ||
.$ ( MkArg MW ExplicitArg (Just "n") type | ||
.=> var "XY" .$ var "n")) | ||
}) | ||
, IClaim | ||
emptyFC | ||
MW | ||
Export | ||
[] | ||
(mkTy | ||
{ name = "genZ_ultimate" | ||
, type = | ||
MkArg MW ExplicitArg Nothing (var "Fuel") | ||
.-> var "Gen" .$ var "MaybeEmpty" .$ var "Z" | ||
}) | ||
, IDef | ||
emptyFC | ||
"genZ_ultimate" | ||
[ var "genZ_ultimate" .$ bindVar "fl" | ||
.= var ">>=" | ||
.$ (var "genXY" .$ var "fl") | ||
.$ ( MkArg MW ExplicitArg (Just "{lamc:0}") implicitFalse | ||
.=> iCase | ||
{ sc = var "{lamc:0}" | ||
, ty = implicitFalse | ||
, clauses = | ||
[ var "MkDPair" .$ bindVar "n" .$ bindVar "xy" | ||
.= iCase | ||
{ sc = var "splitXY" .$ var "xy" | ||
, ty = implicitTrue | ||
, clauses = | ||
[ var "Builtin.MkPair" | ||
.$ bindVar "x" | ||
.$ bindVar "y" | ||
.= var "pure" | ||
.$ ( var "MkZ" | ||
.$ var "n" | ||
.$ var "x" | ||
.$ var "y") | ||
] | ||
} | ||
] | ||
}) | ||
] | ||
] |
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
tests/derivation/utils/fusion/print/generator/002 two var ordered match/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,26 @@ | ||
module DerivedGen | ||
|
||
import public Deriving.DepTyCheck.Util.Fusion | ||
import public Deriving.DepTyCheck.Gen.Core | ||
|
||
|
||
%default total | ||
|
||
data X : Type -> Type -> Type where | ||
MkX : X m n | ||
|
||
data Y : Type -> Type -> Type where | ||
MkY : Y m n | ||
|
||
data Z : Type where | ||
MkZ : (m : Type) -> (n : Type) -> X m n -> Y m n -> Z | ||
|
||
%language ElabReflection | ||
|
||
|
||
decl : Maybe FusionDecl | ||
decl = %runElab runFusion `{X} [`{m}, `{n}] `{Y} [`{m}, `{n}] | ||
|
||
main : IO () | ||
main = putPretty $ getGen decl | ||
|
File renamed without changes.
64 changes: 64 additions & 0 deletions
64
tests/derivation/utils/fusion/print/generator/002 two var ordered match/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,64 @@ | ||
1/1: Building DerivedGen (DerivedGen.idr) | ||
[ IClaim | ||
emptyFC | ||
MW | ||
Export | ||
[] | ||
(mkTy | ||
{ name = "genXY" | ||
, type = | ||
MkArg MW ExplicitArg Nothing (var "Fuel") | ||
.-> var "Gen" | ||
.$ var "MaybeEmpty" | ||
.$ ( var "DPair" | ||
.$ type | ||
.$ ( MkArg MW ExplicitArg (Just "m") type | ||
.=> var "DPair" | ||
.$ type | ||
.$ ( MkArg MW ExplicitArg (Just "n") type | ||
.=> var "XY" .$ var "m" .$ var "n"))) | ||
}) | ||
, IClaim | ||
emptyFC | ||
MW | ||
Export | ||
[] | ||
(mkTy | ||
{ name = "genZ_ultimate" | ||
, type = | ||
MkArg MW ExplicitArg Nothing (var "Fuel") | ||
.-> var "Gen" .$ var "MaybeEmpty" .$ var "Z" | ||
}) | ||
, IDef | ||
emptyFC | ||
"genZ_ultimate" | ||
[ var "genZ_ultimate" .$ bindVar "fl" | ||
.= var ">>=" | ||
.$ (var "genXY" .$ var "fl") | ||
.$ ( MkArg MW ExplicitArg (Just "{lamc:0}") implicitFalse | ||
.=> iCase | ||
{ sc = var "{lamc:0}" | ||
, ty = implicitFalse | ||
, clauses = | ||
[ var "MkDPair" | ||
.$ bindVar "m" | ||
.$ (var "MkDPair" .$ bindVar "n" .$ bindVar "xy") | ||
.= iCase | ||
{ sc = var "splitXY" .$ var "xy" | ||
, ty = implicitTrue | ||
, clauses = | ||
[ var "Builtin.MkPair" | ||
.$ bindVar "x" | ||
.$ bindVar "y" | ||
.= var "pure" | ||
.$ ( var "MkZ" | ||
.$ var "m" | ||
.$ var "n" | ||
.$ var "x" | ||
.$ var "y") | ||
] | ||
} | ||
] | ||
}) | ||
] | ||
] |
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
tests/derivation/utils/fusion/print/generator/003 two var unordered match/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,24 @@ | ||
module DerivedGen | ||
|
||
import public Deriving.DepTyCheck.Util.Fusion | ||
import public Deriving.DepTyCheck.Gen.Core | ||
|
||
|
||
%default total | ||
|
||
data X : Type -> Type -> Type where | ||
MkX : X m n | ||
|
||
data Y : Type -> Type -> Type where | ||
MkY : Y m n | ||
|
||
data Z : Type where | ||
MkZ : (m : Type) -> (n : Type) -> X m n -> Y n m -> Z | ||
|
||
%language ElabReflection | ||
|
||
decl : Maybe FusionDecl | ||
decl = %runElab runFusion `{X} [`{m}, `{n}] `{Y} [`{n}, `{m}] | ||
|
||
main : IO () | ||
main = putPretty $ getGen decl |
File renamed without changes.
Oops, something went wrong.