Ры (pbl) wrote,
Ры
pbl

зверинец наших утилит

import Data.Either
import Data.Maybe
import Control.Monad
import Control.Monad.Fix
import qualified IO
import Text.ParserCombinators.Parsec
main = IO.hGetContents IO.stdin >>= mapM_ IO.putStrLn . either (const ["Error."]) id .
    parse (fix (\f -> (fix $ (try (eof >> return Nothing) <|>) . ((try (string "Index: " >>
    many (noneOf "\n") >>= ((char '\n' >> many1 (char '=') >> char '\n' >>) . return)) >>=
    return . Just) <|>) . (many (noneOf "\n") >> char '\n' >>)) >>=
    maybe (return []) ((f >>=) . (return .) . (:)))) "<<<stdin>>>"
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments