on master help sign in
Package: discontinue support for GHC < 7.10.1
commit700e759c3218992c8f37be07512837a33ca35d50 authorJonathan Daugherty <cygnus@foobox.com> dateSun 22 Jan 2017, 11:05 (10 years ago) parent745f1f6
18 files changed+3−142
.travis.yml+1−2 README.md+2−1 src/Data/Terminfo/Eval.hs−9 src/Data/Terminfo/Parse.hs−9 src/Graphics/Vty/Attributes.hs−9 src/Graphics/Vty/Config.hs−7 src/Graphics/Vty/DisplayAttributes.hs−9 src/Graphics/Vty/Image/Internal.hs−9 src/Graphics/Vty/Inline.hs−10 src/Graphics/Vty/Inline/Unsafe.hs−10 src/Graphics/Vty/Input.hs−10 src/Graphics/Vty/Input/Loop.hs−1 src/Graphics/Vty/Output/Interface.hs−9 src/Graphics/Vty/Output/TerminfoBased.hs−10 src/Graphics/Vty/Output/XTermColor.hs−11 src/Graphics/Vty/PictureToSpans.hs−14 test/Verify.hs−11 test/VerifyUsingMockInput.hs−1
.travis.yml+1−2
@@ -8,10 +8,9 @@ matrix:
88 - env: CABALVER=head GHCVER=head
99
1010env:
11− - CABALVER=1.20 GHCVER=7.6.3
12− - CABALVER=1.20 GHCVER=7.8.3
1311 - CABALVER=1.22 GHCVER=7.10.1
1412 - CABALVER=1.24 GHCVER=8.0.1
13+ - CABALVER=1.24 GHCVER=8.0.2
1514 - CABALVER=head GHCVER=head
1615
1716install:
README.md+2−1
@@ -1,7 +1,8 @@
11[![Build Status](https://travis-ci.org/jtdaugherty/vty.png)](https://travis-ci.org/jtdaugherty/vty)
22
33`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.
56
67Install via `git` with:
78
src/Data/Terminfo/Eval.hs−9
@@ -1,13 +1,8 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE BangPatterns #-}
32{-# LANGUAGE NoMonomorphismRestriction #-}
43{-# OPTIONS_GHC -funbox-strict-fields #-}
54{-# OPTIONS_HADDOCK hide #-}
65
7−#ifndef MIN_VERSION_base
8−#defined MIN_VERSION_base(x,y,z) 1
9−#endif
10−
116-- | Evaluates the paramaterized terminfo string capability with the
127-- given parameters.
138module Data.Terminfo.Eval
@@ -28,10 +23,6 @@ import Data.List
2823
2924import qualified Data.Vector.Unboxed as Vector
3025
31−#if !(MIN_VERSION_base(4,8,0))
32−import Data.Word
33−#endif
34−
3526-- | capability evaluator state
3627data EvalState = EvalState
3728 { evalStack :: ![CapParam]
src/Data/Terminfo/Parse.hs−9
@@ -1,14 +1,9 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE BangPatterns #-}
32{-# OPTIONS_HADDOCK hide #-}
43{-# LANGUAGE NoMonomorphismRestriction #-}
54{-# LANGUAGE NamedFieldPuns #-}
65{-# OPTIONS_GHC -funbox-strict-fields -O #-}
76
8−#ifndef MIN_VERSION_base
9−#defined MIN_VERSION_base(x,y,z) 1
10−#endif
11−
127module Data.Terminfo.Parse
138 ( module Data.Terminfo.Parse
149 , Text.Parsec.ParseError
@@ -25,10 +20,6 @@ import Numeric (showHex)
2520
2621import Text.Parsec
2722
28−#if !(MIN_VERSION_base(4,8,0))
29−import Data.Monoid
30−#endif
31−
3223data CapExpression = CapExpression
3324 { capOps :: !CapOps
3425 , capBytes :: !(Vector.Vector Word8)
src/Graphics/Vty/Attributes.hs−9
@@ -1,12 +1,7 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE StandaloneDeriving #-}
32{-# LANGUAGE GADTs #-}
43{-# LANGUAGE RankNTypes #-}
54
6−#ifndef MIN_VERSION_base
7−#defined MIN_VERSION_base(x,y,z) 1
8−#endif
9−
105-- | Display attributes
116--
127-- Typically the values 'defAttr' or 'currentAttr' are modified to form
@@ -47,10 +42,6 @@ import Data.Word
4742import Graphics.Vty.Attributes.Color
4843import Graphics.Vty.Attributes.Color240
4944
50−#if !(MIN_VERSION_base(4,8,0))
51−import Data.Monoid
52−#endif
53−
5445-- | A display attribute defines the Color and Style of all the
5546-- characters rendered after the attribute is applied.
5647--
src/Graphics/Vty/Config.hs−7
@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE DeriveDataTypeable #-}
32{-# LANGUAGE FlexibleContexts, FlexibleInstances #-}
43{-# LANGUAGE TypeOperators #-}
@@ -80,11 +79,7 @@ module Graphics.Vty.Config
8079 )
8180where
8281
83−#if __GLASGOW_HASKELL__ > 704
8482import Prelude
85−#else
86−import Prelude hiding (catch)
87−#endif
8883
8984import Control.Applicative hiding (many)
9085
@@ -115,9 +110,7 @@ data VtyConfigurationError
115110 deriving (Show, Eq, Typeable)
116111
117112instance Exception VtyConfigurationError where
118−#if MIN_VERSION_base(4,8,0)
119113 displayException VtyMissingTermEnvVar = "TERM environment variable not set"
120−#endif
121114
122115-- | Mappings from input bytes to event in the order specified. Later
123116-- entries take precedence over earlier in the case multiple entries
src/Graphics/Vty/DisplayAttributes.hs−9
@@ -1,21 +1,12 @@
11-- Copyright 2009-2010 Corey O'Connor
2−{-# LANGUAGE CPP #-}
32{-# LANGUAGE BangPatterns #-}
43
5−#ifndef MIN_VERSION_base
6−#defined MIN_VERSION_base(x,y,z) 1
7−#endif
8−
94module Graphics.Vty.DisplayAttributes where
105
116import Graphics.Vty.Attributes
127
138import Data.Bits ((.&.))
149
15−#if !(MIN_VERSION_base(4,8,0))
16−import Data.Monoid (Monoid(..), mconcat)
17−#endif
18−
1910-- | Given the previously applied display attributes as a FixedAttr and
2011-- the current display attributes as an Attr produces a FixedAttr that
2112-- 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 #-}
21{-# LANGUAGE NamedFieldPuns #-}
32{-# LANGUAGE DeriveGeneric #-}
43{-# OPTIONS_HADDOCK hide #-}
54
6−#ifndef MIN_VERSION_base
7−#defined MIN_VERSION_base(x,y,z) 1
8−#endif
9−
105module Graphics.Vty.Image.Internal where
116
127import Graphics.Vty.Attributes
@@ -18,10 +13,6 @@ import Control.DeepSeq
1813
1914import qualified Data.Text.Lazy as TL
2015
21−#if !(MIN_VERSION_base(4,8,0))
22−import Data.Monoid
23−#endif
24−
2516-- | A display text is a Data.Text.Lazy
2617type DisplayText = TL.Text
2718
src/Graphics/Vty/Inline.hs−10
@@ -1,10 +1,5 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE BangPatterns #-}
32
4−#ifndef MIN_VERSION_base
5−#defined MIN_VERSION_base(x,y,z) 1
6−#endif
7−
83-- | The inline module provides a limited interface to changing the
94-- style of terminal output. The intention is for this interface to be
105-- used inline with other output systems.
@@ -53,11 +48,6 @@ import Data.IORef
5348
5449import System.IO
5550
56−#if !(MIN_VERSION_base(4,8,0))
57−import Control.Applicative
58−import Data.Monoid ( mappend )
59−#endif
60−
6151type InlineM v = State Attr v
6252
6353-- | Set the background color to the provided 'Color'
src/Graphics/Vty/Inline/Unsafe.hs−10
@@ -1,16 +1,10 @@
1−{-# LANGUAGE CPP #-}
21{-# OPTIONS_HADDOCK hide #-}
32
4−#ifndef MIN_VERSION_base
5−#defined MIN_VERSION_base(x,y,z) 1
6−#endif
7−
83module Graphics.Vty.Inline.Unsafe where
94
105import Graphics.Vty
116
127import Data.Default
13−import Data.Monoid
148import Data.IORef
159
1610import GHC.IO.Handle (hDuplicate)
@@ -21,10 +15,6 @@ import System.IO.Unsafe
2115
2216import System.Posix.IO (handleToFd)
2317
24−#if !(MIN_VERSION_base(4,8,0))
25−import Control.Applicative
26−#endif
27−
2818globalVty :: IORef (Maybe Vty)
2919{-# NOINLINE globalVty #-}
3020globalVty = unsafePerformIO $ newIORef Nothing
src/Graphics/Vty/Input.hs−10
@@ -1,10 +1,5 @@
1−{-# LANGUAGE CPP #-}
21{-# LANGUAGE RecordWildCards #-}
32
4−#ifndef MIN_VERSION_base
5−#defined MIN_VERSION_base(x,y,z) 1
6−#endif
7−
83-- | The input layer for VTY. This provides methods for initializing an
94-- 'Input' structure which can then be used to read 'Event's from the
105-- terminal.
@@ -163,12 +158,7 @@ import Lens.Micro
163158import qualified System.Console.Terminfo as Terminfo
164159import System.Posix.Signals.Exts
165160
166−#if !(MIN_VERSION_base(4,8,0))
167−import Data.Functor ((<$>))
168−import Data.Monoid
169−#else
170161import Data.Monoid ((<>))
171−#endif
172162
173163-- | Set up the terminal with file descriptor `inputFd` for input.
174164-- Returns a 'Input'.
src/Graphics/Vty/Input/Loop.hs−1
@@ -24,7 +24,6 @@ import Control.Applicative
2424import Control.Concurrent
2525import Control.Concurrent.STM
2626import Control.Exception (mask, try, SomeException)
27−import Data.Monoid
2827import Lens.Micro
2928import Lens.Micro.Mtl
3029import Lens.Micro.TH
src/Graphics/Vty/Output/Interface.hs−9
@@ -1,16 +1,11 @@
11-- Copyright Corey O'Connor
22-- General philosophy is: MonadIO is for equations exposed to clients.
3−{-# LANGUAGE CPP #-}
43{-# LANGUAGE BangPatterns #-}
54{-# LANGUAGE RankNTypes #-}
65{-# LANGUAGE ExistentialQuantification #-}
76{-# LANGUAGE GADTs #-}
87{-# LANGUAGE FlexibleContexts #-}
98
10−#ifndef MIN_VERSION_base
11−#defined MIN_VERSION_base(x,y,z) 1
12−#endif
13−
149module Graphics.Vty.Output.Interface
1510 ( Output(..)
1611 , AssumedState(..)
@@ -42,10 +37,6 @@ import qualified Data.Text.Encoding as T
4237import qualified Data.Text.Lazy as TL
4338import qualified Data.Vector as Vector
4439
45−#if !(MIN_VERSION_base(4,8,0))
46−import Data.Monoid (mempty, mappend)
47−#endif
48−
4940-- | Modal terminal features that can be enabled and disabled.
5041data Mode = Mouse
5142 | BracketedPaste
src/Graphics/Vty/Output/TerminfoBased.hs−10
@@ -1,13 +1,8 @@
11{-# LANGUAGE RecordWildCards #-}
2−{-# LANGUAGE CPP #-}
32{-# LANGUAGE FlexibleInstances #-}
43{-# OPTIONS_GHC -D_XOPEN_SOURCE=500 -fno-warn-warnings-deprecations #-}
54{-# CFILES gwinsz.c #-}
65
7−#ifndef MIN_VERSION_base
8−#defined MIN_VERSION_base(x,y,z) 1
9−#endif
10−
116-- | Terminfo based terminal handling.
127--
138-- The color handling assumes tektronix like. No HP support provided. If
@@ -47,11 +42,6 @@ import qualified System.Console.Terminfo as Terminfo
4742import System.Posix.IO (fdWriteBuf)
4843import System.Posix.Types (Fd(..))
4944
50−#if !(MIN_VERSION_base(4,8,0))
51−import Data.Foldable (foldMap)
52−import Data.Monoid
53−#endif
54−
5545data TerminfoCaps = TerminfoCaps
5646 { smcup :: Maybe CapExpression
5747 , 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−
71-- Copyright 2009-2010 Corey O'Connor
82module Graphics.Vty.Output.XTermColor
93 ( reserveTerminal
@@ -25,11 +19,6 @@ import System.Posix.IO (fdWrite)
2519import System.Posix.Types (Fd)
2620import System.Posix.Env (getEnv)
2721
28−#if !(MIN_VERSION_base(4,8,0))
29−import Control.Applicative
30−import Data.Foldable (foldMap)
31−#endif
32−
3322import Data.List (isInfixOf)
3423import Data.Maybe (catMaybes)
3524import Data.Monoid ((<>))
src/Graphics/Vty/PictureToSpans.hs−14
@@ -1,15 +1,10 @@
11-- Copyright Corey O'Connor<coreyoconnor@gmail.com>
22{-# LANGUAGE BangPatterns #-}
3−{-# LANGUAGE CPP #-}
43{-# LANGUAGE ExistentialQuantification #-}
54{-# LANGUAGE NamedFieldPuns #-}
65{-# LANGUAGE RankNTypes #-}
76{-# LANGUAGE TemplateHaskell #-}
87
9−#ifndef MIN_VERSION_base
10−#defined MIN_VERSION_base(x,y,z) 1
11−#endif
12−
138-- | Transforms an image into rows of operations.
149module Graphics.Vty.PictureToSpans where
1510
@@ -24,12 +19,7 @@ import Lens.Micro.Mtl
2419import Lens.Micro.TH
2520import Control.Monad.Reader
2621import Control.Monad.State.Strict hiding ( state )
27−
28−#if __GLASGOW_HASKELL__ < 708
29−import Control.Monad.ST.Strict hiding ( unsafeIOToST )
30−#else
3122import Control.Monad.ST.Strict
32−#endif
3323
3424import qualified Data.Vector as Vector hiding ( take, replicate )
3525import Data.Vector.Mutable ( MVector(..))
@@ -37,10 +27,6 @@ import qualified Data.Vector.Mutable as MVector
3727
3828import qualified Data.Text.Lazy as TL
3929
40−#if !(MIN_VERSION_base(4,8,0))
41−import Data.Monoid (mappend)
42−#endif
43−
4430type MRowOps s = MVector s SpanOps
4531
4632type MSpanOps s = MVector s SpanOp
test/Verify.hs−11
@@ -1,7 +1,6 @@
11{-# LANGUAGE RankNTypes #-}
22{-# LANGUAGE GADTs #-}
33{-# LANGUAGE RecordWildCards #-}
4−{-# LANGUAGE CPP #-}
54{-# LANGUAGE TypeSynonymInstances #-}
65{-# LANGUAGE FlexibleInstances #-}
76{-# LANGUAGE StandaloneDeriving #-}
@@ -86,15 +85,5 @@ instance Arbitrary DoubleColumnChar where
8685liftIOResult :: Testable prop => IO prop -> Property
8786liftIOResult = ioProperty
8887
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−
9988data Bench where
10089 Bench :: forall v . NFData v => IO v -> (v -> IO ()) -> Bench
test/VerifyUsingMockInput.hs−1
@@ -11,7 +11,6 @@ import Graphics.Vty.Input.Events
1111import Graphics.Vty.Input.Loop
1212import Graphics.Vty.Input.Terminfo
1313
14−import Control.Applicative
1514import Control.Concurrent
1615import Control.Concurrent.STM
1716import Control.Exception