-
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 ] Don't discard types with implciits
- Loading branch information
Showing
70 changed files
with
762 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target types with implicit type parameters are not supported yet | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `Builtin.(===)` is not a top-level data definition | ||
|
||
DerivedGen:9:55--9:60 | ||
DerivedGen:9:39--9:42 | ||
5 | %default total | ||
6 | | ||
7 | %language ElabReflection | ||
8 | | ||
9 | checkedGen : Fuel -> (a, b : Bool) -> Gen MaybeEmpty (a = b) | ||
^^^^^ | ||
^^^ | ||
|
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target types with implicit type parameters are not supported yet | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `Builtin.(===)` is not a top-level data definition | ||
|
||
DerivedGen:10:54--10:59 | ||
DerivedGen:10:38--10:41 | ||
06 | | ||
07 | %language ElabReflection | ||
08 | | ||
09 | export | ||
10 | checkedGen : Fuel -> (a, b : Nat) -> Gen MaybeEmpty (a = b) | ||
^^^^^ | ||
^^^ | ||
|
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
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 |
---|---|---|
@@ -1,12 +1,47 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Named implicit applications (like to `DerivedGen.FinEq`) are not supported yet | ||
|
||
DerivedGen:14:11--14:22 | ||
10 | | ||
11 | %language ElabReflection | ||
12 | | ||
13 | data FinEq : Fin n -> Fin n -> Type where | ||
14 | Here : FinEq FZ FZ | ||
^^^^^^^^^^^ | ||
|
||
Generated values: | ||
----- | ||
----- | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
----- | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target types with implicit type parameters are not supported yet | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target type `Builtin.(===)` is not a top-level data definition | ||
|
||
DerivedGen:9:63--9:68 | ||
DerivedGen:9:47--9:50 | ||
5 | %default total | ||
6 | | ||
7 | %language ElabReflection | ||
8 | | ||
9 | checkedGen : DecEq a => Fuel -> (x, y : a) -> Gen MaybeEmpty (x = y) | ||
^^^^^ | ||
^^^ | ||
|
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 |
---|---|---|
@@ -1,12 +1,47 @@ | ||
1/2: Building RunDerivedGen (RunDerivedGen.idr) | ||
2/2: Building DerivedGen (DerivedGen.idr) | ||
Error: While processing right hand side of checkedGen. Error during reflection: Target types with implicit type parameters are not supported yet | ||
|
||
DerivedGen:25:81--25:92 | ||
21 | | ||
22 | Show (X n i1 i2) where | ||
23 | show $ MkX i1 i2 prf = "MkX \{show i1} \{show i2} \{show prf}" | ||
24 | | ||
25 | checkedGen : Fuel -> (Fuel -> {n : Nat} -> (i1, i2 : Fin n) -> Gen MaybeEmpty $ FinEq i1 i2) => | ||
^^^^^^^^^^^ | ||
|
||
Generated values: | ||
----- | ||
----- | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
MkX 1 1 These Here | ||
----- | ||
----- | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) | ||
----- | ||
MkX 2 2 These (These Here) |
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.
68 changes: 68 additions & 0 deletions
68
tests/derivation/least-effort/print/regression/dependent-givens-impl-big/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,68 @@ | ||
module DerivedGen | ||
|
||
import Data.Fin | ||
|
||
import Deriving.DepTyCheck.Gen | ||
|
||
%default total | ||
|
||
data AnyType = PrimTy | RefTy | ||
|
||
DecEq AnyType where | ||
decEq PrimTy PrimTy = Yes Refl | ||
decEq PrimTy RefTy = No $ \case Refl impossible | ||
decEq RefTy PrimTy = No $ \case Refl impossible | ||
decEq RefTy RefTy = Yes Refl | ||
|
||
namespace MaybeAnyType | ||
|
||
-- specialisation since we don't support polymorphism over types yet | ||
public export | ||
data MaybeAnyType | ||
= Nothing | ||
| Just AnyType | ||
|
||
export | ||
Injective MaybeAnyType.Just where | ||
injective Refl = Refl | ||
|
||
export | ||
DecEq MaybeAnyType where | ||
decEq Nothing Nothing = Yes Refl | ||
decEq Nothing (Just _) = No $ \case Refl impossible | ||
decEq (Just _) Nothing = No $ \case Refl impossible | ||
decEq (Just x) (Just y) = decEqCong $ decEq x y | ||
|
||
namespace VectMaybeAnyType | ||
|
||
-- specialisation since we don't support polymorphism over types yet | ||
public export | ||
data VectMaybeAnyType : Nat -> Type where | ||
Nil : VectMaybeAnyType Z | ||
(::) : MaybeAnyType -> VectMaybeAnyType n -> VectMaybeAnyType (S n) | ||
|
||
public export | ||
index : Fin n -> VectMaybeAnyType n -> MaybeAnyType | ||
index FZ (x::_ ) = x | ||
index (FS i) (_::xs) = index i xs | ||
|
||
export | ||
Biinjective VectMaybeAnyType.(::) where | ||
biinjective Refl = (Refl, Refl) | ||
|
||
export | ||
DecEq (VectMaybeAnyType n) where | ||
decEq [] [] = Yes Refl | ||
decEq (x::xs) (y::ys) = decEqCong2 (decEq x y) (decEq xs ys) | ||
|
||
public export | ||
data AtIndex : Fin n -> MaybeAnyType -> VectMaybeAnyType n -> Type where | ||
Here : AtIndex FZ x (x::xs) | ||
There : {n : Nat} -> {0 i : Fin n} -> {0 zs : VectMaybeAnyType n} -> | ||
AtIndex i x zs -> AtIndex (FS i) x (z::zs) | ||
|
||
%language ElabReflection | ||
|
||
%logging "deptycheck.derive.print" 5 | ||
%runElab deriveGenPrinter @{MainCoreDerivator @{LeastEffort}} $ | ||
Fuel -> {n : Nat} -> (v : VectMaybeAnyType n) -> Gen MaybeEmpty (i ** t ** AtIndex i t v) |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.