on master help sign in
Package: discontinue support for GHC < 7.10.1
700e759Jonathan Daugherty
.travis.yml+1−2
@@ -8,10 +8,9 @@ matrix:
8 - env: CABALVER=head GHCVER=head
8 - env: CABALVER=head GHCVER=head
9
9
10env:
10env:
11− - CABALVER=1.20 GHCVER=7.6.3
12− - CABALVER=1.20 GHCVER=7.8.3
13 - CABALVER=1.22 GHCVER=7.10.1
11 - CABALVER=1.22 GHCVER=7.10.1
14 - CABALVER=1.24 GHCVER=8.0.1
12 - CABALVER=1.24 GHCVER=8.0.1
13+ - CABALVER=1.24 GHCVER=8.0.2
15 - CABALVER=head GHCVER=head
14 - CABALVER=head GHCVER=head
16
15
17install:
16install:
README.md+2−1
@@ -1,7 +1,8 @@
1[![Build Status](https://travis-ci.org/jtdaugherty/vty.png)](https://travis-ci.org/jtdaugherty/vty)
1[![Build Status](https://travis-ci.org/jtdaugherty/vty.png)](https://travis-ci.org/jtdaugherty/vty)
2
2
3`vty` is a terminal interface library. It provides a high-level
3`vty` is a terminal interface library. It provides a high-level
4−interface for doing terminal I/O.
4+interface for doing terminal I/O. Vty is supported on GHC versions
5+7.10.1 and up.
5
6
6Install via `git` with:
7Install via `git` with:
7
8
src/Data/Terminfo/Eval.hs−9
@@ -1,13 +1,8 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE BangPatterns #-}
1{-# LANGUAGE BangPatterns #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
2{-# LANGUAGE NoMonomorphismRestriction #-}
4{-# OPTIONS_GHC -funbox-strict-fields #-}
3{-# OPTIONS_GHC -funbox-strict-fields #-}
5{-# OPTIONS_HADDOCK hide #-}
4{-# OPTIONS_HADDOCK hide #-}
6
5
7−#ifndef MIN_VERSION_base
8−#defined MIN_VERSION_base(x,y,z) 1
9−#endif
10−
11-- | Evaluates the paramaterized terminfo string capability with the
6-- | Evaluates the paramaterized terminfo string capability with the
12-- given parameters.
7-- given parameters.
13module Data.Terminfo.Eval
8module Data.Terminfo.Eval
@@ -28,10 +23,6 @@ import Data.List
28
23
29import qualified Data.Vector.Unboxed as Vector
24import qualified Data.Vector.Unboxed as Vector
30
25
31−#if !(MIN_VERSION_base(4,8,0))
32−import Data.Word
33−#endif
34−
35-- | capability evaluator state
26-- | capability evaluator state
36data EvalState = EvalState
27data EvalState = EvalState
37 { evalStack :: ![CapParam]
28 { evalStack :: ![CapParam]
src/Data/Terminfo/Parse.hs−9
@@ -1,14 +1,9 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE BangPatterns #-}
1{-# LANGUAGE BangPatterns #-}
3{-# OPTIONS_HADDOCK hide #-}
2{-# OPTIONS_HADDOCK hide #-}
4{-# LANGUAGE NoMonomorphismRestriction #-}
3{-# LANGUAGE NoMonomorphismRestriction #-}
5{-# LANGUAGE NamedFieldPuns #-}
4{-# LANGUAGE NamedFieldPuns #-}
6{-# OPTIONS_GHC -funbox-strict-fields -O #-}
5{-# OPTIONS_GHC -funbox-strict-fields -O #-}
7
6
8−#ifndef MIN_VERSION_base
9−#defined MIN_VERSION_base(x,y,z) 1
10−#endif
11−
12module Data.Terminfo.Parse
7module Data.Terminfo.Parse
13 ( module Data.Terminfo.Parse
8 ( module Data.Terminfo.Parse
14 , Text.Parsec.ParseError
9 , Text.Parsec.ParseError
@@ -25,10 +20,6 @@ import Numeric (showHex)
25
20
26import Text.Parsec
21import Text.Parsec
27
22
28−#if !(MIN_VERSION_base(4,8,0))
29−import Data.Monoid
30−#endif
31−
32data CapExpression = CapExpression
23data CapExpression = CapExpression
33 { capOps :: !CapOps
24 { capOps :: !CapOps
34 , capBytes :: !(Vector.Vector Word8)
25 , capBytes :: !(Vector.Vector Word8)
src/Graphics/Vty/Attributes.hs−9
@@ -1,12 +1,7 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE StandaloneDeriving #-}
1{-# LANGUAGE StandaloneDeriving #-}
3{-# LANGUAGE GADTs #-}
2{-# LANGUAGE GADTs #-}
4{-# LANGUAGE RankNTypes #-}
3{-# LANGUAGE RankNTypes #-}
5
4
6−#ifndef MIN_VERSION_base
7−#defined MIN_VERSION_base(x,y,z) 1
8−#endif
9−
10-- | Display attributes
5-- | Display attributes
11--
6--
12-- Typically the values 'defAttr' or 'currentAttr' are modified to form
7-- Typically the values 'defAttr' or 'currentAttr' are modified to form
@@ -47,10 +42,6 @@ import Data.Word
47import Graphics.Vty.Attributes.Color
42import Graphics.Vty.Attributes.Color
48import Graphics.Vty.Attributes.Color240
43import Graphics.Vty.Attributes.Color240
49
44
50−#if !(MIN_VERSION_base(4,8,0))
51−import Data.Monoid
52−#endif
53−
54-- | A display attribute defines the Color and Style of all the
45-- | A display attribute defines the Color and Style of all the
55-- characters rendered after the attribute is applied.
46-- characters rendered after the attribute is applied.
56--
47--
src/Graphics/Vty/Config.hs−7
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE DeriveDataTypeable #-}
1{-# LANGUAGE DeriveDataTypeable #-}
3{-# LANGUAGE FlexibleContexts, FlexibleInstances #-}
2{-# LANGUAGE FlexibleContexts, FlexibleInstances #-}
4{-# LANGUAGE TypeOperators #-}
3{-# LANGUAGE TypeOperators #-}
@@ -80,11 +79,7 @@ module Graphics.Vty.Config
80 )
79 )
81where
80where
82
81
83−#if __GLASGOW_HASKELL__ > 704
84import Prelude
82import Prelude
85−#else
86−import Prelude hiding (catch)
87−#endif
88
83
89import Control.Applicative hiding (many)
84import Control.Applicative hiding (many)
90
85
@@ -115,9 +110,7 @@ data VtyConfigurationError
115 deriving (Show, Eq, Typeable)
110 deriving (Show, Eq, Typeable)
116
111
117instance Exception VtyConfigurationError where
112instance Exception VtyConfigurationError where
118−#if MIN_VERSION_base(4,8,0)
119 displayException VtyMissingTermEnvVar = "TERM environment variable not set"
113 displayException VtyMissingTermEnvVar = "TERM environment variable not set"
120−#endif
121
114
122-- | Mappings from input bytes to event in the order specified. Later
115-- | Mappings from input bytes to event in the order specified. Later
123-- entries take precedence over earlier in the case multiple entries
116-- entries take precedence over earlier in the case multiple entries
src/Graphics/Vty/DisplayAttributes.hs−9
@@ -1,21 +1,12 @@
1-- Copyright 2009-2010 Corey O'Connor
1-- Copyright 2009-2010 Corey O'Connor
2−{-# LANGUAGE CPP #-}
3{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE BangPatterns #-}
4
3
5−#ifndef MIN_VERSION_base
6−#defined MIN_VERSION_base(x,y,z) 1
7−#endif
8−
9module Graphics.Vty.DisplayAttributes where
4module Graphics.Vty.DisplayAttributes where
10
5
11import Graphics.Vty.Attributes
6import Graphics.Vty.Attributes
12
7
13import Data.Bits ((.&.))
8import Data.Bits ((.&.))
14
9
15−#if !(MIN_VERSION_base(4,8,0))
16−import Data.Monoid (Monoid(..), mconcat)
17−#endif
18−
19-- | Given the previously applied display attributes as a FixedAttr and
10-- | Given the previously applied display attributes as a FixedAttr and
20-- the current display attributes as an Attr produces a FixedAttr that
11-- the current display attributes as an Attr produces a FixedAttr that
21-- represents the current display attributes. This is done by using the
12-- represents the current display attributes. This is done by using the
src/Graphics/Vty/Image/Internal.hs−9
@@ -1,12 +1,7 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE NamedFieldPuns #-}
1{-# LANGUAGE NamedFieldPuns #-}
3{-# LANGUAGE DeriveGeneric #-}
2{-# LANGUAGE DeriveGeneric #-}
4{-# OPTIONS_HADDOCK hide #-}
3{-# OPTIONS_HADDOCK hide #-}
5
4
6−#ifndef MIN_VERSION_base
7−#defined MIN_VERSION_base(x,y,z) 1
8−#endif
9−
10module Graphics.Vty.Image.Internal where
5module Graphics.Vty.Image.Internal where
11
6
12import Graphics.Vty.Attributes
7import Graphics.Vty.Attributes
@@ -18,10 +13,6 @@ import Control.DeepSeq
18
13
19import qualified Data.Text.Lazy as TL
14import qualified Data.Text.Lazy as TL
20
15
21−#if !(MIN_VERSION_base(4,8,0))
22−import Data.Monoid
23−#endif
24−
25-- | A display text is a Data.Text.Lazy
16-- | A display text is a Data.Text.Lazy
26type DisplayText = TL.Text
17type DisplayText = TL.Text
27
18
src/Graphics/Vty/Inline.hs−10
@@ -1,10 +1,5 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE BangPatterns #-}
1{-# LANGUAGE BangPatterns #-}
3
2
4−#ifndef MIN_VERSION_base
5−#defined MIN_VERSION_base(x,y,z) 1
6−#endif
7−
8-- | The inline module provides a limited interface to changing the
3-- | The inline module provides a limited interface to changing the
9-- style of terminal output. The intention is for this interface to be
4-- style of terminal output. The intention is for this interface to be
10-- used inline with other output systems.
5-- used inline with other output systems.
@@ -53,11 +48,6 @@ import Data.IORef
53
48
54import System.IO
49import System.IO
55
50
56−#if !(MIN_VERSION_base(4,8,0))
57−import Control.Applicative
58−import Data.Monoid ( mappend )
59−#endif
60−
61type InlineM v = State Attr v
51type InlineM v = State Attr v
62
52
63-- | Set the background color to the provided 'Color'
53-- | Set the background color to the provided 'Color'
src/Graphics/Vty/Inline/Unsafe.hs−10
@@ -1,16 +1,10 @@
1−{-# LANGUAGE CPP #-}
2{-# OPTIONS_HADDOCK hide #-}
1{-# OPTIONS_HADDOCK hide #-}
3
2
4−#ifndef MIN_VERSION_base
5−#defined MIN_VERSION_base(x,y,z) 1
6−#endif
7−
8module Graphics.Vty.Inline.Unsafe where
3module Graphics.Vty.Inline.Unsafe where
9
4
10import Graphics.Vty
5import Graphics.Vty
11
6
12import Data.Default
7import Data.Default
13−import Data.Monoid
14import Data.IORef
8import Data.IORef
15
9
16import GHC.IO.Handle (hDuplicate)
10import GHC.IO.Handle (hDuplicate)
@@ -21,10 +15,6 @@ import System.IO.Unsafe
21
15
22import System.Posix.IO (handleToFd)
16import System.Posix.IO (handleToFd)
23
17
24−#if !(MIN_VERSION_base(4,8,0))
25−import Control.Applicative
26−#endif
27−
28globalVty :: IORef (Maybe Vty)
18globalVty :: IORef (Maybe Vty)
29{-# NOINLINE globalVty #-}
19{-# NOINLINE globalVty #-}
30globalVty = unsafePerformIO $ newIORef Nothing
20globalVty = unsafePerformIO $ newIORef Nothing
src/Graphics/Vty/Input.hs−10
@@ -1,10 +1,5 @@
1−{-# LANGUAGE CPP #-}
2{-# LANGUAGE RecordWildCards #-}
1{-# LANGUAGE RecordWildCards #-}
3
2
4−#ifndef MIN_VERSION_base
5−#defined MIN_VERSION_base(x,y,z) 1
6−#endif
7−
8-- | The input layer for VTY. This provides methods for initializing an
3-- | The input layer for VTY. This provides methods for initializing an
9-- 'Input' structure which can then be used to read 'Event's from the
4-- 'Input' structure which can then be used to read 'Event's from the
10-- terminal.
5-- terminal.
@@ -163,12 +158,7 @@ import Lens.Micro
163import qualified System.Console.Terminfo as Terminfo
158import qualified System.Console.Terminfo as Terminfo
164import System.Posix.Signals.Exts
159import System.Posix.Signals.Exts
165
160
166−#if !(MIN_VERSION_base(4,8,0))
167−import Data.Functor ((<$>))
168−import Data.Monoid
169−#else
170import Data.Monoid ((<>))
161import Data.Monoid ((<>))
171−#endif
172
162
173-- | Set up the terminal with file descriptor `inputFd` for input.
163-- | Set up the terminal with file descriptor `inputFd` for input.
174-- Returns a 'Input'.
164-- Returns a 'Input'.
src/Graphics/Vty/Input/Loop.hs−1
@@ -24,7 +24,6 @@ import Control.Applicative
24import Control.Concurrent
24import Control.Concurrent
25import Control.Concurrent.STM
25import Control.Concurrent.STM
26import Control.Exception (mask, try, SomeException)
26import Control.Exception (mask, try, SomeException)
27−import Data.Monoid
28import Lens.Micro
27import Lens.Micro
29import Lens.Micro.Mtl
28import Lens.Micro.Mtl
30import Lens.Micro.TH
29import Lens.Micro.TH
src/Graphics/Vty/Output/Interface.hs−9
@@ -1,16 +1,11 @@
1-- Copyright Corey O'Connor
1-- Copyright Corey O'Connor
2-- General philosophy is: MonadIO is for equations exposed to clients.
2-- General philosophy is: MonadIO is for equations exposed to clients.
3−{-# LANGUAGE CPP #-}
4{-# LANGUAGE BangPatterns #-}
3{-# LANGUAGE BangPatterns #-}
5{-# LANGUAGE RankNTypes #-}
4{-# LANGUAGE RankNTypes #-}
6{-# LANGUAGE ExistentialQuantification #-}
5{-# LANGUAGE ExistentialQuantification #-}
7{-# LANGUAGE GADTs #-}
6{-# LANGUAGE GADTs #-}
8{-# LANGUAGE FlexibleContexts #-}
7{-# LANGUAGE FlexibleContexts #-}
9
8
10−#ifndef MIN_VERSION_base
11−#defined MIN_VERSION_base(x,y,z) 1
12−#endif
13−
14module Graphics.Vty.Output.Interface
9module Graphics.Vty.Output.Interface
15 ( Output(..)
10 ( Output(..)
16 , AssumedState(..)
11 , AssumedState(..)
@@ -42,10 +37,6 @@ import qualified Data.Text.Encoding as T
42import qualified Data.Text.Lazy as TL
37import qualified Data.Text.Lazy as TL
43import qualified Data.Vector as Vector
38import qualified Data.Vector as Vector
44
39
45−#if !(MIN_VERSION_base(4,8,0))
46−import Data.Monoid (mempty, mappend)
47−#endif
48−
49-- | Modal terminal features that can be enabled and disabled.
40-- | Modal terminal features that can be enabled and disabled.
50data Mode = Mouse
41data Mode = Mouse
51 | BracketedPaste
42 | BracketedPaste
src/Graphics/Vty/Output/TerminfoBased.hs−10
@@ -1,13 +1,8 @@
1{-# LANGUAGE RecordWildCards #-}
1{-# LANGUAGE RecordWildCards #-}
2−{-# LANGUAGE CPP #-}
3{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
4{-# OPTIONS_GHC -D_XOPEN_SOURCE=500 -fno-warn-warnings-deprecations #-}
3{-# OPTIONS_GHC -D_XOPEN_SOURCE=500 -fno-warn-warnings-deprecations #-}
5{-# CFILES gwinsz.c #-}
4{-# CFILES gwinsz.c #-}
6
5
7−#ifndef MIN_VERSION_base
8−#defined MIN_VERSION_base(x,y,z) 1
9−#endif
10−
11-- | Terminfo based terminal handling.
6-- | Terminfo based terminal handling.
12--
7--
13-- The color handling assumes tektronix like. No HP support provided. If
8-- The color handling assumes tektronix like. No HP support provided. If
@@ -47,11 +42,6 @@ import qualified System.Console.Terminfo as Terminfo
47import System.Posix.IO (fdWriteBuf)
42import System.Posix.IO (fdWriteBuf)
48import System.Posix.Types (Fd(..))
43import System.Posix.Types (Fd(..))
49
44
50−#if !(MIN_VERSION_base(4,8,0))
51−import Data.Foldable (foldMap)
52−import Data.Monoid
53−#endif
54−
55data TerminfoCaps = TerminfoCaps
45data TerminfoCaps = TerminfoCaps
56 { smcup :: Maybe CapExpression
46 { smcup :: Maybe CapExpression
57 , rmcup :: Maybe CapExpression
47 , rmcup :: Maybe CapExpression
src/Graphics/Vty/Output/XTermColor.hs−11
@@ -1,9 +1,3 @@
1−{-# LANGUAGE CPP #-}
2−
3−#ifndef MIN_VERSION_base
4−#defined MIN_VERSION_base(x,y,z) 1
5−#endif
6−
7-- Copyright 2009-2010 Corey O'Connor
1-- Copyright 2009-2010 Corey O'Connor
8module Graphics.Vty.Output.XTermColor
2module Graphics.Vty.Output.XTermColor
9 ( reserveTerminal
3 ( reserveTerminal
@@ -25,11 +19,6 @@ import System.Posix.IO (fdWrite)
25import System.Posix.Types (Fd)
19import System.Posix.Types (Fd)
26import System.Posix.Env (getEnv)
20import System.Posix.Env (getEnv)
27
21
28−#if !(MIN_VERSION_base(4,8,0))
29−import Control.Applicative
30−import Data.Foldable (foldMap)
31−#endif
32−
33import Data.List (isInfixOf)
22import Data.List (isInfixOf)
34import Data.Maybe (catMaybes)
23import Data.Maybe (catMaybes)
35import Data.Monoid ((<>))
24import Data.Monoid ((<>))
src/Graphics/Vty/PictureToSpans.hs−14
@@ -1,15 +1,10 @@
1-- Copyright Corey O'Connor<coreyoconnor@gmail.com>
1-- Copyright Corey O'Connor<coreyoconnor@gmail.com>
2{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE BangPatterns #-}
3−{-# LANGUAGE CPP #-}
4{-# LANGUAGE ExistentialQuantification #-}
3{-# LANGUAGE ExistentialQuantification #-}
5{-# LANGUAGE NamedFieldPuns #-}
4{-# LANGUAGE NamedFieldPuns #-}
6{-# LANGUAGE RankNTypes #-}
5{-# LANGUAGE RankNTypes #-}
7{-# LANGUAGE TemplateHaskell #-}
6{-# LANGUAGE TemplateHaskell #-}
8
7
9−#ifndef MIN_VERSION_base
10−#defined MIN_VERSION_base(x,y,z) 1
11−#endif
12−
13-- | Transforms an image into rows of operations.
8-- | Transforms an image into rows of operations.
14module Graphics.Vty.PictureToSpans where
9module Graphics.Vty.PictureToSpans where
15
10
@@ -24,12 +19,7 @@ import Lens.Micro.Mtl
24import Lens.Micro.TH
19import Lens.Micro.TH
25import Control.Monad.Reader
20import Control.Monad.Reader
26import Control.Monad.State.Strict hiding ( state )
21import Control.Monad.State.Strict hiding ( state )
27−
28−#if __GLASGOW_HASKELL__ < 708
29−import Control.Monad.ST.Strict hiding ( unsafeIOToST )
30−#else
31import Control.Monad.ST.Strict
22import Control.Monad.ST.Strict
32−#endif
33
23
34import qualified Data.Vector as Vector hiding ( take, replicate )
24import qualified Data.Vector as Vector hiding ( take, replicate )
35import Data.Vector.Mutable ( MVector(..))
25import Data.Vector.Mutable ( MVector(..))
@@ -37,10 +27,6 @@ import qualified Data.Vector.Mutable as MVector
37
27
38import qualified Data.Text.Lazy as TL
28import qualified Data.Text.Lazy as TL
39
29
40−#if !(MIN_VERSION_base(4,8,0))
41−import Data.Monoid (mappend)
42−#endif
43−
44type MRowOps s = MVector s SpanOps
30type MRowOps s = MVector s SpanOps
45
31
46type MSpanOps s = MVector s SpanOp
32type MSpanOps s = MVector s SpanOp
test/Verify.hs−11
@@ -1,7 +1,6 @@
1{-# LANGUAGE RankNTypes #-}
1{-# LANGUAGE RankNTypes #-}
2{-# LANGUAGE GADTs #-}
2{-# LANGUAGE GADTs #-}
3{-# LANGUAGE RecordWildCards #-}
3{-# LANGUAGE RecordWildCards #-}
4−{-# LANGUAGE CPP #-}
5{-# LANGUAGE TypeSynonymInstances #-}
4{-# LANGUAGE TypeSynonymInstances #-}
6{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FlexibleInstances #-}
7{-# LANGUAGE StandaloneDeriving #-}
6{-# LANGUAGE StandaloneDeriving #-}
@@ -86,15 +85,5 @@ instance Arbitrary DoubleColumnChar where
86liftIOResult :: Testable prop => IO prop -> Property
85liftIOResult :: Testable prop => IO prop -> Property
87liftIOResult = ioProperty
86liftIOResult = ioProperty
88
87
89−#if __GLASGOW_HASKELL__ <= 701
90−instance Random Word where
91− random g =
92− let (i :: Int, g') = random g
93− in (toEnum i, g')
94− randomR (l,h) g =
95− let (i :: Int, g') = randomR (fromEnum l,fromEnum h) g
96− in (toEnum i, g')
97−#endif
98−
99data Bench where
88data Bench where
100 Bench :: forall v . NFData v => IO v -> (v -> IO ()) -> Bench
89 Bench :: forall v . NFData v => IO v -> (v -> IO ()) -> Bench
test/VerifyUsingMockInput.hs−1
@@ -11,7 +11,6 @@ import Graphics.Vty.Input.Events
11import Graphics.Vty.Input.Loop
11import Graphics.Vty.Input.Loop
12import Graphics.Vty.Input.Terminfo
12import Graphics.Vty.Input.Terminfo
13
13
14−import Control.Applicative
15import Control.Concurrent
14import Control.Concurrent
16import Control.Concurrent.STM
15import Control.Concurrent.STM
17import Control.Exception
16import Control.Exception