[Haskell-cafe] Parsec question

Erik de Castro Lopo mle+cl at mega-nerd.com
Tue Dec 23 05:58:38 EST 2008


Erik de Castro Lopo wrote:

>     qualifiedIdentifier :: CharParser st [ String ]

Ahh, figured it out myself:

    qualifiedIdentifier :: CharParser st [ String ]
    qualifiedIdentifier = do
            i <- identifier
            r <- dotIdentifier
            return (i : r)
        where
        dotIdentifier = do
                char '.'
                i <- identifier
                r <- dotIdentifier
                return (i  : r)
            <|> return []

Does that look sane to people who know Haskell and Parsec
better than  me?

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
The Earth is around 70% water. Fish rule the seas.
Humans are over 90% water. It's only a matter of time.


More information about the Haskell-Cafe mailing list