on develop help sign in
Clean up warnings and lint
2d67244Elliot Cameron
src/Reflex/Class/Switchable.hs+2−3
@@ -4,7 +4,6 @@ Description: A class for things that can be switched on the firing of an event
4-}
4-}
5{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE FunctionalDependencies #-}
6{-# LANGUAGE FunctionalDependencies #-}
7−{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE UndecidableInstances #-}
7{-# LANGUAGE UndecidableInstances #-}
9module Reflex.Class.Switchable where
8module Reflex.Class.Switchable where
10
9
@@ -26,5 +25,5 @@ instance Reflex t => Switchable t (Behavior t a) where
26
25
27instance (Reflex t, Switchable t a, Switchable t b) => Switchable t (a, b) where
26instance (Reflex t, Switchable t a, Switchable t b) => Switchable t (a, b) where
28 switching (a, b) e = (,)
27 switching (a, b) e = (,)
29− <$> (switching a $ fmap fst e)
28+ <$> switching a (fmap fst e)
30− <*> (switching b $ fmap snd e)
29+ <*> switching b (fmap snd e)
src/Reflex/Vty/Host.hs+3−4
@@ -28,8 +28,7 @@ import Control.Monad.Identity (Identity(..))
28import Control.Monad.Primitive (PrimMonad)
28import Control.Monad.Primitive (PrimMonad)
29import Control.Monad.Ref (MonadRef, Ref, readRef)
29import Control.Monad.Ref (MonadRef, Ref, readRef)
30import Data.Dependent.Sum (DSum ((:=>)))
30import Data.Dependent.Sum (DSum ((:=>)))
31−import Data.IORef (IORef)
31+import Data.IORef (IORef, readIORef)
32−import Data.IORef (readIORef)
33import Data.Maybe (catMaybes)
32import Data.Maybe (catMaybes)
34
33
35import Reflex
34import Reflex
@@ -76,7 +75,7 @@ type MonadVtyApp t m =
76type VtyApp t m = MonadVtyApp t m
75type VtyApp t m = MonadVtyApp t m
77 => DisplayRegion
76 => DisplayRegion
78 -- ^ The initial display size (updates to this come as events)
77 -- ^ The initial display size (updates to this come as events)
79− -> Event t (V.Event)
78+ -> Event t V.Event
80 -- ^ Vty input events.
79 -- ^ Vty input events.
81 -> m (VtyResult t)
80 -> m (VtyResult t)
82 -- ^ The output of the 'VtyApp'. The application runs in a context that,
81 -- ^ The output of the 'VtyApp'. The application runs in a context that,
@@ -179,7 +178,7 @@ runVtyAppWithHandle vty vtyGuest = flip onException (V.shutdown vty) $
179 triggerInvocation = TriggerInvocation ne $ return ()
178 triggerInvocation = TriggerInvocation ne $ return ()
180 -- Write our input event's 'EventTrigger' with the newly created
179 -- Write our input event's 'EventTrigger' with the newly created
181 -- 'TriggerInvocation' value to the queue of events.
180 -- 'TriggerInvocation' value to the queue of events.
182− writeChan events $ [triggerRef :=> triggerInvocation]
181+ writeChan events [triggerRef :=> triggerInvocation]
183
182
184 -- The main application loop. We wait for new events, fire those that
183 -- The main application loop. We wait for new events, fire those that
185 -- have subscribers, and update the display. If we detect a shutdown
184 -- have subscribers, and update the display. If we detect a shutdown
src/Reflex/Vty/Widget.hs+5−4
@@ -70,8 +70,9 @@ module Reflex.Vty.Widget
70
70
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
142
143
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
146
147
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