Skip to content

Commit 8038f0a

Browse files
buzdengallais
authored andcommitted
[ refactoring ] Tiny changes following up the idris-lang/Idris2#830
Some zeroes in signatures, one simpler implementation and formatting.
1 parent e58bcfc commit 8038f0a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

libs/base/Data/Fin.idr

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,16 @@ namespace Equality
229229

230230
||| The actual proof used by cast is irrelevant
231231
export
232-
congCast : {n, q : Nat} -> {k : Fin m} -> {l : Fin p} ->
232+
congCast : {0 n, q : Nat} -> {k : Fin m} -> {l : Fin p} ->
233233
{0 eq1 : m = n} -> {0 eq2 : p = q} ->
234234
k ~~~ l ->
235235
cast eq1 k ~~~ cast eq2 l
236236
congCast eq = transitive (castEq _) (transitive eq $ symmetric $ castEq _)
237237

238238
||| Last is congruent wrt index equality
239239
export
240-
congLast : {m, n : Nat} -> (0 _ : m = n) -> last {n=m} ~~~ last {n}
241-
congLast {m = Z} {n = Z} eq = reflexive
242-
congLast {m = S _} {n = S _} eq = FS (congLast (succInjective _ _ eq))
240+
congLast : {m : Nat} -> (0 _ : m = n) -> last {n=m} ~~~ last {n}
241+
congLast Refl = reflexive
243242

244243
export
245244
congShift : (m : Nat) -> k ~~~ l -> shift m k ~~~ shift m l
@@ -263,7 +262,7 @@ namespace Equality
263262
export
264263
hetPointwiseIsTransport :
265264
{0 k : Fin m} -> {0 l : Fin n} ->
266-
(eq : m === n) -> k ~~~ l -> k === rewrite eq in l
265+
(0 eq : m === n) -> k ~~~ l -> k === rewrite eq in l
267266
hetPointwiseIsTransport Refl = homoPointwiseIsEqual
268267

269268
export

libs/contrib/Data/Fin/Extra.idr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ finToNatMultHomo {m = S _} (FS x) y = Calc $
213213
~~ finToNat (y + x * y) ...( Refl )
214214
~~ finToNat y + finToNat (x * y) ...( finToNatPlusHomo y (x * y) )
215215
~~ finToNat y + finToNat x * finToNat y ...( cong (finToNat y +) (finToNatMultHomo x y) )
216-
~~ finToNat (FS x) * finToNat y ...( Refl)
216+
~~ finToNat (FS x) * finToNat y ...( Refl )
217217

218218
-- Relations to `Fin`'s `last`
219219

@@ -292,7 +292,7 @@ plusZeroRightNeutral (FS k) = FS (plusZeroRightNeutral k)
292292

293293
export
294294
congPlusRight : {m, n, p : Nat} -> {k : Fin (S n)} -> {l : Fin (S p)} ->
295-
(c : Fin m) -> k ~~~ l -> c + k ~~~ c + l
295+
(c : Fin m) -> k ~~~ l -> c + k ~~~ c + l
296296
congPlusRight c FZ
297297
= transitive (plusZeroRightNeutral c)
298298
(symmetric $ plusZeroRightNeutral c)

0 commit comments

Comments
 (0)