summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/examples
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell-bind/examples')
-rw-r--r--src/runtime/haskell-bind/examples/pgf-shell.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/runtime/haskell-bind/examples/pgf-shell.hs b/src/runtime/haskell-bind/examples/pgf-shell.hs
index 224c16512..fbb4c4023 100644
--- a/src/runtime/haskell-bind/examples/pgf-shell.hs
+++ b/src/runtime/haskell-bind/examples/pgf-shell.hs
@@ -9,6 +9,7 @@
import Control.Monad(forever)
import Data.Char(isSpace)
+import qualified Data.Map as M
import System.IO(hFlush,stdout)
import System.IO.Error(catchIOError)
import System.Environment
@@ -22,9 +23,10 @@ getPGF [path] = pgfShell =<< readPGF path
getPGF _ = putStrLn "Usage: pgf-shell <path to pgf>"
pgfShell pgf =
- forever $ do performGC
- putStr "> "; hFlush stdout
- execute pgf =<< readLn
+ do putStrLn . unwords . map (show.fst) . M.toList $ languages pgf
+ forever $ do performGC
+ putStr "> "; hFlush stdout
+ execute pgf =<< readLn
execute pgf cmd =
case cmd of