on master help sign in
Update example programs to use new default values
1741b93Jonathan Daugherty
test/BenchImageFuzz.hs+1−3
@@ -8,8 +8,6 @@ import Verify
8import Control.Applicative
8import Control.Applicative
9import Control.Monad
9import Control.Monad
10
10
11−import Data.Default (def)
12−
13import System.Random
11import System.Random
14
12
15rand :: Arbitrary a => IO a
13rand :: Arbitrary a => IO a
@@ -21,7 +19,7 @@ randomImage = rand
21randomPicture = picForImage <$> randomImage
19randomPicture = picForImage <$> randomImage
22
20
23bench0 = do
21bench0 = do
24− vty <- mkVty def
22+ vty <- mkVty defaultConfig
25 (w,h) <- displayBounds $ outputIface vty
23 (w,h) <- displayBounds $ outputIface vty
26 let pictures = replicateM 3000 randomPicture
24 let pictures = replicateM 3000 randomPicture
27 bench ps = do
25 bench ps = do
test/BenchNoDiffOpt.hs+1−2
@@ -9,7 +9,6 @@ import Control.Concurrent( threadDelay )
9import Control.Monad( liftM2 )
9import Control.Monad( liftM2 )
10
10
11import qualified Data.ByteString.Char8 as B
11import qualified Data.ByteString.Char8 as B
12−import Data.Default (def)
13import Data.List
12import Data.List
14
13
15import System.Environment( getArgs )
14import System.Environment( getArgs )
@@ -19,7 +18,7 @@ import System.Random
19bench0 = do
18bench0 = do
20 let fixedGen = mkStdGen 0
19 let fixedGen = mkStdGen 0
21 setStdGen fixedGen
20 setStdGen fixedGen
22− vty <- mkVty def
21+ vty <- mkVty defaultConfig
23 (w,h) <- displayBounds $ outputIface vty
22 (w,h) <- displayBounds $ outputIface vty
24 let images = return $ (image0, image1)
23 let images = return $ (image0, image1)
25 image0 = charFill defAttr 'X' w h
24 image0 = charFill defAttr 'X' w h
test/BenchRenderChar.hs+2−4
@@ -9,10 +9,8 @@ import Verify
9
9
10import Control.Monad ( forM_ )
10import Control.Monad ( forM_ )
11
11
12−import Data.Default (def)
13−
14bench0 = do
12bench0 = do
15− vty <- mkVty def
13+ vty <- mkVty defaultConfig
16 (w,h) <- displayBounds $ outputIface vty
14 (w,h) <- displayBounds $ outputIface vty
17 let testChars = return $ take 500 $ cycle $ [ c | c <- ['a'..'z']]
15 let testChars = return $ take 500 $ cycle $ [ c | c <- ['a'..'z']]
18 bench d = do
16 bench d = do
@@ -28,7 +26,7 @@ testImageUsingChar c w h
28 $ horizCat $ map (char defAttr) (replicate (fromIntegral w) c)
26 $ horizCat $ map (char defAttr) (replicate (fromIntegral w) c)
29
27
30bench1 = do
28bench1 = do
31− vty <- mkVty def
29+ vty <- mkVty defaultConfig
32 (w,h) <- displayBounds $ outputIface vty
30 (w,h) <- displayBounds $ outputIface vty
33 let testChars = return $ take 500 $ cycle $ [ c | c <- ['a'..'z']]
31 let testChars = return $ take 500 $ cycle $ [ c | c <- ['a'..'z']]
34 bench d = do
32 bench d = do
test/BenchVerticalScroll.hs+1−2
@@ -6,7 +6,6 @@ import Verify
6import Control.Concurrent( threadDelay )
6import Control.Concurrent( threadDelay )
7import Control.Monad( liftM2 )
7import Control.Monad( liftM2 )
8
8
9−import Data.Default (def)
10import Data.List
9import Data.List
11import Data.Word
10import Data.Word
12
11
@@ -17,7 +16,7 @@ import System.Random
17bench0 = do
16bench0 = do
18 let fixedGen = mkStdGen 0
17 let fixedGen = mkStdGen 0
19 setStdGen fixedGen
18 setStdGen fixedGen
20− return $ Bench (return ()) (\() -> mkVty def >>= liftM2 (>>) run shutdown)
19+ return $ Bench (return ()) (\() -> mkVty defaultConfig >>= liftM2 (>>) run shutdown)
21
20
22run vt = mapM_ (\p -> update vt p) . benchgen =<< displayBounds (outputIface vt)
21run vt = mapM_ (\p -> update vt p) . benchgen =<< displayBounds (outputIface vt)
23
22
test/EventEcho.hs+1−2
@@ -6,7 +6,6 @@ import Control.Applicative
6import Control.Arrow
6import Control.Arrow
7import Control.Monad.RWS
7import Control.Monad.RWS
8
8
9−import Data.Default (def)
10import Data.Sequence (Seq, (<|) )
9import Data.Sequence (Seq, (<|) )
11import qualified Data.Sequence as Seq
10import qualified Data.Sequence as Seq
12import Data.Foldable
11import Data.Foldable
@@ -16,7 +15,7 @@ eventBufferSize = 1000
16type App = RWST Vty () (Seq String) IO
15type App = RWST Vty () (Seq String) IO
17
16
18main = do
17main = do
19− vty <- mkVty def
18+ vty <- mkVty defaultConfig
20 _ <- execRWST (vtyInteract False) vty Seq.empty
19 _ <- execRWST (vtyInteract False) vty Seq.empty
21 shutdown vty
20 shutdown vty
22
21
test/MinimalExample.hs+1−3
@@ -2,10 +2,8 @@ module Main where
2
2
3import Graphics.Vty
3import Graphics.Vty
4
4
5−import Data.Default
6−
7main = do
5main = do
8− vty <- mkVty def
6+ vty <- mkVty defaultConfig
9 let line0 = string (def `withForeColor` green) "first line"
7 let line0 = string (def `withForeColor` green) "first line"
10 line1 = string (def `withBackColor` blue) "second line"
8 line1 = string (def `withBackColor` blue) "second line"
11 img = line0 <-> line1
9 img = line0 <-> line1
test/Rogue.hs+1−2
@@ -4,7 +4,6 @@ module Main where
4import Graphics.Vty
4import Graphics.Vty
5
5
6import Data.Array
6import Data.Array
7−import Data.Default (def)
8
7
9import Control.Applicative
8import Control.Applicative
10import Control.Monad
9import Control.Monad
@@ -43,7 +42,7 @@ type Coord = (Int, Int)
43
42
44main :: IO ()
43main :: IO ()
45main = do
44main = do
46− vty <- mkVty def
45+ vty <- mkVty defaultConfig
47 level0 <- mkLevel 1
46 level0 <- mkLevel 1
48 let world0 = World (Player (levelStart level0)) level0
47 let world0 = World (Player (levelStart level0)) level0
49 (_finalWorld, ()) <- execRWST play vty world0
48 (_finalWorld, ()) <- execRWST play vty world0
test/interactive_terminal_test.hs+1−2
@@ -12,7 +12,6 @@ import Control.Concurrent (threadDelay)
12import Control.Exception
12import Control.Exception
13import Control.Monad
13import Control.Monad
14
14
15−import Data.Default (def)
16import Data.List ( lookup )
15import Data.List ( lookup )
17import Data.Maybe ( isJust, fromJust )
16import Data.Maybe ( isJust, fromJust )
18import Data.Monoid
17import Data.Monoid
@@ -938,7 +937,7 @@ cursorHideTest0 = Test
938 { testName = "Verify the cursor is hid and re-shown. issue #7"
937 { testName = "Verify the cursor is hid and re-shown. issue #7"
939 , testID = "cursorHideTest0"
938 , testID = "cursorHideTest0"
940 , testAction = do
939 , testAction = do
941− vty <- mkVty def
940+ vty <- mkVty defaultConfig
942 showCursor $ outputIface vty
941 showCursor $ outputIface vty
943 setCursorPos (outputIface vty) 5 5
942 setCursorPos (outputIface vty) 5 5
944 nextEvent vty
943 nextEvent vty