12 Sep
2011
12 Sep
'11
5:58 a.m.
Thanks, I was just responding, with: readsPrec _ (b:a:rest) = [(Card{ suit=(toSuit a), rank=(read [b]) }, rest)] Thanks for your help! Peter On Sun, Sep 11, 2011 at 10:56 PM, Daniel Fischer <daniel.is.fischer@googlemail.com> wrote:
On Sunday 11 September 2011, 23:27:53, Peter Hall wrote:
Thanks, Good spot on the order. I'll get to that, but I still didn't have success with your other suggestion.
Oops, yes.
readsPrec returns a list of pairs, [(parsed value, remaining input)],
so
readsPrec _ (a:b) = [(Card{suit = toSuit a, rank = r}, trl) | (r, trl) <- reads b] where toSuit 'c' = Club ...