haskeline 0.7.3.1 → 0.7.4.0
raw patch · 5 files changed
+21/−35 lines, 5 filesdep ~processsetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: process
API changes (from Hackage documentation)
+ System.Console.Haskeline.MonadException: instance System.Console.Haskeline.MonadException.MonadException m => System.Console.Haskeline.MonadException.MonadException (Control.Monad.Trans.Identity.IdentityT m)
Files
- Changelog +6/−0
- Setup.hs +1/−29
- System/Console/Haskeline/Backend/Win32.hsc +7/−2
- System/Console/Haskeline/MonadException.hs +2/−1
- haskeline.cabal +5/−3
Changelog view
@@ -1,6 +1,12 @@+Changed in version 0.7.4.0:+ * Properly process Unicode key events on Windows.+ * Add an instance MonadExcept IdentityT.+ * Remove custom Setup logic to support Cabal 2.0.+ Changed in version 0.7.3.1: * Properly disable echoing in getPassword when running in MinTTY. * Use `cast` from Data.Typeable instead of Data.Dynamic.+ Changed in version 0.7.3.0: * Require ghc version of at least 7.4.1, and clean up obsolete code * Add thread-safe (in terminal-style interaction) external print function
Setup.hs view
@@ -1,30 +1,2 @@-import Distribution.System-import Distribution.PackageDescription import Distribution.Simple-import Distribution.Simple.Setup--import Control.Monad(when)--main :: IO ()-main = defaultMainWithHooks myHooks--myHooks :: UserHooks-myHooks- | buildOS == Windows = simpleUserHooks- | otherwise = simpleUserHooks {- confHook = \genericDescript flags -> do- warnIfNotTerminfo flags- confHook simpleUserHooks genericDescript flags- }--warnIfNotTerminfo flags = when (not (hasFlagSet flags (FlagName "terminfo")))- $ mapM_ putStrLn- [ "*** Warning: running on POSIX but not building the terminfo backend. ***"- , "You may need to install the terminfo package manually, e.g. with"- , "\"cabal install terminfo\"; or, use \"-fterminfo\" when configuring or"- , "installing this package."- ,""- ]--hasFlagSet :: ConfigFlags -> FlagName -> Bool-hasFlagSet cflags flag = Just True == lookup flag (configConfigurationsFlags cflags)+main = defaultMain
System/Console/Haskeline/Backend/Win32.hsc view
@@ -73,8 +73,12 @@ processEvent :: InputEvent -> Maybe Event-processEvent KeyEvent {keyDown = True, unicodeChar = c, virtualKeyCode = vc,+processEvent KeyEvent {keyDown = kd, unicodeChar = c, virtualKeyCode = vc, controlKeyState = cstate}+ | kd || ((testMod (#const LEFT_ALT_PRESSED) || vc == (#const VK_MENU))+ && c /= '\NUL')+ -- Make sure not to ignore Unicode key events! The Unicode character might+ -- only be emitted on a keyup event. See also GH issue #54. = fmap (\e -> KeyInput [Key modifier' e]) $ keyFromCode vc `mplus` simpleKeyChar where simpleKeyChar = guard (c /= '\NUL') >> return (KeyChar c)@@ -226,7 +230,8 @@ foreign import WINDOWS_CCONV "windows.h MessageBeep" c_messageBeep :: UINT -> IO Bool messageBeep :: IO ()-messageBeep = c_messageBeep (-1) >> return ()-- intentionally ignore failures.+messageBeep = c_messageBeep simpleBeep >> return ()-- intentionally ignore failures.+ where simpleBeep = 0xffffffff ----------
System/Console/Haskeline/MonadException.hs view
@@ -33,6 +33,7 @@ #endif import Control.Monad(liftM, join) import Control.Monad.IO.Class+import Control.Monad.Trans.Identity import Control.Monad.Trans.Reader import Control.Monad.Trans.State.Strict import Control.Monad.Trans.Error@@ -179,4 +180,4 @@ . run . (\m -> runRWST m r s)) in fmap (\m -> runRWST m r s) $ f run' -+deriving instance MonadException m => MonadException (IdentityT m)
haskeline.cabal view
@@ -1,6 +1,6 @@ Name: haskeline Cabal-Version: >=1.10-Version: 0.7.3.1+Version: 0.7.4.0 Category: User Interfaces License: BSD3 License-File: LICENSE@@ -19,7 +19,7 @@ Homepage: http://trac.haskell.org/haskeline Bug-Reports: https://github.com/judah/haskeline/issues Stability: Stable-Build-Type: Custom+Build-Type: Simple extra-source-files: examples/Test.hs Changelog includes/*.h source-repository head@@ -37,6 +37,7 @@ flag terminfo Description: Use the terminfo package for POSIX consoles. Default: True+ Manual: True Library -- We require ghc>=7.4.1 (base>=4.5) to use the base library encodings, even@@ -45,13 +46,14 @@ Build-depends: base >=4.5 && < 4.11, containers>=0.4 && < 0.6, directory>=1.1 && < 1.4, bytestring>=0.9 && < 0.11, filepath >= 1.2 && < 1.5, transformers >= 0.2 && < 0.6,- process >= 1.0 && < 1.5+ process >= 1.0 && < 1.7 Default-Language: Haskell98 Default-Extensions: ForeignFunctionInterface, Rank2Types, FlexibleInstances, TypeSynonymInstances FlexibleContexts, ExistentialQuantification ScopedTypeVariables, GeneralizedNewtypeDeriving+ StandaloneDeriving MultiParamTypeClasses, OverlappingInstances UndecidableInstances ScopedTypeVariables, CPP, DeriveDataTypeable,