Skip to content

Commit

Permalink
[ prelude ] the is linear in its input (#3239)
Browse files Browse the repository at this point in the history
* [ prelude ] `the` is linear in its input

* [ fix ] eta-expand tests
  • Loading branch information
gallais committed Mar 27, 2024
1 parent 1c186f0 commit 2c2aa85
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/prelude/Prelude/Basics.idr
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Not x = x -> Void
||| @ a the type to assign
||| @ x the element to get the type
public export %inline
the : (0 a : Type) -> (x : a) -> a
the : (0 a : Type) -> (1 x : a) -> a
the _ x = x

||| Identity function.
Expand Down
2 changes: 1 addition & 1 deletion tests/prelude/char001/chars.idr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
chars : List Char -> List Char
chars = the (List Char)
chars cs = the (List Char) cs

singletonRange : chars ['1'..'1'] = chars ['1']
singletonRange = Refl
Expand Down
2 changes: 1 addition & 1 deletion tests/prelude/nat001/nats.idr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nats : List Nat -> List Nat
nats = the (List Nat)
nats ns = the (List Nat) ns

singletonRange : nats [1..1] = nats [1]
singletonRange = Refl
Expand Down

0 comments on commit 2c2aa85

Please sign in to comment.