-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
When implicitly binding a variable, use the location of the head function/constructor that expects it. This way we can differentiate multiple implicits bound on the same LHS. Note that this does not resolve the issue 34: there the location is then further muddled by the fact that where-bound functions are lifted to the toplevel.
- Loading branch information
Showing
10 changed files
with
72 additions
and
43 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
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,9 @@ | ||
data T : Type -> Type where | ||
Leaf : T a | ||
Node : Ord a => a -> T a -> T a -> T a | ||
|
||
zipWith : (a -> a -> a) -> T a -> T a -> T a | ||
zipWith f Leaf _ = Leaf | ||
zipWith f _ Leaf = Leaf | ||
zipWith f (Node x lx rx) (Node y ly ry) | ||
= Node (f x y) (zipWith f lx ly) (zipWith f rx ry) |
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,15 @@ | ||
1/1: Building Issue34 (Issue34.idr) | ||
Error: While processing right hand side of zipWith. Multiple solutions found in search of: | ||
Ord a | ||
|
||
Issue34:9:5--9:53 | ||
5 | zipWith : (a -> a -> a) -> T a -> T a -> T a | ||
6 | zipWith f Leaf _ = Leaf | ||
7 | zipWith f _ Leaf = Leaf | ||
8 | zipWith f (Node x lx rx) (Node y ly ry) | ||
9 | = Node (f x y) (zipWith f lx ly) (zipWith f rx ry) | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Possible correct results: | ||
conArg (implicitly bound at Issue34:8:12--8:16) | ||
conArg (implicitly bound at Issue34:8:27--8:31) |
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 Issue34.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
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