{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Text.Parsec.String
( Parser, GenParser, parseFromFile
) where
import Text.Parsec.Error
import Text.Parsec.Prim
instance (Monad m) => Stream [tok] m tok where
uncons [] = return $ Nothing
uncons (t:ts) = return $ Just (t,ts)
{-# INLINE uncons #-}
type Parser = Parsec String ()
type GenParser tok st = Parsec [tok] st
parseFromFile :: Parser a -> String -> IO (Either ParseError a)
parseFromFile p fname
= do input <- readFile fname
return (runP p () fname input)