4 Feb
2010
4 Feb
'10
7:25 p.m.
The parser has a type restricted return type - always a 'Hughes string' with efficient concatenation (ShowS :: String -> String) rather than some polymorphic answer (e.g a parse tree). For formatting it allows you to add text without consuming any: inserttext :: String -> Parser inserttext str = return (showString str) Or rewrite matched input: rewrite :: String -> String -> Parser rewrite inp out = string inp >> return (showString out) Or drop text, I presume this is what the place combinator does. Its a nice technique. On 4 February 2010 10:46, Heinrich Apfelmus <apfelmus@quantentunnel.de> wrote:
This looks intriguing! Can you elaborate on how this works?