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