Shellac 0.9.5.2 → 0.9.9
raw patch · 4 files changed
+11/−34 lines, 4 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- System.Console.Shell: beforePrompt :: ShellDescription st -> Sh st ()
- System.Console.Shell: commandStyle :: ShellDescription st -> CommandStyle
- System.Console.Shell: defaultCompletions :: ShellDescription st -> Maybe (st -> String -> IO [String])
- System.Console.Shell: evaluateFunc :: ShellDescription st -> String -> Sh st ()
- System.Console.Shell: exceptionHandler :: ShellDescription st -> ShellacException -> Sh st ()
- System.Console.Shell: greetingText :: ShellDescription st -> Maybe String
- System.Console.Shell: historyEnabled :: ShellDescription st -> Bool
- System.Console.Shell: historyFile :: ShellDescription st -> Maybe FilePath
- System.Console.Shell: maxHistoryEntries :: ShellDescription st -> Int
- System.Console.Shell: prompt :: ShellDescription st -> st -> IO String
- System.Console.Shell: secondaryPrompt :: ShellDescription st -> Maybe (st -> IO String)
- System.Console.Shell: shellCommands :: ShellDescription st -> [ShellCommand st]
- System.Console.Shell: wordBreakChars :: ShellDescription st -> [Char]
- System.Console.Shell.Backend: addHistory :: ShellBackend bst -> bst -> String -> IO ()
- System.Console.Shell.Backend: clearHistoryState :: ShellBackend bst -> bst -> IO ()
- System.Console.Shell.Backend: completeFilename :: ShellBackend bst -> bst -> String -> IO [String]
- System.Console.Shell.Backend: completeUsername :: ShellBackend bst -> bst -> String -> IO [String]
- System.Console.Shell.Backend: flushOutput :: ShellBackend bst -> bst -> IO ()
- System.Console.Shell.Backend: getInput :: ShellBackend bst -> bst -> String -> IO (Maybe String)
- System.Console.Shell.Backend: getMaxHistoryEntries :: ShellBackend bst -> bst -> IO Int
- System.Console.Shell.Backend: getSingleChar :: ShellBackend bst -> bst -> String -> IO (Maybe Char)
- System.Console.Shell.Backend: getWordBreakChars :: ShellBackend bst -> bst -> IO String
- System.Console.Shell.Backend: initBackend :: ShellBackend bst -> IO bst
- System.Console.Shell.Backend: onCancel :: ShellBackend bst -> bst -> IO ()
- System.Console.Shell.Backend: outputString :: ShellBackend bst -> bst -> BackendOutput -> IO ()
- System.Console.Shell.Backend: readHistory :: ShellBackend bst -> bst -> FilePath -> IO ()
- System.Console.Shell.Backend: setAttemptedCompletionFunction :: ShellBackend bst -> bst -> CompletionFunction -> IO ()
- System.Console.Shell.Backend: setDefaultCompletionFunction :: ShellBackend bst -> bst -> Maybe (String -> IO [String]) -> IO ()
- System.Console.Shell.Backend: setMaxHistoryEntries :: ShellBackend bst -> bst -> Int -> IO ()
- System.Console.Shell.Backend: setWordBreakChars :: ShellBackend bst -> bst -> String -> IO ()
- System.Console.Shell.Backend: shutdownBackend :: ShellBackend bst -> bst -> IO ()
- System.Console.Shell.Backend: writeHistory :: ShellBackend bst -> bst -> FilePath -> IO ()
- System.Console.Shell.ShellMonad: instance MonadState st (Sh st)
+ System.Console.Shell: [beforePrompt] :: ShellDescription st -> Sh st ()
+ System.Console.Shell: [commandStyle] :: ShellDescription st -> CommandStyle
+ System.Console.Shell: [defaultCompletions] :: ShellDescription st -> Maybe (st -> String -> IO [String])
+ System.Console.Shell: [evaluateFunc] :: ShellDescription st -> String -> Sh st ()
+ System.Console.Shell: [exceptionHandler] :: ShellDescription st -> ShellacException -> Sh st ()
+ System.Console.Shell: [greetingText] :: ShellDescription st -> Maybe String
+ System.Console.Shell: [historyEnabled] :: ShellDescription st -> Bool
+ System.Console.Shell: [historyFile] :: ShellDescription st -> Maybe FilePath
+ System.Console.Shell: [maxHistoryEntries] :: ShellDescription st -> Int
+ System.Console.Shell: [prompt] :: ShellDescription st -> st -> IO String
+ System.Console.Shell: [secondaryPrompt] :: ShellDescription st -> Maybe (st -> IO String)
+ System.Console.Shell: [shellCommands] :: ShellDescription st -> [ShellCommand st]
+ System.Console.Shell: [wordBreakChars] :: ShellDescription st -> [Char]
+ System.Console.Shell.Backend: [addHistory] :: ShellBackend bst -> bst -> String -> IO ()
+ System.Console.Shell.Backend: [clearHistoryState] :: ShellBackend bst -> bst -> IO ()
+ System.Console.Shell.Backend: [completeFilename] :: ShellBackend bst -> bst -> String -> IO [String]
+ System.Console.Shell.Backend: [completeUsername] :: ShellBackend bst -> bst -> String -> IO [String]
+ System.Console.Shell.Backend: [flushOutput] :: ShellBackend bst -> bst -> IO ()
+ System.Console.Shell.Backend: [getInput] :: ShellBackend bst -> bst -> String -> IO (Maybe String)
+ System.Console.Shell.Backend: [getMaxHistoryEntries] :: ShellBackend bst -> bst -> IO Int
+ System.Console.Shell.Backend: [getSingleChar] :: ShellBackend bst -> bst -> String -> IO (Maybe Char)
+ System.Console.Shell.Backend: [getWordBreakChars] :: ShellBackend bst -> bst -> IO String
+ System.Console.Shell.Backend: [initBackend] :: ShellBackend bst -> IO bst
+ System.Console.Shell.Backend: [onCancel] :: ShellBackend bst -> bst -> IO ()
+ System.Console.Shell.Backend: [outputString] :: ShellBackend bst -> bst -> BackendOutput -> IO ()
+ System.Console.Shell.Backend: [readHistory] :: ShellBackend bst -> bst -> FilePath -> IO ()
+ System.Console.Shell.Backend: [setAttemptedCompletionFunction] :: ShellBackend bst -> bst -> CompletionFunction -> IO ()
+ System.Console.Shell.Backend: [setDefaultCompletionFunction] :: ShellBackend bst -> bst -> Maybe (String -> IO [String]) -> IO ()
+ System.Console.Shell.Backend: [setMaxHistoryEntries] :: ShellBackend bst -> bst -> Int -> IO ()
+ System.Console.Shell.Backend: [setWordBreakChars] :: ShellBackend bst -> bst -> String -> IO ()
+ System.Console.Shell.Backend: [shutdownBackend] :: ShellBackend bst -> bst -> IO ()
+ System.Console.Shell.Backend: [writeHistory] :: ShellBackend bst -> bst -> FilePath -> IO ()
+ System.Console.Shell.ShellMonad: instance Control.Monad.State.Class.MonadState st (System.Console.Shell.Types.Sh st)
Files
- Shellac.cabal +9/−15
- src/System/Console/Shell/PPrint.hs +1/−0
- src/System/Console/Shell/RunShell.hs +0/−10
- src/System/Console/Shell/Types.hs +1/−9
Shellac.cabal view
@@ -1,7 +1,7 @@ Name: Shellac-Cabal-Version: >= 1.2.3+Cabal-Version: >= 1.22 Build-Type: Simple-Version: 0.9.5.2+Version: 0.9.9 License: BSD3 License-File: LICENSE Author: Robert Dockins@@ -21,31 +21,25 @@ and still enjoy the advanced features that may be available from a powerful line editing package like readline. -flag base4- Library Hs-Source-Dirs: src- Build-Depends: base < 5, mtl, directory-- if flag(base4)- Build-Depends: base >= 4- CPP-Options: -DBASE4- else- Build-Depends: base < 4-- if impl(ghc >= 6.8) && impl(ghc < 6.10)- Extensions: PatternSignatures+ Build-Depends:+ base == 4.*,+ mtl,+ directory if os(windows) CPP-Options: -DBUILD_WINDOWS else Build-Depends: unix - Extensions:+ Default-Language: Haskell2010+ Default-Extensions: MultiParamTypeClasses FunctionalDependencies ExistentialQuantification CPP+ ScopedTypeVariables UndecidableInstances GeneralizedNewtypeDeriving FlexibleInstances
src/System/Console/Shell/PPrint.hs view
@@ -47,6 +47,7 @@ , displayS, displayIO ) where +import Prelude hiding ( (<|>), (<$>) ) import System.IO (Handle,hPutStr,hPutChar,stdout) infixr 5 </>,<//>,<$>,<$$>
src/System/Console/Shell/RunShell.hs view
@@ -321,22 +321,12 @@ -- ignores the thread killed exception, because that is used to -- implement execution canceling) -#ifdef BASE4- defaultExceptionHandler :: ShellacException -> Sh st () defaultExceptionHandler ex = case Ex.fromException ex of Just Ex.ThreadKilled -> return () _ -> shellPutErrLn $ concat ["The following exception occurred:\n ",show ex] -#else--defaultExceptionHandler :: ShellacException -> Sh st ()-defaultExceptionHandler (Ex.AsyncException Ex.ThreadKilled) = return ()-defaultExceptionHandler ex = do- shellPutErrLn $ concat ["The following exception occurred:\n ",show ex]--#endif ---------------------------------------------------------------------------- -- | Creates a simple subshell from a state mapping function
src/System/Console/Shell/Types.hs view
@@ -31,15 +31,7 @@ | UsernameCompleter | OtherCompleter (st -> String -> IO [String]) --#ifdef BASE4--- | Compatability layer. For base-3, this is--- \'Exception\'. For base-4, this is--- \'SomeException\'. type ShellacException = Ex.SomeException-#else-type ShellacException = Ex.Exception-#endif -- | The result of parsing a command. data CommandParseResult st@@ -74,7 +66,7 @@ -- The type parameter @st@ allows the monad to carry around a package of -- user-defined state. newtype Sh st a = Sh { unSh :: StateT (CommandResult st) (ReaderT OutputCommand IO) a }- deriving (Monad, MonadIO, MonadFix, Functor)+ deriving (Monad, MonadIO, MonadFix, Functor, Applicative) ------------------------------------------------------------------------ -- The shell description and utility functions