Ры (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>>>"
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments