question about list comprehension or creating array

17 Jan
2011
17 Jan
'11
10:29 a.m.
Hi, I want to create an immutable array like this In .hs file e = [1,2,3] a = array [1,3] [(i,v) | i<-[1..3], v<-e] I expect the output to be "array (1,3) [(1,1),(2,2),(3,3)]" But I got "array (1,3) [(1,3),(2,3),(3,3)]" Why is that? Can anyone tell me how to get the output that I expect? Thanks a lot, cchang
5237
Age (days ago)
5237
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ching-Chao Chang
-
David Virebayre