{-# LANGUAGE DeriveDataTypeable #-}
module Rattus.Plugin.Annotation (Rattus(..), InternalAnn (..)) where

import Data.Data

-- | Use this type to mark a Haskell function definition as a Rattus
-- function:
--
-- > {-# ANN myFunction Rattus #-}
-- 
-- Or mark a whole module as consisting of Rattus functions only:
--
-- > {-# ANN module Rattus #-}
--
-- If you use the latter option, you can mark exceptions
-- (i.e. functions that should be treated as ordinary Haskell function
-- definitions) as follows:
--
-- > {-# ANN myFunction NotRattus #-}
--
-- By default all Rattus functions are checked for use of lazy data
-- types, since these may cause memory leaks. If any lazy data types
-- are used, a warning is issued. These warnings can be disabled by
-- annotating the module or the function with 'AllowLazyData'
--
-- > {-# ANN myFunction AllowLazyData #-}
-- >
-- > {-# ANN module AllowLazyData #-}
--
-- Rattus only allows guarded recursion, i.e. recursive calls must
-- occur in the scope of a tick. Structural recursion over strict data
-- types is safe as well, but is currently not checked. To disable the
-- guarded recursion check, annotate the module or function with
-- 'AllowRecursion'.

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


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