{- |
Module      :  Camfort.Specification.Stencils.Parser.Types
Description :  Defines the representation of stencil specifications resulting from parsing.
Copyright   :  (c) 2017, Dominic Orchard, Andrew Rice, Mistral Contrastin, Matthew Danish
License     :  Apache-2.0

Maintainer  :  dom.orchard@gmail.com
Stability   :  experimental
-}

{-# LANGUAGE DeriveDataTypeable #-}

module Camfort.Specification.Stencils.Parser.Types
  ( Specification(..)
  , Region(..)
  , SpecInner(..)
  , reqRegions
  ) where

import Data.Data (Data, Typeable)
import Data.List (nub, sort)

import           Camfort.Specification.Stencils.Model
  (Approximation(..), Multiplicity(..))
import qualified Camfort.Specification.Stencils.Syntax as Syn

data Specification
  = RegionDec String Region
  | SpecDec SpecInner [String]
  deriving (Int -> Specification -> ShowS
[Specification] -> ShowS
Specification -> Variable
(Int -> Specification -> ShowS)
-> (Specification -> Variable)
-> ([Specification] -> ShowS)
-> Show Specification
forall a.
(Int -> a -> ShowS) -> (a -> Variable) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Specification -> ShowS
showsPrec :: Int -> Specification -> ShowS
$cshow :: Specification -> Variable
show :: Specification -> Variable
$cshowList :: [Specification] -> ShowS
showList :: [Specification] -> ShowS
Show, Specification -> Specification -> Bool
(Specification -> Specification -> Bool)
-> (Specification -> Specification -> Bool) -> Eq Specification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Specification -> Specification -> Bool
== :: Specification -> Specification -> Bool
$c/= :: Specification -> Specification -> Bool
/= :: Specification -> Specification -> Bool
Eq, Typeable, Typeable Specification
Typeable Specification
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Specification -> c Specification)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Specification)
-> (Specification -> Constr)
-> (Specification -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Specification))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Specification))
-> ((forall b. Data b => b -> b) -> Specification -> Specification)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Specification -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Specification -> r)
-> (forall u. (forall d. Data d => d -> u) -> Specification -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Specification -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Specification -> m Specification)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Specification -> m Specification)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Specification -> m Specification)
-> Data Specification
Specification -> Constr
Specification -> DataType
(forall b. Data b => b -> b) -> Specification -> Specification
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) -> Specification -> u
forall u. (forall d. Data d => d -> u) -> Specification -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Specification -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Specification -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Specification
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Specification -> c Specification
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Specification)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Specification)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Specification -> c Specification
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Specification -> c Specification
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Specification
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Specification
$ctoConstr :: Specification -> Constr
toConstr :: Specification -> Constr
$cdataTypeOf :: Specification -> DataType
dataTypeOf :: Specification -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Specification)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Specification)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Specification)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c Specification)
$cgmapT :: (forall b. Data b => b -> b) -> Specification -> Specification
gmapT :: (forall b. Data b => b -> b) -> Specification -> Specification
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Specification -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Specification -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Specification -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Specification -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Specification -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Specification -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Specification -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Specification -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Specification -> m Specification
Data)

-- | Regions that are referenced in a specification.
reqRegions :: Specification -> [Syn.Variable]
reqRegions :: Specification -> [Variable]
reqRegions Specification
spec = [Variable] -> [Variable]
forall a. Eq a => [a] -> [a]
nub ([Variable] -> [Variable])
-> ([Variable] -> [Variable]) -> [Variable] -> [Variable]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Variable] -> [Variable]
forall a. Ord a => [a] -> [a]
sort ([Variable] -> [Variable]) -> [Variable] -> [Variable]
forall a b. (a -> b) -> a -> b
$
  case Specification
spec of
    RegionDec Variable
_ Region
r             -> Region -> [Variable]
reqRegions' Region
r
    SpecDec (SpecInner Multiplicity (Approximation Region)
x Bool
_) [Variable]
_ ->
      case Multiplicity (Approximation Region)
x of
        Once Approximation Region
a -> Approximation Region -> [Variable]
reqRegionsApprox Approximation Region
a
        Mult Approximation Region
a -> Approximation Region -> [Variable]
reqRegionsApprox Approximation Region
a
  where
    reqRegionsApprox :: Approximation Region -> [Variable]
reqRegionsApprox (Exact Region
r) = Region -> [Variable]
reqRegions' Region
r
    reqRegionsApprox (Bound Maybe Region
l Maybe Region
u) =
      let maybeReqRegions :: Maybe Region -> [Variable]
maybeReqRegions = [Variable] -> (Region -> [Variable]) -> Maybe Region -> [Variable]
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] Region -> [Variable]
reqRegions'
      in Maybe Region -> [Variable]
maybeReqRegions Maybe Region
l [Variable] -> [Variable] -> [Variable]
forall a. [a] -> [a] -> [a]
++ Maybe Region -> [Variable]
maybeReqRegions Maybe Region
u
    reqRegions' :: Region -> [Syn.Variable]
    reqRegions' :: Region -> [Variable]
reqRegions' RegionConst{} = []
    reqRegions' (Or Region
r1 Region
r2)    = Region -> [Variable]
reqRegions' Region
r1 [Variable] -> [Variable] -> [Variable]
forall a. [a] -> [a] -> [a]
++ Region -> [Variable]
reqRegions' Region
r2
    reqRegions' (And Region
r1 Region
r2)   = Region -> [Variable]
reqRegions' Region
r1 [Variable] -> [Variable] -> [Variable]
forall a. [a] -> [a] -> [a]
++ Region -> [Variable]
reqRegions' Region
r2
    reqRegions' (Var Variable
v)       = [Variable
v]

data Region
  = RegionConst Syn.Region
  | Or Region Region
  | And Region Region
  | Var String
  deriving (Int -> Region -> ShowS
[Region] -> ShowS
Region -> Variable
(Int -> Region -> ShowS)
-> (Region -> Variable) -> ([Region] -> ShowS) -> Show Region
forall a.
(Int -> a -> ShowS) -> (a -> Variable) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Region -> ShowS
showsPrec :: Int -> Region -> ShowS
$cshow :: Region -> Variable
show :: Region -> Variable
$cshowList :: [Region] -> ShowS
showList :: [Region] -> ShowS
Show, Region -> Region -> Bool
(Region -> Region -> Bool)
-> (Region -> Region -> Bool) -> Eq Region
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Region -> Region -> Bool
== :: Region -> Region -> Bool
$c/= :: Region -> Region -> Bool
/= :: Region -> Region -> Bool
Eq, Eq Region
Eq Region
-> (Region -> Region -> Ordering)
-> (Region -> Region -> Bool)
-> (Region -> Region -> Bool)
-> (Region -> Region -> Bool)
-> (Region -> Region -> Bool)
-> (Region -> Region -> Region)
-> (Region -> Region -> Region)
-> Ord Region
Region -> Region -> Bool
Region -> Region -> Ordering
Region -> Region -> Region
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Region -> Region -> Ordering
compare :: Region -> Region -> Ordering
$c< :: Region -> Region -> Bool
< :: Region -> Region -> Bool
$c<= :: Region -> Region -> Bool
<= :: Region -> Region -> Bool
$c> :: Region -> Region -> Bool
> :: Region -> Region -> Bool
$c>= :: Region -> Region -> Bool
>= :: Region -> Region -> Bool
$cmax :: Region -> Region -> Region
max :: Region -> Region -> Region
$cmin :: Region -> Region -> Region
min :: Region -> Region -> Region
Ord, Typeable, Typeable Region
Typeable Region
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Region -> c Region)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Region)
-> (Region -> Constr)
-> (Region -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Region))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Region))
-> ((forall b. Data b => b -> b) -> Region -> Region)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Region -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Region -> r)
-> (forall u. (forall d. Data d => d -> u) -> Region -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Region -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Region -> m Region)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Region -> m Region)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Region -> m Region)
-> Data Region
Region -> Constr
Region -> DataType
(forall b. Data b => b -> b) -> Region -> Region
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) -> Region -> u
forall u. (forall d. Data d => d -> u) -> Region -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Region -> m Region
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Region -> m Region
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Region
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Region -> c Region
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Region)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Region)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Region -> c Region
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Region -> c Region
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Region
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Region
$ctoConstr :: Region -> Constr
toConstr :: Region -> Constr
$cdataTypeOf :: Region -> DataType
dataTypeOf :: Region -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Region)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Region)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Region)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Region)
$cgmapT :: (forall b. Data b => b -> b) -> Region -> Region
gmapT :: (forall b. Data b => b -> b) -> Region -> Region
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Region -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Region -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Region -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Region -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Region -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Region -> m Region
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Region -> m Region
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Region -> m Region
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Region -> m Region
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Region -> m Region
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Region -> m Region
Data)

data SpecInner = SpecInner
    (Multiplicity (Approximation Region))  -- main specification content
    Syn.IsStencil                          -- a bool: stencil or access
  deriving (Int -> SpecInner -> ShowS
[SpecInner] -> ShowS
SpecInner -> Variable
(Int -> SpecInner -> ShowS)
-> (SpecInner -> Variable)
-> ([SpecInner] -> ShowS)
-> Show SpecInner
forall a.
(Int -> a -> ShowS) -> (a -> Variable) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SpecInner -> ShowS
showsPrec :: Int -> SpecInner -> ShowS
$cshow :: SpecInner -> Variable
show :: SpecInner -> Variable
$cshowList :: [SpecInner] -> ShowS
showList :: [SpecInner] -> ShowS
Show, SpecInner -> SpecInner -> Bool
(SpecInner -> SpecInner -> Bool)
-> (SpecInner -> SpecInner -> Bool) -> Eq SpecInner
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SpecInner -> SpecInner -> Bool
== :: SpecInner -> SpecInner -> Bool
$c/= :: SpecInner -> SpecInner -> Bool
/= :: SpecInner -> SpecInner -> Bool
Eq, Typeable, Typeable SpecInner
Typeable SpecInner
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> SpecInner -> c SpecInner)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SpecInner)
-> (SpecInner -> Constr)
-> (SpecInner -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SpecInner))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpecInner))
-> ((forall b. Data b => b -> b) -> SpecInner -> SpecInner)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SpecInner -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SpecInner -> r)
-> (forall u. (forall d. Data d => d -> u) -> SpecInner -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SpecInner -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SpecInner -> m SpecInner)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SpecInner -> m SpecInner)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SpecInner -> m SpecInner)
-> Data SpecInner
SpecInner -> Constr
SpecInner -> DataType
(forall b. Data b => b -> b) -> SpecInner -> SpecInner
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) -> SpecInner -> u
forall u. (forall d. Data d => d -> u) -> SpecInner -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SpecInner -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SpecInner -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SpecInner
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SpecInner -> c SpecInner
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SpecInner)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpecInner)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SpecInner -> c SpecInner
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SpecInner -> c SpecInner
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SpecInner
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SpecInner
$ctoConstr :: SpecInner -> Constr
toConstr :: SpecInner -> Constr
$cdataTypeOf :: SpecInner -> DataType
dataTypeOf :: SpecInner -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SpecInner)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SpecInner)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpecInner)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpecInner)
$cgmapT :: (forall b. Data b => b -> b) -> SpecInner -> SpecInner
gmapT :: (forall b. Data b => b -> b) -> SpecInner -> SpecInner
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SpecInner -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SpecInner -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SpecInner -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SpecInner -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SpecInner -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SpecInner -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SpecInner -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SpecInner -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SpecInner -> m SpecInner
Data)