24 May
2002
24 May
'02
4:31 a.m.
On Thu, May 23, 2002 at 04:44:25PM +0930, Mark Phillips wrote: ...
We "count" as follows: [] [x] [y] [z] [x,y] [x,z] [y,x] [y,y] [y,z] [z,x] [z,y] [x,y,y] [x,y,z] [x,z,y] [y,x,y] [y,x,z] [y,y,x] [y,y,z] [y,z,x] [y,z,y] [z,x,y] [z,y,x] [z,y,y] [x,y,y,z] [x,y,z,y] [x,z,y,y] [y,x,y,z] [y,x,z,y] [y,y,x,z] [y,y,z,x] [y,z,x,y] [y,z,y,x] [z,x,y,y] [z,y,x,y] [z,y,y,x] and then start back at the beginning again (with []).
I want to define a function next :: [(a,Int)] -> [a] -> [a]
Is there a reason you frame the problem this way? Would it be OK to give a function
count :: [(a,Int)] -> [[a]]
which would return, e.g., the list you gave above? That would probably be more natural to code. --Dylan Thurston