Skip to content
Browse files

re-add export list

  • Loading branch information...
1 parent 624cfb9 commit 7b6823da4af374958e93f39f386157f0f09652bd @mikeplus64 committed
Showing with 29 additions and 8 deletions.
  1. +29 −8 src/Language/Haskell/Repl.hs
View
37 src/Language/Haskell/Repl.hs
@@ -1,5 +1,26 @@
{-# LANGUAGE ScopedTypeVariables #-}
-module Language.Haskell.Repl where
+module Language.Haskell.Repl
+ ( Repl(..)
+ -- * Construction
+ , newRepl
+ , repl'
+ , defaultExtensions
+ , defaultImports
+ , defaultLineLength
+ , defaultPatienceForResults
+ -- * Stopping
+ , stopRepl
+ -- * Interaction
+ , Input(..)
+ , ReplOutput(..)
+ , Output(..)
+ , prompt
+ , prompt'
+ , input
+ , output
+ , prettyOutput
+ , parseInput
+ ) where
import Control.Concurrent
import Control.Applicative
@@ -84,12 +105,12 @@ parseInput = probably [ parseClear, parseUndefine, parseType, parseKind, pars
where
probably = foldr1 (\l r -> Text.Parsec.try l <|> r)
-ppoutput :: Output -> [String]
-ppoutput (OK s) = s
-ppoutput (Exception s e) = overLast (++ ("*** Exception: " ++ e)) s
-ppoutput (Errors errs) = errs
-ppoutput (Partial s) = overLast (++ "*** Timed out") s
-ppoutput Timeout = ["*** Timed out"]
+prettyOutput :: Output -> [String]
+prettyOutput (OK s) = s
+prettyOutput (Exception s e) = overLast (++ ("*** Exception: " ++ e)) s
+prettyOutput (Errors errs) = errs
+prettyOutput (Partial s) = overLast (++ "*** Timed out") s
+prettyOutput Timeout = ["*** Timed out"]
data Repl = Repl
{ inputChan :: Chan Input
@@ -131,7 +152,7 @@ prompt
:: Repl
-> String
-> IO [String]
-prompt repl x = ppoutput <$> prompt_ repl (case runParser parseInput () "" x of
+prompt repl x = prettyOutput <$> prompt_ repl (case runParser parseInput () "" x of
Right a -> a
-- Should be impossible to reach. parseExpr gobbles up everything.
_ -> error "Cannot parse input!")

0 comments on commit 7b6823d

Please sign in to comment.
Something went wrong with that request. Please try again.