haskell-bind: fix broken pgf-shell

The type CId was replaced with String, so can't use show and read anymore.
This commit is contained in:
hallgren
2014-02-10 12:59:31 +00:00
parent 5818b0fe1b
commit 1bcb2d06e3

View File

@@ -23,7 +23,7 @@ getPGF [path] = pgfShell =<< readPGF path
getPGF _ = putStrLn "Usage: pgf-shell <path to pgf>"
pgfShell pgf =
do putStrLn . unwords . map (show.fst) . M.toList $ languages pgf
do putStrLn . unwords . map fst . M.toList $ languages pgf
forever $ do performGC
putStr "> "; hFlush stdout
execute pgf =<< readLn
@@ -54,13 +54,10 @@ data Command = P String String | L String Expr | T String String String deriving
instance Read Command where
readsPrec _ s =
[(P l r2,"") | ("p",r1)<-lex s,
(l,r2) <- reads' r1]
(l,r2) <- lex r1]
++ [(L l t,"") | ("l",r1)<-lex s,
(l,r2)<- reads' r1,
(l,r2)<- lex r1,
Just t<-[readExpr r2]]
++ [(T l1 l2 r3,"") | ("t",r1)<-lex s,
(l1,r2)<-reads' r1,
(l2,r3)<-reads' r2]
-- | Workaround for deficiency in instance Read CId
reads' s = reads (dropWhile isSpace s)
(l1,r2)<-lex r1,
(l2,r3)<-lex r2]