Use Lens package instead of MicroLens. Main reason is needing ALens, but we were already relying on -platform and -ghc so it was not really lightweight

This commit is contained in:
Francisco Vallarino 2020-07-08 00:08:35 -03:00
parent 7a4a9b625f
commit fc728f1ea2
13 changed files with 14 additions and 18 deletions

View File

@ -8,14 +8,13 @@ module KeysComposite (
import Debug.Trace
import Control.Concurrent (threadDelay)
import Control.Lens hiding (Empty, (|>), (<|))
import Control.Monad (forM_)
import Data.Default
import Data.Sequence (Seq(..), (|>))
import Data.Text (Text)
import Data.Typeable (Typeable)
import Lens.Micro.GHC
import Lens.Micro.TH (makeLenses)
import TextShow
import qualified Data.Sequence as Seq

View File

@ -8,10 +8,10 @@ module Main where
import Debug.Trace
import Control.Concurrent (threadDelay)
import Control.Lens (Lens', (&), (<&>), (^.), (.~), (%~))
import Control.Monad.State
import Data.Default
import Foreign.C.Types
import Lens.Micro
import NanoVG (Context(..), createGL3, CreateFlags(..), createFont, FileName(..), beginFrame, endFrame)
import SDL (($=))
import TextShow

View File

@ -5,12 +5,11 @@ module TestComposite (testComposite) where
import Debug.Trace
import Control.Concurrent (threadDelay)
import Control.Lens
import Control.Monad (forM_)
import Data.Default
import Data.Typeable (Typeable)
import Lens.Micro
import Lens.Micro.TH (makeLenses)
import TextShow
import Monomer.Common.Style

View File

@ -2,7 +2,7 @@
module Types where
import Lens.Micro.TH (makeLenses)
import Control.Lens (makeLenses)
import Data.Default
import Data.Text (Text)

View File

@ -28,9 +28,7 @@ dependencies:
- containers
- data-default
- extra
- microlens
- microlens-mtl
- microlens-th
- lens
- mtl
- nanovg
- OpenGL
@ -67,7 +65,7 @@ executables:
dependencies:
- ekg
- microlens-ghc
- lens
- monomer
tests:

View File

@ -3,8 +3,8 @@
module Monomer.Common.Geometry where
import Control.Lens.TH (makeLenses)
import Data.Default
import Lens.Micro.TH (makeLenses)
data Point = Point {
_x :: !Double,

View File

@ -8,6 +8,7 @@ module Monomer.Main.Core (
) where
import Control.Concurrent (threadDelay)
import Control.Lens
import Control.Monad
import Control.Monad.Extra
import Control.Monad.IO.Class
@ -16,7 +17,6 @@ import Data.List (foldl')
import Data.Maybe
import Data.Sequence (Seq, (><))
import Data.Typeable (Typeable)
import Lens.Micro.Mtl
import qualified Data.Map as M
import qualified Graphics.Rendering.OpenGL as GL

View File

@ -8,6 +8,7 @@ module Monomer.Main.Handlers (
) where
import Control.Concurrent.Async (async)
import Control.Lens (use, (.=))
import Control.Monad.STM (atomically)
import Control.Concurrent.STM.TChan (TChan, newTChanIO, writeTChan)
import Control.Applicative ((<|>))
@ -15,7 +16,6 @@ import Control.Monad
import Control.Monad.IO.Class
import Data.Maybe
import Data.Sequence (Seq(..), (><))
import Lens.Micro.Mtl
import qualified Data.Sequence as Seq
import qualified SDL

View File

@ -7,10 +7,10 @@ module Monomer.Main.Types where
import Control.Concurrent.Async
import Control.Concurrent.STM.TChan
import Control.Lens.TH (makeLenses)
import Control.Monad.State
import Data.Typeable (Typeable)
import Data.Sequence (Seq)
import Lens.Micro.TH (makeLenses)
import Monomer.Common.Geometry
import Monomer.Common.Tree

View File

@ -7,6 +7,7 @@ import Debug.Trace
import Control.Concurrent.Async (poll)
import Control.Concurrent.STM.TChan (tryReadTChan)
import Control.Exception.Base
import Control.Lens
import Control.Monad
import Control.Monad.Extra
import Control.Monad.IO.Class
@ -15,7 +16,6 @@ import Data.Foldable (toList)
import Data.Maybe
import Data.Sequence ((><))
import Data.Typeable
import Lens.Micro.Mtl
import qualified Data.Sequence as Seq

View File

@ -8,6 +8,7 @@ module Monomer.Widget.Widgets.Dropdown (dropdown) where
import Debug.Trace
import Control.Applicative ((<|>))
import Control.Lens (Lens', (&), (^.), (.~))
import Control.Monad
import Data.Default
import Data.Foldable (find)
@ -16,7 +17,6 @@ import Data.Maybe (fromMaybe)
import Data.Sequence (Seq(..), (<|), (|>))
import Data.Text (Text)
import Data.Traversable
import Lens.Micro
import qualified Data.Map as M
import qualified Data.Sequence as Seq

View File

@ -7,6 +7,7 @@ module Monomer.Widget.Widgets.ListView (listView) where
import Debug.Trace
import Control.Applicative ((<|>))
import Control.Lens (Lens', (&), (^.), (.~))
import Control.Monad
import Data.Default
import Data.Foldable (find)
@ -16,7 +17,6 @@ import Data.Sequence (Seq(..), (<|), (|>))
import Data.Text (Text)
import Data.Traversable
import Data.Typeable (Typeable, cast)
import Lens.Micro
import qualified Data.Map as M
import qualified Data.Sequence as Seq

View File

@ -4,10 +4,10 @@
module Monomer.Widget.Widgets.TextField (textField) where
import Control.Monad
import Control.Lens (Lens', (&), (^.), (.~))
import Data.Maybe
import Data.Text (Text)
import Data.Typeable
import Lens.Micro
import qualified Data.Text as T