@@ -70,8 +70,9 @@ module Reflex.Vty.Widget
71import Control.Applicative (liftA2)
71import Control.Applicative (liftA2)
72import Control.Monad.Fix (MonadFix)
72import Control.Monad.Fix (MonadFix)
73−import Control.Monad.Reader
73+import Control.Monad.IO.Class (MonadIO)
74+import Control.Monad.Reader (ReaderT, ask, asks, runReaderT)
74−import Control.Monad.Trans (lift)
75+import Control.Monad.Trans (MonadTrans, lift)
75import Data.Default (Default(..))
76import Data.Default (Default(..))
76import Data.Set (Set)
77import Data.Set (Set)
77import qualified Data.Set as Set
78import qualified Data.Set as Set
@@ -142,7 +143,7 @@ instance MonadTrans (VtyWidget t) where
143instance MonadNodeId m => MonadNodeId (VtyWidget t m) where
144instance MonadNodeId m => MonadNodeId (VtyWidget t m) where
144 getNextNodeId = VtyWidget $ do
145 getNextNodeId = VtyWidget $ do
145− lift $ lift $ getNextNodeId
146+ lift $ lift getNextNodeId
147-- | Runs a 'VtyWidget' with a given context
148-- | Runs a 'VtyWidget' with a given context
148runVtyWidget
149runVtyWidget
@@ -492,7 +493,7 @@ splitVDrag wS wA wB = do
492 rec splitterCheckpoint <- holdDyn splitter0 $ leftmost [fst <$> ffilter snd dragSplitter, resizeSplitter]
493 rec splitterCheckpoint <- holdDyn splitter0 $ leftmost [fst <$> ffilter snd dragSplitter, resizeSplitter]
493 splitterPos <- holdDyn splitter0 $ leftmost [fst <$> dragSplitter, resizeSplitter]
494 splitterPos <- holdDyn splitter0 $ leftmost [fst <$> dragSplitter, resizeSplitter]
494 splitterFrac <- holdDyn ((1::Double) / 2) $ ffor (attach (current dh) (fst <$> dragSplitter)) $ \(h, x) ->
495 splitterFrac <- holdDyn ((1::Double) / 2) $ ffor (attach (current dh) (fst <$> dragSplitter)) $ \(h, x) ->
495− fromIntegral x / (max 1 (fromIntegral h))
496+ fromIntegral x / max 1 (fromIntegral h)
496 let dragSplitter = fforMaybe (attach (current splitterCheckpoint) dragE) $
497 let dragSplitter = fforMaybe (attach (current splitterCheckpoint) dragE) $
497 \(splitterY, Drag (_, fromY) (_, toY) _ _ end) ->
498 \(splitterY, Drag (_, fromY) (_, toY) _ _ end) ->
498 if splitterY == fromY then Just (toY, end) else Nothing
499 if splitterY == fromY then Just (toY, end) else Nothing