diff options
| author | hallgren <hallgren@chalmers.se> | 2014-02-10 12:59:31 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2014-02-10 12:59:31 +0000 |
| commit | 1bcb2d06e30d9c7c06848cd5004e19a47b9a6578 (patch) | |
| tree | 914e368fbcec3a0eff67e25965342822d0bb6680 | |
| parent | 5818b0fe1b6ff930a25ed0696c45eaac6da33a05 (diff) | |
haskell-bind: fix broken pgf-shell
The type CId was replaced with String, so can't use show and read anymore.
| -rw-r--r-- | src/runtime/haskell-bind/examples/pgf-shell.hs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/runtime/haskell-bind/examples/pgf-shell.hs b/src/runtime/haskell-bind/examples/pgf-shell.hs index 1159ea794..20667a4cd 100644 --- a/src/runtime/haskell-bind/examples/pgf-shell.hs +++ b/src/runtime/haskell-bind/examples/pgf-shell.hs @@ -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] |
