swap aidosti ykösel

This commit is contained in:
Aaro Koivukangas
2025-12-22 20:07:56 +02:00
parent 6378f45fea
commit 084e32f338
+1 -1
View File
@@ -253,7 +253,7 @@ transfer from to amount bank | Map.notMember from bank = bank
-- ==> array (1,4) [(1,"one"),(2,"three"),(3,"two"),(4,"four")]
swap :: Ix i => i -> i -> Array i a -> Array i a
swap i j arr = todo
swap i j arr = arr // ([(i, arr ! j), (j, arr ! i)])
------------------------------------------------------------------------------
-- Ex 12: given an Array, find the index of the largest element. You