| 1 |
{-# LANGUAGE CPP #-} |
| 2 |
{-# LANGUAGE DeriveDataTypeable #-} |
| 3 |
{-# LANGUAGE DeriveFoldable #-} |
| 4 |
{-# LANGUAGE DeriveFunctor #-} |
| 5 |
{-# LANGUAGE DeriveTraversable #-} |
| 6 |
|
| 7 |
#if __GLASGOW_HASKELL__ >= 702 |
| 8 |
#define LANGUAGE_DeriveGeneric |
| 9 |
{-# LANGUAGE DeriveGeneric #-} |
| 10 |
#endif |
| 11 |
|
| 12 |
module System.Console.Terminal.Common |
| 13 |
( Window(..) |
| 14 |
) where |
| 15 |
|
| 16 |
import Data.Data (Typeable, Data) |
| 17 |
|
| 18 |
#if __GLASGOW_HASKELL__ < 710 |
| 19 |
import Data.Foldable (Foldable) |
| 20 |
import Data.Traversable (Traversable) |
| 21 |
#endif |
| 22 |
|
| 23 |
#ifdef LANGUAGE_DeriveGeneric |
| 24 |
import GHC.Generics |
| 25 |
( Generic |
| 26 |
#if __GLASGOW_HASKELL__ >= 706 |
| 27 |
, Generic1 |
| 28 |
#endif |
| 29 |
) |
| 30 |
#endif |
| 31 |
|
| 32 |
-- | Terminal window width and height |
| 33 |
data Window a = Window |
| 34 |
{ height :: !a |
| 35 |
, width :: !a |
| 36 |
} deriving |
| 37 |
( Show, Eq, Read, Data, Typeable |
| 38 |
, Foldable, Functor, Traversable |
| 39 |
#ifdef LANGUAGE_DeriveGeneric |
| 40 |
, Generic |
| 41 |
#if __GLASGOW_HASKELL__ >= 706 |
| 42 |
, Generic1 |
| 43 |
#endif |
| 44 |
#endif |
| 45 |
) |