{-# 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
{ Window a -> a
height :: !a
, Window a -> a
width :: !a
} deriving
( Int -> Window a -> ShowS
[Window a] -> ShowS
Window a -> String
(Int -> Window a -> ShowS)
-> (Window a -> String) -> ([Window a] -> ShowS) -> Show (Window a)
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
(Window a -> Window a -> Bool)
-> (Window a -> Window a -> Bool) -> Eq (Window a)
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)
Int -> ReadS (Window a)
ReadS [Window a]
(Int -> ReadS (Window a))
-> ReadS [Window a]
-> ReadPrec (Window a)
-> ReadPrec [Window a]
-> Read (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, Typeable (Window a)
DataType
Constr
Typeable (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 (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Window a))
-> (Window a -> Constr)
-> (Window a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Window a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Window a)))
-> ((forall b. Data b => b -> b) -> Window a -> Window a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Window a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Window a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a))
-> Data (Window a)
Window a -> DataType
Window a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Window a))
(forall b. Data b => b -> b) -> Window a -> Window a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Window a -> c (Window a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Window a)
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 u. Int -> (forall d. Data d => d -> u) -> Window a -> u
forall u. (forall d. Data d => d -> u) -> Window a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Window a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Window a -> m (Window 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))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Window a))
$cWindow :: Constr
$tWindow :: DataType
gmapMo :: (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 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 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 :: 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 d. Data d => d -> u) -> Window a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Window a -> [u]
gmapQr :: (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 :: (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 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 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 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 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)
$cp1Data :: forall a. Data a => Typeable (Window a)
Data, Typeable
, Window a -> Bool
(a -> m) -> Window a -> m
(a -> b -> b) -> b -> Window a -> b
(forall m. Monoid m => Window m -> m)
-> (forall m a. Monoid m => (a -> m) -> Window a -> m)
-> (forall m a. Monoid m => (a -> m) -> Window a -> m)
-> (forall a b. (a -> b -> b) -> b -> Window a -> b)
-> (forall a b. (a -> b -> b) -> b -> Window a -> b)
-> (forall b a. (b -> a -> b) -> b -> Window a -> b)
-> (forall b a. (b -> a -> b) -> b -> Window a -> b)
-> (forall a. (a -> a -> a) -> Window a -> a)
-> (forall a. (a -> a -> a) -> Window a -> a)
-> (forall a. Window a -> [a])
-> (forall a. Window a -> Bool)
-> (forall a. Window a -> Int)
-> (forall a. Eq a => a -> Window a -> Bool)
-> (forall a. Ord a => Window a -> a)
-> (forall a. Ord a => Window a -> a)
-> (forall a. Num a => Window a -> a)
-> (forall a. Num a => Window a -> a)
-> Foldable Window
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 :: Window a -> a
$cproduct :: forall a. Num a => Window a -> a
sum :: Window a -> a
$csum :: forall a. Num a => Window a -> a
minimum :: Window a -> a
$cminimum :: forall a. Ord a => Window a -> a
maximum :: Window a -> a
$cmaximum :: forall a. Ord a => Window a -> a
elem :: a -> Window a -> Bool
$celem :: forall a. Eq a => a -> Window a -> Bool
length :: Window a -> Int
$clength :: forall a. Window a -> Int
null :: Window a -> Bool
$cnull :: forall a. Window a -> Bool
toList :: Window a -> [a]
$ctoList :: forall a. Window a -> [a]
foldl1 :: (a -> a -> a) -> Window a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Window a -> a
foldr1 :: (a -> a -> a) -> Window a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Window a -> a
foldl' :: (b -> a -> b) -> b -> Window a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Window a -> b
foldl :: (b -> a -> b) -> b -> Window a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Window a -> b
foldr' :: (a -> b -> b) -> b -> Window a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Window a -> b
foldr :: (a -> b -> b) -> b -> Window a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Window a -> b
foldMap' :: (a -> m) -> Window a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Window a -> m
foldMap :: (a -> m) -> Window a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Window a -> m
fold :: Window m -> m
$cfold :: forall m. Monoid m => Window m -> m
Foldable, a -> Window b -> Window a
(a -> b) -> Window a -> Window b
(forall a b. (a -> b) -> Window a -> Window b)
-> (forall a b. a -> Window b -> Window a) -> Functor Window
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
<$ :: a -> Window b -> Window a
$c<$ :: forall a b. a -> Window b -> Window a
fmap :: (a -> b) -> Window a -> Window b
$cfmap :: forall a b. (a -> b) -> Window a -> Window b
Functor, Functor Window
Foldable Window
Functor Window
-> Foldable Window
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Window a -> f (Window b))
-> (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 (m :: * -> *) a.
Monad m =>
Window (m a) -> m (Window a))
-> Traversable Window
(a -> f b) -> Window a -> f (Window b)
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 :: Window (m a) -> m (Window a)
$csequence :: forall (m :: * -> *) a. Monad m => Window (m a) -> m (Window a)
mapM :: (a -> m b) -> Window a -> m (Window b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Window a -> m (Window b)
sequenceA :: Window (f a) -> f (Window a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Window (f a) -> f (Window a)
traverse :: (a -> f b) -> Window a -> f (Window b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Window a -> f (Window b)
$cp2Traversable :: Foldable Window
$cp1Traversable :: Functor Window
Traversable
#ifdef LANGUAGE_DeriveGeneric
, (forall x. Window a -> Rep (Window a) x)
-> (forall x. Rep (Window a) x -> Window a) -> Generic (Window a)
forall x. Rep (Window a) x -> Window a
forall x. Window a -> Rep (Window a) x
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. Window a -> Rep1 Window a)
-> (forall a. Rep1 Window a -> Window a) -> Generic1 Window
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
)