reflex-ghci 0.1.5.1 → 0.1.5.2
raw patch · 4 files changed
+54/−16 lines, 4 filesdep ~reflex-vtyPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: reflex-vty
API changes (from Hackage documentation)
- Reflex.Vty.GHCi: getExitEvent :: (PerformEvent t m, MonadIO (Performable m)) => Ghci t -> Event t a -> VtyWidget t m (Event t ())
+ Reflex.Vty.GHCi: getExitEvent :: (PerformEvent t m, MonadIO (Performable m), HasInput t m) => Ghci t -> Event t a -> m (Event t ())
- Reflex.Vty.GHCi: ghciExecOutput :: (MonadHold t m, MonadFix m, Adjustable t m) => Ghci t -> VtyWidget t m ()
+ Reflex.Vty.GHCi: ghciExecOutput :: (MonadHold t m, MonadFix m, Adjustable t m, HasDisplayRegion t m, HasInput t m, HasImageWriter t m, HasTheme t m, HasInput t m) => Ghci t -> m ()
- Reflex.Vty.GHCi: ghciModuleStatus :: (MonadNodeId m, PostBuild t m, MonadHold t m, MonadFix m, Adjustable t m) => Ghci t -> VtyWidget t m ()
+ Reflex.Vty.GHCi: ghciModuleStatus :: (MonadNodeId m, PostBuild t m, MonadHold t m, MonadFix m, Adjustable t m, HasLayout t m, HasImageWriter t m, HasFocusReader t m, HasDisplayRegion t m, HasInput t m, HasTheme t m, HasFocus t m) => Ghci t -> m ()
- Reflex.Vty.GHCi: ghciPanes :: (Reflex t, MonadFix m, MonadHold t m, MonadNodeId m, PostBuild t m, Adjustable t m) => Ghci t -> VtyWidget t m ()
+ Reflex.Vty.GHCi: ghciPanes :: (Reflex t, MonadFix m, MonadHold t m, MonadNodeId m, PostBuild t m, Adjustable t m, HasInput t m, HasImageWriter t m, HasFocusReader t m, HasDisplayRegion t m, HasTheme t m, HasLayout t m, HasFocus t m) => Ghci t -> m ()
- Reflex.Vty.GHCi: scrollableOutput :: (Reflex t, MonadNodeId m, MonadHold t m, MonadFix m, PostBuild t m) => Behavior t ByteString -> VtyWidget t m ()
+ Reflex.Vty.GHCi: scrollableOutput :: (Reflex t, HasDisplayRegion t m, HasFocus t m, HasFocusReader t m, HasImageWriter t m, HasInput t m, HasLayout t m, HasTheme t m, MonadFix m, MonadHold t m, MonadNodeId m, PostBuild t m) => Behavior t ByteString -> m ()
- Reflex.Vty.GHCi: scrollingOutput :: (Reflex t, Monad m, MonadHold t m, MonadFix m) => Dynamic t ByteString -> VtyWidget t m ()
+ Reflex.Vty.GHCi: scrollingOutput :: (Reflex t, Monad m, MonadHold t m, MonadFix m, HasDisplayRegion t m, HasInput t m, HasImageWriter t m, HasTheme t m) => Dynamic t ByteString -> m ()
- Reflex.Vty.GHCi: statusDisplay :: (PostBuild t m, MonadHold t m) => Ghci t -> VtyWidget t m ()
+ Reflex.Vty.GHCi: statusDisplay :: (PostBuild t m, MonadHold t m, HasDisplayRegion t m, HasImageWriter t m, HasTheme t m) => Ghci t -> m ()
Files
- ChangeLog.md +4/−0
- reflex-ghci.cabal +2/−2
- src-bin/ghci.hs +1/−1
- src/Reflex/Vty/GHCi.hs +47/−13
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for reflex-ghci +## 0.1.5.2++* Use reflex-vty 0.2+ ## 0.1.5.1 * Extend version bounds to support reflex 0.8
reflex-ghci.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: reflex-ghci-version: 0.1.5.1+version: 0.1.5.2 synopsis: A GHCi widget library for use in reflex applications description: Run GHCi from within a Reflex FRP (<https://reflex-frp.org>) application and interact with it using a functional reactive interface.@@ -35,7 +35,7 @@ , reflex-fsnotify >= 0.2 && < 0.3 , reflex-process >= 0.3 && < 0.4 , regex-tdfa >= 1.2.3 && < 1.4- , reflex-vty >= 0.1.3 && < 0.2+ , reflex-vty >= 0.2 && < 0.3 , text >= 1.2 && < 1.3 , unix >= 2.7 && < 2.8 , vty >=5.21 && <5.29
src-bin/ghci.hs view
@@ -44,7 +44,7 @@ showVersion version ] GhciArg { _ghciArg_replCommand = cmd, _ghciArg_execCommand = expr } <- execParser opts- mainWidget $ do+ mainWidget $ initManager_ $ do exit <- keyCombo (V.KChar 'c', [V.MCtrl]) g <- ghciWatch (shell cmd) $ T.encodeUtf8 . T.pack <$> expr case expr of
src/Reflex/Vty/GHCi.hs view
@@ -25,9 +25,12 @@ statusDisplay :: ( PostBuild t m , MonadHold t m+ , HasDisplayRegion t m+ , HasImageWriter t m+ , HasTheme t m ) => Ghci t- -> VtyWidget t m ()+ -> m () statusDisplay g = do pb <- getPostBuild text <=< hold "" $ leftmost@@ -40,17 +43,24 @@ -- when there is additional content to view. scrollableOutput :: ( Reflex t- , MonadNodeId m- , MonadHold t m+ , HasDisplayRegion t m+ , HasFocus t m+ , HasFocusReader t m+ , HasImageWriter t m+ , HasInput t m+ , HasLayout t m+ , HasTheme t m , MonadFix m+ , MonadHold t m+ , MonadNodeId m , PostBuild t m ) => Behavior t ByteString- -> VtyWidget t m ()+ -> m () scrollableOutput out = col $ do dh <- displayHeight- scroll <- stretch $ scrollableText never $ T.decodeUtf8 <$> out- fixed 1 $ text $+ scroll <- tile flex $ scrollableText never $ T.decodeUtf8 <$> out+ grout (fixed 1) $ text $ let f h (ix, n) = if n - ix + 1 > h then "↓ More ↓" else ""@@ -62,9 +72,13 @@ , Monad m , MonadHold t m , MonadFix m+ , HasDisplayRegion t m+ , HasInput t m+ , HasImageWriter t m+ , HasTheme t m ) => Dynamic t ByteString- -> VtyWidget t m ()+ -> m () scrollingOutput out = do dh <- displayHeight let scrollBy h (ix, n) =@@ -82,15 +96,22 @@ , MonadHold t m , MonadFix m , Adjustable t m+ , HasLayout t m+ , HasImageWriter t m+ , HasFocusReader t m+ , HasDisplayRegion t m+ , HasInput t m+ , HasTheme t m+ , HasFocus t m ) => Ghci t- -> VtyWidget t m ()+ -> m () ghciModuleStatus g = col $ do let ghciExit = _process_exit $ _ghci_process g ghciExited <- hold False $ True <$ ghciExit- fixed 3 $ boxStatic def $ statusDisplay g+ grout (fixed 3) $ boxStatic def $ statusDisplay g out <- moduleOutput (not <$> ghciExited) g- stretch $ void $+ tile flex $ void $ networkHold (scrollableOutput $ current out) $ ffor (_ghci_reload g) $ const $ scrollableOutput $ current out @@ -99,9 +120,14 @@ :: ( MonadHold t m , MonadFix m , Adjustable t m+ , HasDisplayRegion t m+ , HasInput t m+ , HasImageWriter t m+ , HasTheme t m+ , HasInput t m ) => Ghci t- -> VtyWidget t m ()+ -> m () ghciExecOutput g = do ghciExited <- hold False $ True <$ _process_exit (_ghci_process g) out <- execOutput (not <$> ghciExited) g@@ -117,9 +143,16 @@ , MonadNodeId m , PostBuild t m , Adjustable t m+ , HasInput t m+ , HasImageWriter t m+ , HasFocusReader t m+ , HasDisplayRegion t m+ , HasTheme t m+ , HasLayout t m+ , HasFocus t m ) => Ghci t- -> VtyWidget t m ()+ -> m () ghciPanes g = void $ splitVDrag (hRule doubleBoxStyle) (ghciModuleStatus g)@@ -130,10 +163,11 @@ getExitEvent :: ( PerformEvent t m , MonadIO (Performable m)+ , HasInput t m ) => Ghci t -> Event t a- -> VtyWidget t m (Event t ())+ -> m (Event t ()) getExitEvent g externalExitReq = do exitReq <- keyCombo (V.KChar 'c', [V.MCtrl]) let exitReqs = leftmost