{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}

module Language.Fortran.AST.AList where

import Language.Fortran.Util.FirstParameter
import Language.Fortran.Util.SecondParameter
import Language.Fortran.Util.Position (Spanned, SrcSpan(..), getSpan)

import Data.Data    (Data, Typeable)
import GHC.Generics (Generic)
import Control.DeepSeq (NFData)
import Text.PrettyPrint.GenericPretty (Out)

-- | A location-tagged list of @t a@s (@t@ decorated with an @a@ annotation).
--
-- The AST is polymorphic on some type @a@, which is used for arbitrary
-- annotations. Since many AST nodes use lists (e.g. executable statements,
-- declarations), we define a dedicated annotated list type to reuse.
--
-- Note that the list itself also holds an @a@ annotation.
data AList t a = AList a SrcSpan [t a] deriving (AList t a -> AList t a -> Bool
(AList t a -> AList t a -> Bool)
-> (AList t a -> AList t a -> Bool) -> Eq (AList t a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (t :: * -> *) a.
(Eq a, Eq (t a)) =>
AList t a -> AList t a -> Bool
/= :: AList t a -> AList t a -> Bool
$c/= :: forall (t :: * -> *) a.
(Eq a, Eq (t a)) =>
AList t a -> AList t a -> Bool
== :: AList t a -> AList t a -> Bool
$c== :: forall (t :: * -> *) a.
(Eq a, Eq (t a)) =>
AList t a -> AList t a -> Bool
Eq, Int -> AList t a -> ShowS
[AList t a] -> ShowS
AList t a -> String
(Int -> AList t a -> ShowS)
-> (AList t a -> String)
-> ([AList t a] -> ShowS)
-> Show (AList t a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (t :: * -> *) a.
(Show a, Show (t a)) =>
Int -> AList t a -> ShowS
forall (t :: * -> *) a.
(Show a, Show (t a)) =>
[AList t a] -> ShowS
forall (t :: * -> *) a. (Show a, Show (t a)) => AList t a -> String
showList :: [AList t a] -> ShowS
$cshowList :: forall (t :: * -> *) a.
(Show a, Show (t a)) =>
[AList t a] -> ShowS
show :: AList t a -> String
$cshow :: forall (t :: * -> *) a. (Show a, Show (t a)) => AList t a -> String
showsPrec :: Int -> AList t a -> ShowS
$cshowsPrec :: forall (t :: * -> *) a.
(Show a, Show (t a)) =>
Int -> AList t a -> ShowS
Show, Typeable (AList t a)
Typeable (AList t a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> AList t a -> c (AList t a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (AList t a))
-> (AList t a -> Constr)
-> (AList t a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (AList t a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (AList t a)))
-> ((forall b. Data b => b -> b) -> AList t a -> AList t a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> AList t a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> AList t a -> r)
-> (forall u. (forall d. Data d => d -> u) -> AList t a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> AList t a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> AList t a -> m (AList t a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AList t a -> m (AList t a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> AList t a -> m (AList t a))
-> Data (AList t a)
AList t a -> DataType
AList t a -> Constr
(forall b. Data b => b -> b) -> AList t a -> AList t 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) -> AList t a -> u
forall u. (forall d. Data d => d -> u) -> AList t a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AList t a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AList t a -> c (AList t a)
forall {t :: * -> *} {a}.
(Typeable t, Data a, Data (t a)) =>
Typeable (AList t a)
forall (t :: * -> *) a.
(Typeable t, Data a, Data (t a)) =>
AList t a -> DataType
forall (t :: * -> *) a.
(Typeable t, Data a, Data (t a)) =>
AList t a -> Constr
forall (t :: * -> *) a.
(Typeable t, Data a, Data (t a)) =>
(forall b. Data b => b -> b) -> AList t a -> AList t a
forall (t :: * -> *) a u.
(Typeable t, Data a, Data (t a)) =>
Int -> (forall d. Data d => d -> u) -> AList t a -> u
forall (t :: * -> *) a u.
(Typeable t, Data a, Data (t a)) =>
(forall d. Data d => d -> u) -> AList t a -> [u]
forall (t :: * -> *) a r r'.
(Typeable t, Data a, Data (t a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
forall (t :: * -> *) a r r'.
(Typeable t, Data a, Data (t a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
forall (t :: * -> *) a (m :: * -> *).
(Typeable t, Data a, Data (t a), Monad m) =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
forall (t :: * -> *) a (m :: * -> *).
(Typeable t, Data a, Data (t a), MonadPlus m) =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
forall (t :: * -> *) a (c :: * -> *).
(Typeable t, Data a, Data (t a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AList t a)
forall (t :: * -> *) a (c :: * -> *).
(Typeable t, Data a, Data (t a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AList t a -> c (AList t a)
forall (t :: * -> *) a (t :: * -> *) (c :: * -> *).
(Typeable t, Data a, Data (t a), Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (AList t a))
forall (t :: * -> *) a (t :: * -> * -> *) (c :: * -> *).
(Typeable t, Data a, Data (t a), Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AList t a))
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (AList t a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AList t a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
$cgmapMo :: forall (t :: * -> *) a (m :: * -> *).
(Typeable t, Data a, Data (t a), MonadPlus m) =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
$cgmapMp :: forall (t :: * -> *) a (m :: * -> *).
(Typeable t, Data a, Data (t a), MonadPlus m) =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
$cgmapM :: forall (t :: * -> *) a (m :: * -> *).
(Typeable t, Data a, Data (t a), Monad m) =>
(forall d. Data d => d -> m d) -> AList t a -> m (AList t a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> AList t a -> u
$cgmapQi :: forall (t :: * -> *) a u.
(Typeable t, Data a, Data (t a)) =>
Int -> (forall d. Data d => d -> u) -> AList t a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> AList t a -> [u]
$cgmapQ :: forall (t :: * -> *) a u.
(Typeable t, Data a, Data (t a)) =>
(forall d. Data d => d -> u) -> AList t a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
$cgmapQr :: forall (t :: * -> *) a r r'.
(Typeable t, Data a, Data (t a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
$cgmapQl :: forall (t :: * -> *) a r r'.
(Typeable t, Data a, Data (t a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> AList t a -> r
gmapT :: (forall b. Data b => b -> b) -> AList t a -> AList t a
$cgmapT :: forall (t :: * -> *) a.
(Typeable t, Data a, Data (t a)) =>
(forall b. Data b => b -> b) -> AList t a -> AList t a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AList t a))
$cdataCast2 :: forall (t :: * -> *) a (t :: * -> * -> *) (c :: * -> *).
(Typeable t, Data a, Data (t a), Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (AList t a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (AList t a))
$cdataCast1 :: forall (t :: * -> *) a (t :: * -> *) (c :: * -> *).
(Typeable t, Data a, Data (t a), Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (AList t a))
dataTypeOf :: AList t a -> DataType
$cdataTypeOf :: forall (t :: * -> *) a.
(Typeable t, Data a, Data (t a)) =>
AList t a -> DataType
toConstr :: AList t a -> Constr
$ctoConstr :: forall (t :: * -> *) a.
(Typeable t, Data a, Data (t a)) =>
AList t a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AList t a)
$cgunfold :: forall (t :: * -> *) a (c :: * -> *).
(Typeable t, Data a, Data (t a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (AList t a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AList t a -> c (AList t a)
$cgfoldl :: forall (t :: * -> *) a (c :: * -> *).
(Typeable t, Data a, Data (t a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> AList t a -> c (AList t a)
Data, Typeable, (forall x. AList t a -> Rep (AList t a) x)
-> (forall x. Rep (AList t a) x -> AList t a)
-> Generic (AList t a)
forall x. Rep (AList t a) x -> AList t a
forall x. AList t a -> Rep (AList t a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (t :: * -> *) a x. Rep (AList t a) x -> AList t a
forall (t :: * -> *) a x. AList t a -> Rep (AList t a) x
$cto :: forall (t :: * -> *) a x. Rep (AList t a) x -> AList t a
$cfrom :: forall (t :: * -> *) a x. AList t a -> Rep (AList t a) x
Generic)
instance Functor t => Functor (AList t) where
  fmap :: forall a b. (a -> b) -> AList t a -> AList t b
fmap a -> b
f (AList a
a SrcSpan
s [t a]
xs) = b -> SrcSpan -> [t b] -> AList t b
forall (t :: * -> *) a. a -> SrcSpan -> [t a] -> AList t a
AList (a -> b
f a
a) SrcSpan
s ((t a -> t b) -> [t a] -> [t b]
forall a b. (a -> b) -> [a] -> [b]
map ((a -> b) -> t a -> t b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f) [t a]
xs)

instance FirstParameter (AList t a) a
instance SecondParameter (AList t a) SrcSpan
instance Spanned (AList t a)
instance (Out a, Out (t a)) => Out (AList t a)
instance (NFData a, NFData (t a)) => NFData (AList t a)

-- | Convert a non-empty list to an 'AList'.
fromList :: Spanned (t a) => a -> [ t a ] -> AList t a
fromList :: forall (t :: * -> *) a. Spanned (t a) => a -> [t a] -> AList t a
fromList a
a [t a]
xs = a -> SrcSpan -> [t a] -> AList t a
forall (t :: * -> *) a. a -> SrcSpan -> [t a] -> AList t a
AList a
a ([t a] -> SrcSpan
forall a. Spanned a => a -> SrcSpan
getSpan [t a]
xs) [t a]
xs

-- | Convert a list to an 'AList', returning Nothing iff the list is empty.
fromList' :: Spanned (t a) => a -> [ t a ] -> Maybe (AList t a)
fromList' :: forall (t :: * -> *) a.
Spanned (t a) =>
a -> [t a] -> Maybe (AList t a)
fromList' a
_ [] = Maybe (AList t a)
forall a. Maybe a
Nothing
fromList' a
a [t a]
xs = AList t a -> Maybe (AList t a)
forall a. a -> Maybe a
Just (AList t a -> Maybe (AList t a)) -> AList t a -> Maybe (AList t a)
forall a b. (a -> b) -> a -> b
$ a -> [t a] -> AList t a
forall (t :: * -> *) a. Spanned (t a) => a -> [t a] -> AList t a
fromList a
a [t a]
xs

fromReverseList :: Spanned (t ()) => [ t () ] -> AList t ()
fromReverseList :: forall (t :: * -> *). Spanned (t ()) => [t ()] -> AList t ()
fromReverseList = () -> [t ()] -> AList t ()
forall (t :: * -> *) a. Spanned (t a) => a -> [t a] -> AList t a
fromList () ([t ()] -> AList t ())
-> ([t ()] -> [t ()]) -> [t ()] -> AList t ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [t ()] -> [t ()]
forall a. [a] -> [a]
reverse

fromReverseList' :: Spanned (t ()) => [ t () ] -> Maybe (AList t ())
fromReverseList' :: forall (t :: * -> *).
Spanned (t ()) =>
[t ()] -> Maybe (AList t ())
fromReverseList' = () -> [t ()] -> Maybe (AList t ())
forall (t :: * -> *) a.
Spanned (t a) =>
a -> [t a] -> Maybe (AList t a)
fromList' () ([t ()] -> Maybe (AList t ()))
-> ([t ()] -> [t ()]) -> [t ()] -> Maybe (AList t ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [t ()] -> [t ()]
forall a. [a] -> [a]
reverse

aCons :: t a -> AList t a -> AList t a
aCons :: forall (t :: * -> *) a. t a -> AList t a -> AList t a
aCons t a
x (AList a
a SrcSpan
s [t a]
xs) = a -> SrcSpan -> [t a] -> AList t a
forall (t :: * -> *) a. a -> SrcSpan -> [t a] -> AList t a
AList a
a SrcSpan
s ([t a] -> AList t a) -> [t a] -> AList t a
forall a b. (a -> b) -> a -> b
$ t a
xt a -> [t a] -> [t a]
forall a. a -> [a] -> [a]
:[t a]
xs

infixr 5 `aCons`

aReverse :: AList t a -> AList t a
aReverse :: forall (t :: * -> *) a. AList t a -> AList t a
aReverse (AList a
a SrcSpan
s [t a]
xs) = a -> SrcSpan -> [t a] -> AList t a
forall (t :: * -> *) a. a -> SrcSpan -> [t a] -> AList t a
AList a
a SrcSpan
s ([t a] -> AList t a) -> [t a] -> AList t a
forall a b. (a -> b) -> a -> b
$ [t a] -> [t a]
forall a. [a] -> [a]
reverse [t a]
xs

aStrip :: AList t a -> [t a]
aStrip :: forall (t :: * -> *) a. AList t a -> [t a]
aStrip (AList a
_ SrcSpan
_ [t a]
l) = [t a]
l

aStrip' :: Maybe (AList t a) -> [t a]
aStrip' :: forall (t :: * -> *) a. Maybe (AList t a) -> [t a]
aStrip' Maybe (AList t a)
Nothing = []
aStrip' (Just AList t a
a) = AList t a -> [t a]
forall (t :: * -> *) a. AList t a -> [t a]
aStrip AList t a
a

aMap :: (t a -> r a) -> AList t a -> AList r a
aMap :: forall (t :: * -> *) a (r :: * -> *).
(t a -> r a) -> AList t a -> AList r a
aMap t a -> r a
f (AList a
a SrcSpan
s [t a]
xs) = a -> SrcSpan -> [r a] -> AList r a
forall (t :: * -> *) a. a -> SrcSpan -> [t a] -> AList t a
AList a
a SrcSpan
s ((t a -> r a) -> [t a] -> [r a]
forall a b. (a -> b) -> [a] -> [b]
map t a -> r a
f [t a]
xs)

--------------------------------------------------------------------------------

data ATuple t1 t2 a = ATuple a SrcSpan (t1 a) (t2 a)
    deriving (ATuple t1 t2 a -> ATuple t1 t2 a -> Bool
(ATuple t1 t2 a -> ATuple t1 t2 a -> Bool)
-> (ATuple t1 t2 a -> ATuple t1 t2 a -> Bool)
-> Eq (ATuple t1 t2 a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Eq a, Eq (t1 a), Eq (t2 a)) =>
ATuple t1 t2 a -> ATuple t1 t2 a -> Bool
/= :: ATuple t1 t2 a -> ATuple t1 t2 a -> Bool
$c/= :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Eq a, Eq (t1 a), Eq (t2 a)) =>
ATuple t1 t2 a -> ATuple t1 t2 a -> Bool
== :: ATuple t1 t2 a -> ATuple t1 t2 a -> Bool
$c== :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Eq a, Eq (t1 a), Eq (t2 a)) =>
ATuple t1 t2 a -> ATuple t1 t2 a -> Bool
Eq, Int -> ATuple t1 t2 a -> ShowS
[ATuple t1 t2 a] -> ShowS
ATuple t1 t2 a -> String
(Int -> ATuple t1 t2 a -> ShowS)
-> (ATuple t1 t2 a -> String)
-> ([ATuple t1 t2 a] -> ShowS)
-> Show (ATuple t1 t2 a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Show a, Show (t1 a), Show (t2 a)) =>
Int -> ATuple t1 t2 a -> ShowS
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Show a, Show (t1 a), Show (t2 a)) =>
[ATuple t1 t2 a] -> ShowS
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Show a, Show (t1 a), Show (t2 a)) =>
ATuple t1 t2 a -> String
showList :: [ATuple t1 t2 a] -> ShowS
$cshowList :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Show a, Show (t1 a), Show (t2 a)) =>
[ATuple t1 t2 a] -> ShowS
show :: ATuple t1 t2 a -> String
$cshow :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Show a, Show (t1 a), Show (t2 a)) =>
ATuple t1 t2 a -> String
showsPrec :: Int -> ATuple t1 t2 a -> ShowS
$cshowsPrec :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Show a, Show (t1 a), Show (t2 a)) =>
Int -> ATuple t1 t2 a -> ShowS
Show, Typeable (ATuple t1 t2 a)
Typeable (ATuple t1 t2 a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ATuple t1 t2 a -> c (ATuple t1 t2 a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ATuple t1 t2 a))
-> (ATuple t1 t2 a -> Constr)
-> (ATuple t1 t2 a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ATuple t1 t2 a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (ATuple t1 t2 a)))
-> ((forall b. Data b => b -> b)
    -> ATuple t1 t2 a -> ATuple t1 t2 a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ATuple t1 t2 a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ATuple t1 t2 a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ATuple t1 t2 a -> m (ATuple t1 t2 a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ATuple t1 t2 a -> m (ATuple t1 t2 a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ATuple t1 t2 a -> m (ATuple t1 t2 a))
-> Data (ATuple t1 t2 a)
ATuple t1 t2 a -> DataType
ATuple t1 t2 a -> Constr
(forall b. Data b => b -> b) -> ATuple t1 t2 a -> ATuple t1 t2 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) -> ATuple t1 t2 a -> u
forall u. (forall d. Data d => d -> u) -> ATuple t1 t2 a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ATuple t1 t2 a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ATuple t1 t2 a -> c (ATuple t1 t2 a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ATuple t1 t2 a))
forall {t1 :: * -> *} {t2 :: * -> *} {a}.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
Typeable (ATuple t1 t2 a)
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
ATuple t1 t2 a -> DataType
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
ATuple t1 t2 a -> Constr
forall (t1 :: * -> *) (t2 :: * -> *) a.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall b. Data b => b -> b) -> ATuple t1 t2 a -> ATuple t1 t2 a
forall (t1 :: * -> *) (t2 :: * -> *) a u.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
Int -> (forall d. Data d => d -> u) -> ATuple t1 t2 a -> u
forall (t1 :: * -> *) (t2 :: * -> *) a u.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall d. Data d => d -> u) -> ATuple t1 t2 a -> [u]
forall (t1 :: * -> *) (t2 :: * -> *) a r r'.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
forall (t1 :: * -> *) (t2 :: * -> *) a r r'.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
forall (t1 :: * -> *) (t2 :: * -> *) a (m :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 Monad m) =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
forall (t1 :: * -> *) (t2 :: * -> *) a (m :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
forall (t1 :: * -> *) (t2 :: * -> *) a (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ATuple t1 t2 a)
forall (t1 :: * -> *) (t2 :: * -> *) a (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ATuple t1 t2 a -> c (ATuple t1 t2 a)
forall (t1 :: * -> *) (t2 :: * -> *) a (t :: * -> *) (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ATuple t1 t2 a))
forall (t1 :: * -> *) (t2 :: * -> *) a (t :: * -> * -> *)
       (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ATuple t1 t2 a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ATuple t1 t2 a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
$cgmapMo :: forall (t1 :: * -> *) (t2 :: * -> *) a (m :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
$cgmapMp :: forall (t1 :: * -> *) (t2 :: * -> *) a (m :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 MonadPlus m) =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
$cgmapM :: forall (t1 :: * -> *) (t2 :: * -> *) a (m :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 Monad m) =>
(forall d. Data d => d -> m d)
-> ATuple t1 t2 a -> m (ATuple t1 t2 a)
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ATuple t1 t2 a -> u
$cgmapQi :: forall (t1 :: * -> *) (t2 :: * -> *) a u.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
Int -> (forall d. Data d => d -> u) -> ATuple t1 t2 a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> ATuple t1 t2 a -> [u]
$cgmapQ :: forall (t1 :: * -> *) (t2 :: * -> *) a u.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall d. Data d => d -> u) -> ATuple t1 t2 a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
$cgmapQr :: forall (t1 :: * -> *) (t2 :: * -> *) a r r'.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
$cgmapQl :: forall (t1 :: * -> *) (t2 :: * -> *) a r r'.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ATuple t1 t2 a -> r
gmapT :: (forall b. Data b => b -> b) -> ATuple t1 t2 a -> ATuple t1 t2 a
$cgmapT :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall b. Data b => b -> b) -> ATuple t1 t2 a -> ATuple t1 t2 a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ATuple t1 t2 a))
$cdataCast2 :: forall (t1 :: * -> *) (t2 :: * -> *) a (t :: * -> * -> *)
       (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ATuple t1 t2 a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ATuple t1 t2 a))
$cdataCast1 :: forall (t1 :: * -> *) (t2 :: * -> *) a (t :: * -> *) (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a),
 Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ATuple t1 t2 a))
dataTypeOf :: ATuple t1 t2 a -> DataType
$cdataTypeOf :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
ATuple t1 t2 a -> DataType
toConstr :: ATuple t1 t2 a -> Constr
$ctoConstr :: forall (t1 :: * -> *) (t2 :: * -> *) a.
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
ATuple t1 t2 a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ATuple t1 t2 a)
$cgunfold :: forall (t1 :: * -> *) (t2 :: * -> *) a (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ATuple t1 t2 a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ATuple t1 t2 a -> c (ATuple t1 t2 a)
$cgfoldl :: forall (t1 :: * -> *) (t2 :: * -> *) a (c :: * -> *).
(Typeable t1, Typeable t2, Data a, Data (t1 a), Data (t2 a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ATuple t1 t2 a -> c (ATuple t1 t2 a)
Data, Typeable, (forall x. ATuple t1 t2 a -> Rep (ATuple t1 t2 a) x)
-> (forall x. Rep (ATuple t1 t2 a) x -> ATuple t1 t2 a)
-> Generic (ATuple t1 t2 a)
forall x. Rep (ATuple t1 t2 a) x -> ATuple t1 t2 a
forall x. ATuple t1 t2 a -> Rep (ATuple t1 t2 a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (t1 :: * -> *) (t2 :: * -> *) a x.
Rep (ATuple t1 t2 a) x -> ATuple t1 t2 a
forall (t1 :: * -> *) (t2 :: * -> *) a x.
ATuple t1 t2 a -> Rep (ATuple t1 t2 a) x
$cto :: forall (t1 :: * -> *) (t2 :: * -> *) a x.
Rep (ATuple t1 t2 a) x -> ATuple t1 t2 a
$cfrom :: forall (t1 :: * -> *) (t2 :: * -> *) a x.
ATuple t1 t2 a -> Rep (ATuple t1 t2 a) x
Generic, (forall a b. (a -> b) -> ATuple t1 t2 a -> ATuple t1 t2 b)
-> (forall a b. a -> ATuple t1 t2 b -> ATuple t1 t2 a)
-> Functor (ATuple t1 t2)
forall a b. a -> ATuple t1 t2 b -> ATuple t1 t2 a
forall a b. (a -> b) -> ATuple t1 t2 a -> ATuple t1 t2 b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
forall (t1 :: * -> *) (t2 :: * -> *) a b.
(Functor t1, Functor t2) =>
a -> ATuple t1 t2 b -> ATuple t1 t2 a
forall (t1 :: * -> *) (t2 :: * -> *) a b.
(Functor t1, Functor t2) =>
(a -> b) -> ATuple t1 t2 a -> ATuple t1 t2 b
<$ :: forall a b. a -> ATuple t1 t2 b -> ATuple t1 t2 a
$c<$ :: forall (t1 :: * -> *) (t2 :: * -> *) a b.
(Functor t1, Functor t2) =>
a -> ATuple t1 t2 b -> ATuple t1 t2 a
fmap :: forall a b. (a -> b) -> ATuple t1 t2 a -> ATuple t1 t2 b
$cfmap :: forall (t1 :: * -> *) (t2 :: * -> *) a b.
(Functor t1, Functor t2) =>
(a -> b) -> ATuple t1 t2 a -> ATuple t1 t2 b
Functor)

instance FirstParameter (ATuple t1 t2 a) a
instance SecondParameter (ATuple t1 t2 a) SrcSpan
instance Spanned (ATuple t1 t2 a)
instance (Out a, Out (t1 a), Out (t2 a)) => Out (ATuple t1 t2 a)
instance (NFData a, NFData (t1 a), NFData (t2 a)) => NFData (ATuple t1 t2 a)