This tripped up a number of my students in the tutorial I was giving today:
open import Data.Product
open import Data.Empty
open import Relation.Binary.PropositionalEquality
-- OK
foo : {A B : Set} → A ×ばつ B → A
foo = λ (a , b) → a
-- OK
bar : {A : Set} → ⊥ → A
bar = λ ()
-- KO
baz : {A : Set} {x y : A} → x ≡ y → y ≡ x
baz = λ refl → refl
In λ refl → ..., the refl is just interpreted as a variable name, not as a constructor name as it would be in pattern matching, unlike a definition by clauses and also unlike λ {refl → refl}. I don't quite get why, but if you're going to do a backwards compatibility break, maybe changing this is something to consider?
This tripped up a number of my students in the tutorial I was giving today:
```
open import Data.Product
open import Data.Empty
open import Relation.Binary.PropositionalEquality
-- OK
foo : {A B : Set} → A ×ばつ B → A
foo = λ (a , b) → a
-- OK
bar : {A : Set} → ⊥ → A
bar = λ ()
-- KO
baz : {A : Set} {x y : A} → x ≡ y → y ≡ x
baz = λ refl → refl
```
In `λ refl → ...`, the `refl` is just interpreted as a variable name, not as a constructor name as it would be in pattern matching, unlike a definition by clauses and also unlike `λ {refl → refl}`. I don't quite get why, but if you're going to do a backwards compatibility break, maybe changing this is something to consider?