live-sequencer-0.0.6.1: src/InOut.hs
module InOut where
import qualified Text.ParserCombinators.Parsec as Parsec
import Text.PrettyPrint.HughesPJ ( Doc )
import Control.Monad ( liftM2 )
class Input a where input :: Parsec.Parser a
class Output a where output :: a -> Doc
parsecReader :: (Input a) => prec -> String -> [(a, String)]
parsecReader _p s =
case Parsec.parse ( liftM2 (,) input Parsec.getInput ) "" s of
Left _err -> []
Right (x,t) -> [(x,t)]