forked from idris-lang/Idris2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ elab ] Change quantity of the
search
function's argument to 0
- Loading branch information
Showing
5 changed files
with
33 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Language.Reflection | ||
|
||
%default total | ||
|
||
scr : ty -> ty -> Elab ty | ||
scr l r = do | ||
Just x <- search $ Semigroup ty | ||
| Nothing => pure l | ||
pure $ l <+> r | ||
|
||
%language ElabReflection | ||
|
||
data N = A | B | C | D | ||
|
||
X : N | ||
X = %runElab scr B C | ||
|
||
xCorr : X = B | ||
xCorr = Refl | ||
|
||
Y : List Nat | ||
Y = %runElab scr [1, 2, 3] [4, 5] | ||
|
||
yCorr : Y = [1, 2, 3, 4, 5] | ||
yCorr = Refl |
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 @@ | ||
1/1: Building SearchZero (SearchZero.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,3 @@ | ||
. ../../../testutils.sh | ||
|
||
check SearchZero.idr |