{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Text.Parsec.ByteString
( Parser, GenParser, parseFromFile
) where
import Text.Parsec.Error
import Text.Parsec.Prim
import qualified Data.ByteString.Char8 as C
instance (Monad m) => Stream C.ByteString m Char where
uncons = return . C.uncons
type Parser = Parsec C.ByteString ()
type GenParser t st = Parsec C.ByteString st
parseFromFile :: Parser a -> String -> IO (Either ParseError a)
parseFromFile p fname
= do input <- C.readFile fname
return (runP p () fname input)