{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
#if __GLASGOW_HASKELL__ >= 702
#define LANGUAGE_DeriveGeneric
{-# LANGUAGE DeriveGeneric #-}
#endif
module System.Console.Terminal.Common
( Window(..)
) where
import Data.Data (Typeable, Data)
#if __GLASGOW_HASKELL__ < 710
import Data.Foldable (Foldable)
import Data.Traversable (Traversable)
#endif
#ifdef LANGUAGE_DeriveGeneric
import GHC.Generics
( Generic
#if __GLASGOW_HASKELL__ >= 706
, Generic1
#endif
)
#endif
data Window a = Window
{ forall a. Window a -> a
height :: !a
, forall a. Window a -> a
width :: !a
} deriving
( Int -> Window a -> ShowS
forall a. Show a => Int -> Window a -> ShowS
forall a. Show a => [Window a] -> ShowS
forall a. Show a => Window a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Window a] -> ShowS
$cshowList :: forall a. Show a => [Window a] -> ShowS
show :: Window a -> String
$cshow :: forall a. Show a => Window a -> String
showsPrec :: Int -> Window a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Window a -> ShowS
Show, Window a -> Window a -> Bool
forall a. Eq a => Window a -> Window a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Window a -> Window a -> Bool
$c/= :: forall a. Eq a => Window a -> Window a -> Bool
== :: Window a -> Window a -> Bool
$c== :: forall a. Eq a => Window a -> Window a -> Bool
Eq, ReadPrec [Window a]
ReadPrec (Window a)
ReadS [Window a]
forall a. Read a => ReadPrec [Window a]
forall a. Read a => ReadPrec (Window a)
forall a. Read a => Int -> ReadS (Window a)
forall a. Read a => ReadS [Window a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Window a]
$creadListPrec :: forall a. Read a => ReadPrec [Window a]
readPrec :: ReadPrec (Window a)
$creadPrec :: forall a. Read a => ReadPrec (Window a)
readList :: ReadS [Window a]
$creadList :: forall a. Read a => ReadS [Window a]
readsPrec :: Int -> ReadS (Window a)
$creadsPrec :: forall a. Read a => Int -> ReadS (Window a)
Read, Window a -> DataType
Window a -> Constr
forall {a}. Data a => Typeable (Window a)
forall a. Data a => Window a -> DataType
forall a. Data a => Window a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Window a -> Window a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Window a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Window a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Window a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Window a -> c (Window a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Window a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Window a))
forall a.
Typeable a
-> (forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Window a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Window a -> c (Window a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Window a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Window a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Window a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> Window a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Window a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
gmapT :: (forall b. Data b => b -> b) -> Window a -> Window a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Window a -> Window a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Window a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Window a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Window a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Window a))
dataTypeOf :: Window a -> DataType
$cdataTypeOf :: forall a. Data a => Window a -> DataType
toConstr :: Window a -> Constr
$ctoConstr :: forall a. Data a => Window a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Window a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Window a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Window a -> c (Window a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Window a -> c (Window a)
Data, Typeable
, forall a. Eq a => a -> Window a -> Bool
forall a. Num a => Window a -> a
forall a. Ord a => Window a -> a
forall m. Monoid m => Window m -> m
forall a. Window a -> Bool
forall a. Window a -> Int
forall a. Window a -> [a]
forall a. (a -> a -> a) -> Window a -> a
forall m a. Monoid m => (a -> m) -> Window a -> m
forall b a. (b -> a -> b) -> b -> Window a -> b
forall a b. (a -> b -> b) -> b -> Window a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: forall a. Num a => Window a -> a
$cproduct :: forall a. Num a => Window a -> a
sum :: forall a. Num a => Window a -> a
$csum :: forall a. Num a => Window a -> a
minimum :: forall a. Ord a => Window a -> a
$cminimum :: forall a. Ord a => Window a -> a
maximum :: forall a. Ord a => Window a -> a
$cmaximum :: forall a. Ord a => Window a -> a
elem :: forall a. Eq a => a -> Window a -> Bool
$celem :: forall a. Eq a => a -> Window a -> Bool
length :: forall a. Window a -> Int
$clength :: forall a. Window a -> Int
null :: forall a. Window a -> Bool
$cnull :: forall a. Window a -> Bool
toList :: forall a. Window a -> [a]
$ctoList :: forall a. Window a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Window a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Window a -> a
foldr1 :: forall a. (a -> a -> a) -> Window a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Window a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Window a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Window a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Window a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Window a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Window a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Window a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Window a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Window a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Window a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Window a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Window a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Window a -> m
fold :: forall m. Monoid m => Window m -> m
$cfold :: forall m. Monoid m => Window m -> m
Foldable, forall a b. a -> Window b -> Window a
forall a b. (a -> b) -> Window a -> Window b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Window b -> Window a
$c<$ :: forall a b. a -> Window b -> Window a
fmap :: forall a b. (a -> b) -> Window a -> Window b
$cfmap :: forall a b. (a -> b) -> Window a -> Window b
Functor, Functor Window
Foldable Window
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Window (m a) -> m (Window a)
forall (f :: * -> *) a.
Applicative f =>
Window (f a) -> f (Window a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Window a -> m (Window b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Window a -> f (Window b)
sequence :: forall (m :: * -> *) a. Monad m => Window (m a) -> m (Window a)
$csequence :: forall (m :: * -> *) a. Monad m => Window (m a) -> m (Window a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Window a -> m (Window b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Window a -> m (Window b)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Window (f a) -> f (Window a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Window (f a) -> f (Window a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Window a -> f (Window b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Window a -> f (Window b)
Traversable
#ifdef LANGUAGE_DeriveGeneric
, forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Window a) x -> Window a
forall a x. Window a -> Rep (Window a) x
$cto :: forall a x. Rep (Window a) x -> Window a
$cfrom :: forall a x. Window a -> Rep (Window a) x
Generic
#if __GLASGOW_HASKELL__ >= 706
, forall a. Rep1 Window a -> Window a
forall a. Window a -> Rep1 Window a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 Window a -> Window a
$cfrom1 :: forall a. Window a -> Rep1 Window a
Generic1
#endif
#endif
)