Re: need help with list comprehension

2003-02-16 Thread Arjan van IJzendoorn
Hi Mike, > GameState = GameState Int Int Int Int Int > movePlayers :: GameState -> [GameState] > movePlayers (GameState p1 p2 p3 p4 p5) = > [ (GameState p1' p2' p3' p4' p5') | > p1' <- outlets (p1), > p2' <- outlets (p2), > p3' <- outlets (p3), > p4' <- outlets (p

need help with list comprehension

2003-02-15 Thread Mike T. Machenry
ng to use a list comprehension to model this movement on my graph. I want to build a list of all possible ways the players could move on one particular turn. I have a function (outlets) that gives me the neighbors of a node. This is a first draft function. GameState = GameState Int Int Int In

Re: list comprehension

2001-10-19 Thread Rijk-Jan van Haaften
Hello, Hi, I have a script here   interleave :: [Integer] -> [Strings] -> [String] interleave (x:xs) (y:ys)     = words [a | a <- (unwords [(show x), (filter (/= 1) y), "+"])]   Firstly, "Strings" is not a standard type. I suspect you mean "String" so the type signature is interleave :: [In

Re: list comprehension

2001-10-19 Thread Ch. A. Herrmann
> "Stephanie" == Stephanie Randles <[EMAIL PROTECTED]> writes: Stephanie> Hi, I have a script here Stephanie> interleave :: [Integer] -> [Strings] -> [String] Stephanie> interleave (x:xs) (y:ys) = words [a | a <- (unwords Stephanie> [(show x), (filter (/= 1) y), "+"])] S

list comprehension

2001-10-19 Thread Stephanie Randles
Hi, I have a script here   interleave :: [Integer] -> [Strings] -> [String]interleave (x:xs) (y:ys)    = words [a | a <- (unwords [(show x), (filter (/= 1) y), "+"])]     and the error message i receive is   (Instance of Num Char required for definition of interleave)   and I don't un