API: remove Graphics.Vty.Prelude, move DisplayRegion to Image module
This change removes the mostly-unused Graphics.Vty.Prelude module and
moves the DisplayRegion type and its accessors to Graphics.Vty.Image.
commit629cb6e02a99c05c6268d836af354f70ec25189e
authorJonathan Daugherty <cygnus@foobox.com>
dateSun 22 Jan 2017, 09:42 (10 years ago)
parentafe5757
src/Graphics/Vty.hs−2
@@ -62,8 +62,6 @@ module Graphics.Vty
6262 )
6363where
6464
65−import Graphics.Vty.Prelude
66−
6765import Graphics.Vty.Config
6866import Graphics.Vty.Input
6967import Graphics.Vty.Output
src/Graphics/Vty/Debug.hs+1−2
@@ -5,9 +5,8 @@ module Graphics.Vty.Debug
55 )
66where
77
8−import Graphics.Vty.Prelude
9−
108import Graphics.Vty.Attributes
9+import Graphics.Vty.Image (DisplayRegion)
1110import Graphics.Vty.Debug.Image
1211import Graphics.Vty.Span
1312
src/Graphics/Vty/Image.hs+12
@@ -4,6 +4,9 @@
44{-# LANGUAGE DisambiguateRecordFields #-}
55module Graphics.Vty.Image
66 ( DisplayText
7+ , DisplayRegion
8+ , regionWidth
9+ , regionHeight
710 , Image
811 , imageWidth
912 , imageHeight
@@ -55,6 +58,15 @@ import qualified Data.Text.Lazy as TL
5558import qualified Data.Text.Lazy.Encoding as TL
5659import Data.Word
5760
61+-- | Named alias for a Int pair
62+type DisplayRegion = (Int,Int)
63+
64+regionWidth :: DisplayRegion -> Int
65+regionWidth = fst
66+
67+regionHeight :: DisplayRegion -> Int
68+regionHeight = snd
69+
5870infixr 5 <|>
5971infixr 4 <->
6072
src/Graphics/Vty/Output.hs+2−2
@@ -32,10 +32,10 @@ module Graphics.Vty.Output
3232 )
3333where
3434
35−import Graphics.Vty.Prelude
35+import Control.Monad (when)
3636
3737import Graphics.Vty.Config
38−
38+import Graphics.Vty.Image (regionWidth, regionHeight)
3939import Graphics.Vty.Output.Interface
4040import Graphics.Vty.Output.XTermColor as XTermColor
4141import Graphics.Vty.Output.TerminfoBased as TerminfoBased
src/Graphics/Vty/Output/Interface.hs+1−2
@@ -13,9 +13,8 @@
1313
1414module Graphics.Vty.Output.Interface where
1515
16−import Graphics.Vty.Prelude
17−
1816import Graphics.Vty.Attributes
17+import Graphics.Vty.Image (DisplayRegion, regionHeight)
1918import Graphics.Vty.Picture
2019import Graphics.Vty.PictureToSpans
2120import Graphics.Vty.Span
src/Graphics/Vty/Output/Mock.hs+1−2
@@ -10,8 +10,7 @@ module Graphics.Vty.Output.Mock
1010 )
1111where
1212
13−import Graphics.Vty.Prelude
14−
13+import Graphics.Vty.Image (DisplayRegion)
1514import Graphics.Vty.Output.Interface
1615
1716import Blaze.ByteString.Builder.Word (writeWord8)
src/Graphics/Vty/Output/TerminfoBased.hs+2−2
@@ -20,13 +20,13 @@ module Graphics.Vty.Output.TerminfoBased
2020 )
2121where
2222
23−import Graphics.Vty.Prelude
24−
23+import Control.Monad (when)
2524import Data.ByteString.Internal (toForeignPtr)
2625import Data.Terminfo.Parse
2726import Data.Terminfo.Eval
2827
2928import Graphics.Vty.Attributes
29+import Graphics.Vty.Image (DisplayRegion)
3030import Graphics.Vty.DisplayAttributes
3131import Graphics.Vty.Output.Interface
3232
src/Graphics/Vty/PictureToSpans.hs−2
@@ -13,8 +13,6 @@
1313-- | Transforms an image into rows of operations.
1414module Graphics.Vty.PictureToSpans where
1515
16−import Graphics.Vty.Prelude
17−
1816import Graphics.Vty.Attributes (Attr, currentAttr)
1917import Graphics.Vty.Image
2018import Graphics.Vty.Image.Internal
src/Graphics/Vty/Prelude.hsdeleted−19
@@ -1,19 +0,0 @@
1−-- | Prelude for Vty modules. Not particularly useful outside of Vty.
2−module Graphics.Vty.Prelude
3− ( module Graphics.Vty.Prelude
4− , module Control.Applicative
5− , module Control.Monad
6− )
7−where
8−
9−import Control.Applicative hiding ((<|>))
10−import Control.Monad
11−
12−-- | Named alias for a Int pair
13−type DisplayRegion = (Int,Int)
14−
15−regionWidth :: DisplayRegion -> Int
16−regionWidth = fst
17−
18−regionHeight :: DisplayRegion -> Int
19−regionHeight = snd
src/Graphics/Vty/Span.hs−2
@@ -15,8 +15,6 @@
1515-- to the serialized representation of the various attributes.
1616module Graphics.Vty.Span where
1717
18−import Graphics.Vty.Prelude
19−
2018import Graphics.Vty.Attributes (Attr)
2119import Graphics.Vty.Image
2220import Graphics.Vty.Image.Internal ( clipText )
vty.cabal−1
@@ -73,7 +73,6 @@ library
7373 Graphics.Vty.Input
7474 Graphics.Vty.Input.Events
7575 Graphics.Vty.Picture
76− Graphics.Vty.Prelude
7776 Graphics.Vty.Output
7877 Graphics.Text.Width
7978 -- the modules below are only meant to be used by the tests.