
24 Oct
2004
24 Oct
'04
5:47 a.m.
The pair data type is quite a regular data type, where (x,y) is syntactic sugar for (,) x y, right? So, why aren't 'fst' and 'snd' record selectors of the pair data type? The definition of pair could be like data (,) a b = (,) {fst :: a, snd :: b} Then the following would work: Prelude> let a = (1,2) Prelude> a {fst = 3} (3,2)
7513
Age (days ago)
7513
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lemming