Ticket #3298 (closed proposal: fixed)
Add swap to Data.Tuple
| Reported by: | r6 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Not GHC |
| Component: | libraries/base | Version: | 6.10.2 |
| Keywords: | Cc: | merehap | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
I think swap is a widely accepted name for the function. There is only the question of strictness. I suggest swap for the lazy version and swap' for the strict version
swap ~(a,b) = (b,a)
swap' (a,b) = (b,a)
Change History
Note: See
TracTickets for help on using
tickets.
