[Haskell-cafe] Re: Reinvention
Jon Fairbairn
jon.fairbairn at cl.cam.ac.uk
Wed Jun 27 15:26:56 EDT 2007
Andrew Coppin <andrewcoppin at btinternet.com> writes:
> I seem to be forever writing code that looks like this:
>
> decode :: String -> (SKI,String)
> decode (c:cs) = case c of
> 'S' -> (S,cs)
> 'K' -> (K,cs)
> 'I' -> (I,cs)
> '*' -> let (e0,cs0) = decode cs; (e1,cs1) = decode cs1 in (e0 :@: e1, cs1)
This looks like parsing to me.
--
Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
More information about the Haskell-Cafe
mailing list