mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-09-11 15:55:54 +03:00
API: migrate "lens" usage to "microlens" packages
This commit is contained in:
parent
a06b86749f
commit
f3950cf96d
34
brick.cabal
34
brick.cabal
@ -81,7 +81,8 @@ library
|
||||
transformers,
|
||||
data-default,
|
||||
containers,
|
||||
lens,
|
||||
microlens,
|
||||
microlens-th,
|
||||
vector,
|
||||
contravariant,
|
||||
text,
|
||||
@ -101,7 +102,8 @@ executable brick-visibility-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens,
|
||||
microlens-th
|
||||
|
||||
executable brick-viewport-scroll-demo
|
||||
if !flag(demos)
|
||||
@ -115,7 +117,7 @@ executable brick-viewport-scroll-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
||||
executable brick-dialog-demo
|
||||
if !flag(demos)
|
||||
@ -129,7 +131,7 @@ executable brick-dialog-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
||||
executable brick-layer-demo
|
||||
if !flag(demos)
|
||||
@ -143,7 +145,8 @@ executable brick-layer-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens,
|
||||
microlens-th
|
||||
|
||||
executable brick-suspend-resume-demo
|
||||
if !flag(demos)
|
||||
@ -157,7 +160,8 @@ executable brick-suspend-resume-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens,
|
||||
microlens-th
|
||||
|
||||
executable brick-padding-demo
|
||||
if !flag(demos)
|
||||
@ -171,7 +175,7 @@ executable brick-padding-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
||||
executable brick-attr-demo
|
||||
if !flag(demos)
|
||||
@ -185,7 +189,7 @@ executable brick-attr-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
||||
executable brick-markup-demo
|
||||
if !flag(demos)
|
||||
@ -199,7 +203,7 @@ executable brick-markup-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
||||
executable brick-list-demo
|
||||
if !flag(demos)
|
||||
@ -213,7 +217,7 @@ executable brick-list-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens,
|
||||
microlens,
|
||||
vector
|
||||
|
||||
executable brick-custom-event-demo
|
||||
@ -228,7 +232,8 @@ executable brick-custom-event-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens,
|
||||
microlens-th
|
||||
|
||||
executable brick-hello-world-demo
|
||||
if !flag(demos)
|
||||
@ -242,7 +247,7 @@ executable brick-hello-world-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
||||
executable brick-edit-demo
|
||||
if !flag(demos)
|
||||
@ -256,7 +261,8 @@ executable brick-edit-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens,
|
||||
microlens-th
|
||||
|
||||
executable brick-border-demo
|
||||
if !flag(demos)
|
||||
@ -270,4 +276,4 @@ executable brick-border-demo
|
||||
vty >= 5.3.1,
|
||||
data-default,
|
||||
text,
|
||||
lens
|
||||
microlens
|
||||
|
@ -2,7 +2,8 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Main where
|
||||
|
||||
import Control.Lens (makeLenses, (^.), (&), (.~), (%~))
|
||||
import Lens.Micro ((^.), (&), (.~), (%~))
|
||||
import Lens.Micro.TH (makeLenses)
|
||||
import Control.Monad (void, forever)
|
||||
import Control.Concurrent (newChan, writeChan, threadDelay, forkIO)
|
||||
import Data.Default
|
||||
|
@ -3,7 +3,8 @@
|
||||
{-# LANGUAGE RankNTypes #-}
|
||||
module Main where
|
||||
|
||||
import Control.Lens
|
||||
import Lens.Micro
|
||||
import Lens.Micro.TH
|
||||
import qualified Graphics.Vty as V
|
||||
|
||||
import qualified Brick.Main as M
|
||||
|
@ -2,7 +2,8 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Main where
|
||||
|
||||
import Control.Lens (makeLenses, (^.), (&), (%~))
|
||||
import Lens.Micro ((^.), (&), (%~))
|
||||
import Lens.Micro.TH (makeLenses)
|
||||
import Control.Monad (void)
|
||||
import Data.Default
|
||||
import qualified Graphics.Vty as V
|
||||
|
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module Main where
|
||||
|
||||
import Control.Lens ((^.))
|
||||
import Lens.Micro ((^.))
|
||||
import Control.Monad (void)
|
||||
import Data.Monoid
|
||||
import Data.Maybe (fromMaybe)
|
||||
|
@ -2,7 +2,8 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
module Main where
|
||||
|
||||
import Control.Lens (makeLenses, (.~), (^.), (&))
|
||||
import Lens.Micro ((.~), (^.), (&))
|
||||
import Lens.Micro.TH (makeLenses)
|
||||
import Control.Monad (void)
|
||||
import Data.Monoid
|
||||
import Data.Default
|
||||
|
@ -3,7 +3,8 @@
|
||||
module Main where
|
||||
|
||||
import Control.Monad (void)
|
||||
import Control.Lens
|
||||
import Lens.Micro
|
||||
import Lens.Micro.TH
|
||||
import Data.Monoid
|
||||
import qualified Graphics.Vty as V
|
||||
|
||||
|
@ -14,7 +14,7 @@ module Brick.Focus
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens ((^.))
|
||||
import Lens.Micro ((^.))
|
||||
import Data.Maybe (listToMaybe)
|
||||
|
||||
import Brick.Types
|
||||
|
@ -31,7 +31,7 @@ module Brick.Main
|
||||
where
|
||||
|
||||
import Control.Exception (finally)
|
||||
import Control.Lens ((^.))
|
||||
import Lens.Micro ((^.))
|
||||
import Control.Monad (forever)
|
||||
import Control.Monad.Trans.Class (lift)
|
||||
import Control.Monad.Trans.State
|
||||
|
@ -11,7 +11,7 @@ module Brick.Markup
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens ((.~), (&), (^.))
|
||||
import Lens.Micro ((.~), (&), (^.))
|
||||
import Control.Monad (forM)
|
||||
import qualified Data.Text as T
|
||||
import Data.Text.Markup
|
||||
|
@ -68,7 +68,8 @@ module Brick.Types
|
||||
where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Lens (_1, _2, to, (^.), (&), (.~), Lens')
|
||||
import Lens.Micro (_1, _2, to, (^.), (&), (.~), Lens')
|
||||
import Lens.Micro.Type (Getting)
|
||||
import Data.Monoid (Monoid(..))
|
||||
import Control.Monad.Trans.State.Lazy
|
||||
import Control.Monad.Trans.Reader
|
||||
@ -172,7 +173,7 @@ suffixLenses ''Context
|
||||
suffixLenses ''Result
|
||||
|
||||
-- | The rendering context's current drawing attribute.
|
||||
attrL :: (Contravariant f, Functor f) => (Attr -> f Attr) -> Context -> f Context
|
||||
attrL :: forall r. Getting r Context Attr
|
||||
attrL = to (\c -> attrMapLookup (c^.ctxAttrNameL) (c^.ctxAttrMapL))
|
||||
|
||||
instance TerminalLocation CursorLocation where
|
||||
|
@ -29,7 +29,9 @@ module Brick.Types.Internal
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens (Field1, Field2, _1, _2, Lens', makeLenses)
|
||||
import Lens.Micro (_1, _2, Lens')
|
||||
import Lens.Micro.TH (makeLenses)
|
||||
import Lens.Micro.Internal (Field1, Field2)
|
||||
import Data.String
|
||||
import Data.Monoid
|
||||
import qualified Data.Map as M
|
||||
|
@ -6,7 +6,8 @@ where
|
||||
import qualified Language.Haskell.TH.Syntax as TH
|
||||
import qualified Language.Haskell.TH.Lib as TH
|
||||
|
||||
import Control.Lens (DefName(..), makeLensesWith, lensRules, (&), (.~), lensField)
|
||||
import Lens.Micro ((&), (.~))
|
||||
import Lens.Micro.TH (DefName(..), makeLensesWith, lensRules, lensField)
|
||||
|
||||
-- | A template haskell function to build lenses for a record type. This
|
||||
-- function differs from the 'Control.Lens.makeLenses' function in that
|
||||
|
@ -8,7 +8,7 @@ module Brick.Util
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens ((&), (%~))
|
||||
import Lens.Micro ((&), (%~))
|
||||
import Data.Monoid ((<>))
|
||||
import Graphics.Vty
|
||||
|
||||
|
@ -31,7 +31,7 @@ module Brick.Widgets.Border
|
||||
where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
import Control.Lens ((^.), to)
|
||||
import Lens.Micro ((^.), to)
|
||||
import Data.Monoid ((<>))
|
||||
import Graphics.Vty (imageHeight, imageWidth)
|
||||
|
||||
|
@ -14,7 +14,7 @@ module Brick.Widgets.Center
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens ((^.), (&), (.~), to)
|
||||
import Lens.Micro ((^.), (&), (.~), to)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Graphics.Vty (imageWidth, imageHeight, horizCat, charFill, vertCat)
|
||||
|
||||
|
@ -66,7 +66,7 @@ module Brick.Widgets.Core
|
||||
where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Lens ((^.), (.~), (&), (%~), to, _1, _2, each, to, ix, Lens')
|
||||
import Lens.Micro ((^.), (.~), (&), (%~), to, _1, _2, each, to, ix, Lens')
|
||||
import Control.Monad ((>=>),when)
|
||||
import Control.Monad.Trans.State.Lazy
|
||||
import Control.Monad.Trans.Reader
|
||||
|
@ -27,7 +27,7 @@ module Brick.Widgets.Dialog
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens
|
||||
import Lens.Micro
|
||||
import Control.Applicative
|
||||
import Data.Monoid
|
||||
import Data.List (intersperse)
|
||||
|
@ -27,7 +27,7 @@ module Brick.Widgets.Edit
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens
|
||||
import Lens.Micro
|
||||
import Graphics.Vty (Event(..), Key(..), Modifier(..))
|
||||
|
||||
import qualified Data.Text.Zipper as Z
|
||||
|
@ -7,7 +7,7 @@ module Brick.Widgets.Internal
|
||||
where
|
||||
|
||||
import Control.Applicative
|
||||
import Control.Lens ((^.), (&), (%~))
|
||||
import Lens.Micro ((^.), (&), (%~))
|
||||
import Control.Monad.Trans.State.Lazy
|
||||
import Control.Monad.Trans.Reader
|
||||
import Data.Default
|
||||
|
@ -40,7 +40,7 @@ module Brick.Widgets.List
|
||||
where
|
||||
|
||||
import Control.Applicative ((<$>),(<*>),pure)
|
||||
import Control.Lens ((^.), (&), (.~), (%~), _2)
|
||||
import Lens.Micro ((^.), (&), (.~), (%~), _2)
|
||||
import Data.Foldable (Foldable)
|
||||
import Data.Traversable (Traversable)
|
||||
import Data.Maybe (fromMaybe)
|
||||
|
@ -8,7 +8,7 @@ module Brick.Widgets.ProgressBar
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Lens ((^.))
|
||||
import Lens.Micro ((^.))
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.Monoid
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user