mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 01:01:59 +03:00
0c030020de
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.
10 lines
269 B
Idris
10 lines
269 B
Idris
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)
|