Magicloud Magiclouds <magicloud.magiclo...@gmail.com> writes:

>  43 instance Read Attribute where
>  44   readsPrec _ str = [ (mkAttr attr_ color, rest) | (attr_, rest1) <- lex 
> str
>  45                                                  , (color, rest)  <- case 
> reads rest1 of
>  46                                                        [(color_, rest_)] 
> -> (color_, rest_)
>  47                                                        _ -> (Color 0 0 0, 
> rest1) ]

Doesn't the (color,rest) pair in the list comprehension need to be
pulled from a list?  The case expression only returns a pair so you're
basically left with [something| something, (color,rest) <- (somecolor,somerest) 
]

Since you're only producing a single (color,rest) for each rest1, you might
consider lifting it out in the left side of the list comprehension.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to