packages feed

haskeline 0.7.4.3 → 0.7.5.0

raw patch · 12 files changed

+35/−27 lines, 12 filesdep ~basedep ~transformersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, transformers

API changes (from Hackage documentation)

+ System.Console.Haskeline.Completion: fallbackCompletion :: Monad m => CompletionFunc m -> CompletionFunc m -> CompletionFunc m
- System.Console.Haskeline.MonadException: [SomeException] :: SomeException
+ System.Console.Haskeline.MonadException: [SomeException] :: forall e. Exception e => e -> SomeException
- System.Console.Haskeline.MonadException: catches :: (MonadException m) => m a -> [Handler m a] -> m a
+ System.Console.Haskeline.MonadException: catches :: MonadException m => m a -> [Handler m a] -> m a
- System.Console.Haskeline.MonadException: class (Typeable * e, Show e) => Exception e
+ System.Console.Haskeline.MonadException: class (Typeable e, Show e) => Exception e
- System.Console.Haskeline.MonadException: data IOException :: *
+ System.Console.Haskeline.MonadException: data IOException
- System.Console.Haskeline.MonadException: data SomeException :: *
+ System.Console.Haskeline.MonadException: data SomeException

Files

Changelog view
@@ -1,3 +1,9 @@+Changed in version 0.7.5.0:+   * Add the new function `fallbackCompletion` to combine+     multiple `CompletionFunc`s+   * Fix warnings+   * Bump the lower bound to ghc-8.0+ Changed in version 0.7.4.3:    * Bump upper bounds on base, containers, stm and unix    * Fix redundant "Category" field in haskeline.cabal
System/Console/Haskeline/Backend/Posix.hsc view
@@ -303,7 +303,7 @@  type PosixT m = ReaderT Handles m -runPosixT :: Monad m => Handles -> PosixT m a -> m a+runPosixT :: Handles -> PosixT m a -> m a runPosixT h = runReaderT' h  fileRunTerm :: Handle -> IO RunTerm
System/Console/Haskeline/Backend/Terminfo.hs view
@@ -1,3 +1,6 @@+#if __GLASGOW_HASKELL__ <= 802+{-# OPTIONS_GHC -Wno-redundant-constraints #-}+#endif module System.Console.Haskeline.Backend.Terminfo(                             Draw(),                             runTerminfoDraw@@ -5,7 +8,6 @@                              where  import System.Console.Terminfo-import Control.Applicative import Control.Monad import Data.List(foldl') import System.IO
System/Console/Haskeline/Backend/Win32.hsc view
@@ -15,7 +15,6 @@ import Control.Concurrent hiding (throwTo) import Data.Char(isPrint) import Data.Maybe(mapMaybe)-import Control.Applicative import Control.Monad  import System.Console.Haskeline.Key@@ -166,9 +165,6 @@ data Coord = Coord {coordX, coordY :: Int}                 deriving Show -#if __GLASGOW_HASKELL__ < 711-#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)-#endif instance Storable Coord where     sizeOf _ = (#size COORD)     alignment _ = (#alignment COORD)
System/Console/Haskeline/Completion.hs view
@@ -3,6 +3,7 @@                             Completion(..),                             noCompletion,                             simpleCompletion,+                            fallbackCompletion,                             -- * Word completion                             completeWord,                             completeWordWithPrev,@@ -188,3 +189,12 @@     home <- getHomeDirectory     return (home </> path) fixPath path = return path++-- | If the first completer produces no suggestions, fallback to the second+-- completer's output.+fallbackCompletion :: Monad m => CompletionFunc m -> CompletionFunc m -> CompletionFunc m+fallbackCompletion a b input = do+    aCompletions <- a input+    if null (snd aCompletions)+        then b input+        else return aCompletions
System/Console/Haskeline/History.hs view
@@ -86,7 +86,7 @@ addHistory s h = h {histLines = maybeDropLast (stifleAmt h) (s <| (histLines h))}  -- If the sequence is too big, drop the last entry.-maybeDropLast :: Ord a => Maybe Int -> Seq a -> Seq a+maybeDropLast :: Maybe Int -> Seq a -> Seq a maybeDropLast maxAmt hs     | rightSize = hs     | otherwise = case viewr hs of
System/Console/Haskeline/InputT.hs view
@@ -13,8 +13,6 @@  import System.Directory(getHomeDirectory) import System.FilePath-import Control.Applicative-import Control.Monad (liftM, ap) import Control.Monad.Fix import System.IO import Data.IORef
System/Console/Haskeline/MonadException.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} {- | This module redefines some of the functions in "Control.Exception" to work for more general monads built on top of 'IO'. -}@@ -28,9 +29,6 @@  import qualified Control.Exception as E import Control.Exception (Exception,SomeException)-#if __GLASGOW_HASKELL__ < 705-import Prelude hiding (catch)-#endif import Control.Monad(liftM, join) import Control.Monad.IO.Class import Control.Monad.Trans.Identity@@ -41,7 +39,6 @@ import Control.Monad.Trans.Maybe import Control.Monad.Trans.RWS import Control.Monad.Trans.Writer-import Data.Monoid import Control.Concurrent(ThreadId)  -- This approach is based on that of the monad-control package.
System/Console/Haskeline/Monads.hs view
@@ -29,9 +29,6 @@ import Control.Monad.Trans.Reader hiding (ask,asks) import qualified Control.Monad.Trans.Reader as Reader import Data.IORef-#if __GLASGOW_HASKELL__ < 705-import Prelude hiding (catch)-#endif  import System.Console.Haskeline.MonadException @@ -44,7 +41,8 @@ instance Monad m => MonadReader s (StateT s m) where     ask = get -instance (MonadReader r m, MonadTrans t, Monad (t m)) => MonadReader r (t m) where+instance {-# OVERLAPPABLE #-} (MonadReader r m, MonadTrans t, Monad (t m))+    => MonadReader r (t m) where     ask = lift ask  asks :: MonadReader r m => (r -> a) -> m a@@ -67,7 +65,7 @@     put s'     return x -runReaderT' :: Monad m => r -> ReaderT r m a -> m a+runReaderT' :: r -> ReaderT r m a -> m a runReaderT' = flip runReaderT  newtype StateT s m a = StateT { getStateTFunc @@ -111,7 +109,8 @@     get = StateT $ \s -> return $ \f -> f s s     put s = s `seq` StateT $ \_ -> return $ \f -> f () s -instance (MonadState s m, MonadTrans t, Monad (t m)) => MonadState s (t m) where+instance {-# OVERLAPPABLE #-} (MonadState s m, MonadTrans t, Monad (t m))+    => MonadState s (t m) where     get = lift get     put = lift . put 
System/Console/Haskeline/RunCommand.hs view
@@ -20,7 +20,7 @@                     cmds   runCommandLoop' :: forall m n s a . (Term n, CommandMonad n,-        MonadState Layout m, MonadReader Prefs n, LineState s)+        MonadState Layout m, LineState s)         => (forall b . m b -> n b) -> TermOps -> Prefix -> s -> KeyCommand m s a -> n Event         -> n a runCommandLoop' liftE tops prefix initState cmds getEvent = do
System/Console/Haskeline/Term.hs view
@@ -9,7 +9,7 @@ import Control.Concurrent import Control.Concurrent.STM import Data.Word-import Control.Exception (fromException, AsyncException(..),bracket_)+import Control.Exception (fromException, AsyncException(..)) import Data.Typeable import System.IO import Control.Monad(liftM,when,guard)@@ -104,7 +104,7 @@         => CommandMonad m where     runCompletion :: (String,String) -> m (String,[Completion]) -instance (MonadTrans t, CommandMonad m, MonadReader Prefs (t m),+instance {-# OVERLAPPABLE #-} (MonadTrans t, CommandMonad m, MonadReader Prefs (t m),         MonadException (t m),         MonadReader Layout (t m))             => CommandMonad (t m) where@@ -160,7 +160,7 @@  -- | Utility function for changing a property of a terminal for the duration of -- a computation.-bracketSet :: (Eq a, MonadException m) => IO a -> (a -> IO ()) -> a -> m b -> m b+bracketSet :: MonadException m => IO a -> (a -> IO ()) -> a -> m b -> m b bracketSet getState set newState f = bracket (liftIO getState)                             (liftIO . set)                             (\_ -> liftIO (set newState) >> f)
haskeline.cabal view
@@ -1,6 +1,6 @@ Name:           haskeline Cabal-Version:  >=1.10-Version:        0.7.4.3+Version:        0.7.5.0 Category:       User Interfaces License:        BSD3 License-File:   LICENSE@@ -42,9 +42,9 @@     -- We require ghc>=7.4.1 (base>=4.5) to use the base library encodings, even     -- though it was implemented in earlier releases, due to GHC bug #5436 which     -- wasn't fixed until 7.4.1-    Build-depends: base >=4.5 && < 4.13, containers>=0.4 && < 0.7,+    Build-depends: base >=4.9 && < 4.13, containers>=0.4 && < 0.7,                    directory>=1.1 && < 1.4, bytestring>=0.9 && < 0.11,-                   filepath >= 1.2 && < 1.5, transformers >= 0.2 && < 0.6,+                   filepath >= 1.2 && < 1.5, transformers >= 0.4 && < 0.6,                    process >= 1.0 && < 1.7, stm >= 2.4 && < 2.6     Default-Language: Haskell98     Default-Extensions:@@ -53,7 +53,7 @@                 FlexibleContexts, ExistentialQuantification                 ScopedTypeVariables, GeneralizedNewtypeDeriving                 StandaloneDeriving-                MultiParamTypeClasses, OverlappingInstances+                MultiParamTypeClasses,                 UndecidableInstances                 ScopedTypeVariables, CPP, DeriveDataTypeable,                 PatternGuards