yi-core 0.19.0 → 0.19.1
raw patch · 4 files changed
+18/−8 lines, 4 files
Files
- src/Parser/Incremental.hs +6/−1
- src/Yi/Interact.hs +7/−3
- src/Yi/Types.hs +4/−3
- yi-core.cabal +1/−1
src/Parser/Incremental.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -20,6 +21,7 @@ import Control.Arrow (first, second, (***)) import Control.Applicative (Alternative ((<|>), empty))+import qualified Control.Monad.Fail as Fail import Data.Tree (Tree (Node)) data a :< b = (:<) {top :: a, _rest :: b}@@ -182,8 +184,11 @@ instance Monad (Parser s) where (>>=) = Bind return = pure+#if (!MIN_VERSION_base(4,13,0))+ fail _message = Empt+#endif -instance MonadFail (Parser s) where+instance Fail.MonadFail (Parser s) where fail _message = Empt toQ :: Parser s a -> forall h r. ((h,a) -> Steps s r) -> h -> Steps s r
src/Yi/Interact.hs view
@@ -71,6 +71,7 @@ import Control.Applicative (Alternative ((<|>), empty)) import Control.Arrow (first) import Lens.Micro.Platform (_1, _2, view)+import qualified Control.Monad.Fail as Fail import Control.Monad.State (MonadPlus (..), MonadTrans (lift), StateT) import Data.Function (on) import Data.List (groupBy)@@ -127,8 +128,11 @@ instance Monad (I event w) where return = Returns (>>=) = Binds+#if (!MIN_VERSION_base(4,13,0))+ fail _ = Fails+#endif -instance MonadFail (I event w) where+instance Fail.MonadFail (I event w) where fail _ = Fails instance Eq w => MonadPlus (I event w) where@@ -296,7 +300,7 @@ -- --------------------------------------------------------------------------- -- Derived operations-oneOf :: (Ord event, MonadInteract m w event, MonadFail m) => [event] -> m event+oneOf :: (Ord event, MonadInteract m w event, Fail.MonadFail m) => [event] -> m event oneOf s = choice $ map event s anyEvent :: (Ord event, MonadInteract m w event) => m event@@ -313,7 +317,7 @@ -- ^ Parses and returns the specified list of events (lazily). events = mapM event -choice :: (MonadInteract m w e, MonadFail m) => [m a] -> m a+choice :: (MonadInteract m w e, Fail.MonadFail m) => [m a] -> m a -- ^ Combines all parsers in the specified list. choice [] = fail "No choice succeeds" choice [p] = p
src/Yi/Types.hs view
@@ -28,6 +28,7 @@ import Control.Concurrent (MVar, modifyMVar, modifyMVar_, readMVar) import Control.Monad.Base (MonadBase, liftBase)+import qualified Control.Monad.Fail as Fail import Control.Monad.Reader import Control.Monad.State.Strict import Control.Monad (ap, liftM3, void, forever)@@ -124,7 +125,7 @@ -- TODO: doc how these are actually user-bindable -- are they? newtype YiM a = YiM {runYiM :: ReaderT Yi IO a}- deriving (Monad, Applicative, MonadReader Yi, MonadBase IO, Typeable, Functor, MonadFail)+ deriving (Monad, Applicative, MonadReader Yi, MonadBase IO, Typeable, Functor, Fail.MonadFail) instance MonadState Editor YiM where get = yiEditor <$> (liftBase . readMVar =<< yiVar <$> ask)@@ -171,7 +172,7 @@ , MonadState FBuffer , MonadReader Window ) -instance MonadFail BufferM where+instance Fail.MonadFail BufferM where fail = error -- | Currently duplicates some of Vim's indent settings. Allowing a@@ -365,7 +366,7 @@ askCfg = ask withEditor = id -instance MonadFail EditorM where+instance Fail.MonadFail EditorM where fail = error class (Monad m, MonadState Editor m) => MonadEditor m where
yi-core.cabal view
@@ -1,5 +1,5 @@ name: yi-core-version: 0.19.0+version: 0.19.1 synopsis: Yi editor core library category: Yi homepage: https://github.com/yi-editor/yi#readme