{- | Giml AST definition
-}

{-# language OverloadedStrings #-}

module Language.Giml.Syntax.Ast
  ( -- * Language definition
    module Language.Giml.Syntax.Ast
  -- * Common data types
  , module Language.Giml.Common
  -- * Giml types
  , module Language.Giml.Types.Types
  )
where

import Utils
import qualified Data.Text as T
import qualified Data.Map as M

import Language.Giml.Types.Types
import Language.Giml.Common

-- * Language definition

-- | The type of a source file as seen by the parser
data ParsedFile a
  = ParsedFile [Definition a]
  deriving (Int -> ParsedFile a -> ShowS
[ParsedFile a] -> ShowS
ParsedFile a -> String
(Int -> ParsedFile a -> ShowS)
-> (ParsedFile a -> String)
-> ([ParsedFile a] -> ShowS)
-> Show (ParsedFile a)
forall a. Show a => Int -> ParsedFile a -> ShowS
forall a. Show a => [ParsedFile a] -> ShowS
forall a. Show a => ParsedFile a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParsedFile a] -> ShowS
$cshowList :: forall a. Show a => [ParsedFile a] -> ShowS
show :: ParsedFile a -> String
$cshow :: forall a. Show a => ParsedFile a -> String
showsPrec :: Int -> ParsedFile a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> ParsedFile a -> ShowS
Show, ParsedFile a -> ParsedFile a -> Bool
(ParsedFile a -> ParsedFile a -> Bool)
-> (ParsedFile a -> ParsedFile a -> Bool) -> Eq (ParsedFile a)
forall a. Eq a => ParsedFile a -> ParsedFile a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParsedFile a -> ParsedFile a -> Bool
$c/= :: forall a. Eq a => ParsedFile a -> ParsedFile a -> Bool
== :: ParsedFile a -> ParsedFile a -> Bool
$c== :: forall a. Eq a => ParsedFile a -> ParsedFile a -> Bool
Eq, Eq (ParsedFile a)
Eq (ParsedFile a)
-> (ParsedFile a -> ParsedFile a -> Ordering)
-> (ParsedFile a -> ParsedFile a -> Bool)
-> (ParsedFile a -> ParsedFile a -> Bool)
-> (ParsedFile a -> ParsedFile a -> Bool)
-> (ParsedFile a -> ParsedFile a -> Bool)
-> (ParsedFile a -> ParsedFile a -> ParsedFile a)
-> (ParsedFile a -> ParsedFile a -> ParsedFile a)
-> Ord (ParsedFile a)
ParsedFile a -> ParsedFile a -> Bool
ParsedFile a -> ParsedFile a -> Ordering
ParsedFile a -> ParsedFile a -> ParsedFile a
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
forall a. Ord a => Eq (ParsedFile a)
forall a. Ord a => ParsedFile a -> ParsedFile a -> Bool
forall a. Ord a => ParsedFile a -> ParsedFile a -> Ordering
forall a. Ord a => ParsedFile a -> ParsedFile a -> ParsedFile a
min :: ParsedFile a -> ParsedFile a -> ParsedFile a
$cmin :: forall a. Ord a => ParsedFile a -> ParsedFile a -> ParsedFile a
max :: ParsedFile a -> ParsedFile a -> ParsedFile a
$cmax :: forall a. Ord a => ParsedFile a -> ParsedFile a -> ParsedFile a
>= :: ParsedFile a -> ParsedFile a -> Bool
$c>= :: forall a. Ord a => ParsedFile a -> ParsedFile a -> Bool
> :: ParsedFile a -> ParsedFile a -> Bool
$c> :: forall a. Ord a => ParsedFile a -> ParsedFile a -> Bool
<= :: ParsedFile a -> ParsedFile a -> Bool
$c<= :: forall a. Ord a => ParsedFile a -> ParsedFile a -> Bool
< :: ParsedFile a -> ParsedFile a -> Bool
$c< :: forall a. Ord a => ParsedFile a -> ParsedFile a -> Bool
compare :: ParsedFile a -> ParsedFile a -> Ordering
$ccompare :: forall a. Ord a => ParsedFile a -> ParsedFile a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (ParsedFile a)
Ord, Typeable (ParsedFile a)
DataType
Constr
Typeable (ParsedFile a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ParsedFile a))
-> (ParsedFile a -> Constr)
-> (ParsedFile a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (ParsedFile a)))
-> ((forall b. Data b => b -> b) -> ParsedFile a -> ParsedFile a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r)
-> (forall u. (forall d. Data d => d -> u) -> ParsedFile a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ParsedFile a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a))
-> Data (ParsedFile a)
ParsedFile a -> DataType
ParsedFile a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a))
(forall b. Data b => b -> b) -> ParsedFile a -> ParsedFile a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ParsedFile a)
forall a. Data a => Typeable (ParsedFile a)
forall a. Data a => ParsedFile a -> DataType
forall a. Data a => ParsedFile a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> ParsedFile a -> ParsedFile a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ParsedFile a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> ParsedFile a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ParsedFile a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ParsedFile 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) -> ParsedFile a -> u
forall u. (forall d. Data d => d -> u) -> ParsedFile a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ParsedFile a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ParsedFile a))
$cParsedFile :: Constr
$tParsedFile :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
gmapMp :: (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
gmapM :: (forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> ParsedFile a -> m (ParsedFile a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> ParsedFile a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> ParsedFile a -> u
gmapQ :: (forall d. Data d => d -> u) -> ParsedFile a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> ParsedFile a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ParsedFile a -> r
gmapT :: (forall b. Data b => b -> b) -> ParsedFile a -> ParsedFile a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> ParsedFile a -> ParsedFile a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ParsedFile a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (ParsedFile a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (ParsedFile a))
dataTypeOf :: ParsedFile a -> DataType
$cdataTypeOf :: forall a. Data a => ParsedFile a -> DataType
toConstr :: ParsedFile a -> Constr
$ctoConstr :: forall a. Data a => ParsedFile a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ParsedFile a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (ParsedFile a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ParsedFile a -> c (ParsedFile a)
$cp1Data :: forall a. Data a => Typeable (ParsedFile a)
Data, a -> ParsedFile b -> ParsedFile a
(a -> b) -> ParsedFile a -> ParsedFile b
(forall a b. (a -> b) -> ParsedFile a -> ParsedFile b)
-> (forall a b. a -> ParsedFile b -> ParsedFile a)
-> Functor ParsedFile
forall a b. a -> ParsedFile b -> ParsedFile a
forall a b. (a -> b) -> ParsedFile a -> ParsedFile b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> ParsedFile b -> ParsedFile a
$c<$ :: forall a b. a -> ParsedFile b -> ParsedFile a
fmap :: (a -> b) -> ParsedFile a -> ParsedFile b
$cfmap :: forall a b. (a -> b) -> ParsedFile a -> ParsedFile b
Functor, ParsedFile a -> Bool
(a -> m) -> ParsedFile a -> m
(a -> b -> b) -> b -> ParsedFile a -> b
(forall m. Monoid m => ParsedFile m -> m)
-> (forall m a. Monoid m => (a -> m) -> ParsedFile a -> m)
-> (forall m a. Monoid m => (a -> m) -> ParsedFile a -> m)
-> (forall a b. (a -> b -> b) -> b -> ParsedFile a -> b)
-> (forall a b. (a -> b -> b) -> b -> ParsedFile a -> b)
-> (forall b a. (b -> a -> b) -> b -> ParsedFile a -> b)
-> (forall b a. (b -> a -> b) -> b -> ParsedFile a -> b)
-> (forall a. (a -> a -> a) -> ParsedFile a -> a)
-> (forall a. (a -> a -> a) -> ParsedFile a -> a)
-> (forall a. ParsedFile a -> [a])
-> (forall a. ParsedFile a -> Bool)
-> (forall a. ParsedFile a -> Int)
-> (forall a. Eq a => a -> ParsedFile a -> Bool)
-> (forall a. Ord a => ParsedFile a -> a)
-> (forall a. Ord a => ParsedFile a -> a)
-> (forall a. Num a => ParsedFile a -> a)
-> (forall a. Num a => ParsedFile a -> a)
-> Foldable ParsedFile
forall a. Eq a => a -> ParsedFile a -> Bool
forall a. Num a => ParsedFile a -> a
forall a. Ord a => ParsedFile a -> a
forall m. Monoid m => ParsedFile m -> m
forall a. ParsedFile a -> Bool
forall a. ParsedFile a -> Int
forall a. ParsedFile a -> [a]
forall a. (a -> a -> a) -> ParsedFile a -> a
forall m a. Monoid m => (a -> m) -> ParsedFile a -> m
forall b a. (b -> a -> b) -> b -> ParsedFile a -> b
forall a b. (a -> b -> b) -> b -> ParsedFile 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 :: ParsedFile a -> a
$cproduct :: forall a. Num a => ParsedFile a -> a
sum :: ParsedFile a -> a
$csum :: forall a. Num a => ParsedFile a -> a
minimum :: ParsedFile a -> a
$cminimum :: forall a. Ord a => ParsedFile a -> a
maximum :: ParsedFile a -> a
$cmaximum :: forall a. Ord a => ParsedFile a -> a
elem :: a -> ParsedFile a -> Bool
$celem :: forall a. Eq a => a -> ParsedFile a -> Bool
length :: ParsedFile a -> Int
$clength :: forall a. ParsedFile a -> Int
null :: ParsedFile a -> Bool
$cnull :: forall a. ParsedFile a -> Bool
toList :: ParsedFile a -> [a]
$ctoList :: forall a. ParsedFile a -> [a]
foldl1 :: (a -> a -> a) -> ParsedFile a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> ParsedFile a -> a
foldr1 :: (a -> a -> a) -> ParsedFile a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> ParsedFile a -> a
foldl' :: (b -> a -> b) -> b -> ParsedFile a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> ParsedFile a -> b
foldl :: (b -> a -> b) -> b -> ParsedFile a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> ParsedFile a -> b
foldr' :: (a -> b -> b) -> b -> ParsedFile a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> ParsedFile a -> b
foldr :: (a -> b -> b) -> b -> ParsedFile a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> ParsedFile a -> b
foldMap' :: (a -> m) -> ParsedFile a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> ParsedFile a -> m
foldMap :: (a -> m) -> ParsedFile a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> ParsedFile a -> m
fold :: ParsedFile m -> m
$cfold :: forall m. Monoid m => ParsedFile m -> m
Foldable, Functor ParsedFile
Foldable ParsedFile
Functor ParsedFile
-> Foldable ParsedFile
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ParsedFile a -> f (ParsedFile b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ParsedFile (f a) -> f (ParsedFile a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ParsedFile a -> m (ParsedFile b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ParsedFile (m a) -> m (ParsedFile a))
-> Traversable ParsedFile
(a -> f b) -> ParsedFile a -> f (ParsedFile 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 =>
ParsedFile (m a) -> m (ParsedFile a)
forall (f :: * -> *) a.
Applicative f =>
ParsedFile (f a) -> f (ParsedFile a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ParsedFile a -> m (ParsedFile b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ParsedFile a -> f (ParsedFile b)
sequence :: ParsedFile (m a) -> m (ParsedFile a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
ParsedFile (m a) -> m (ParsedFile a)
mapM :: (a -> m b) -> ParsedFile a -> m (ParsedFile b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> ParsedFile a -> m (ParsedFile b)
sequenceA :: ParsedFile (f a) -> f (ParsedFile a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
ParsedFile (f a) -> f (ParsedFile a)
traverse :: (a -> f b) -> ParsedFile a -> f (ParsedFile b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> ParsedFile a -> f (ParsedFile b)
$cp2Traversable :: Foldable ParsedFile
$cp1Traversable :: Functor ParsedFile
Traversable)

-- | The type of a source file after ordering and grouping
data File a
  = File [Datatype a] [[TermDef a]]
  deriving (Int -> File a -> ShowS
[File a] -> ShowS
File a -> String
(Int -> File a -> ShowS)
-> (File a -> String) -> ([File a] -> ShowS) -> Show (File a)
forall a. Show a => Int -> File a -> ShowS
forall a. Show a => [File a] -> ShowS
forall a. Show a => File a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [File a] -> ShowS
$cshowList :: forall a. Show a => [File a] -> ShowS
show :: File a -> String
$cshow :: forall a. Show a => File a -> String
showsPrec :: Int -> File a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> File a -> ShowS
Show, File a -> File a -> Bool
(File a -> File a -> Bool)
-> (File a -> File a -> Bool) -> Eq (File a)
forall a. Eq a => File a -> File a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: File a -> File a -> Bool
$c/= :: forall a. Eq a => File a -> File a -> Bool
== :: File a -> File a -> Bool
$c== :: forall a. Eq a => File a -> File a -> Bool
Eq, Eq (File a)
Eq (File a)
-> (File a -> File a -> Ordering)
-> (File a -> File a -> Bool)
-> (File a -> File a -> Bool)
-> (File a -> File a -> Bool)
-> (File a -> File a -> Bool)
-> (File a -> File a -> File a)
-> (File a -> File a -> File a)
-> Ord (File a)
File a -> File a -> Bool
File a -> File a -> Ordering
File a -> File a -> File a
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
forall a. Ord a => Eq (File a)
forall a. Ord a => File a -> File a -> Bool
forall a. Ord a => File a -> File a -> Ordering
forall a. Ord a => File a -> File a -> File a
min :: File a -> File a -> File a
$cmin :: forall a. Ord a => File a -> File a -> File a
max :: File a -> File a -> File a
$cmax :: forall a. Ord a => File a -> File a -> File a
>= :: File a -> File a -> Bool
$c>= :: forall a. Ord a => File a -> File a -> Bool
> :: File a -> File a -> Bool
$c> :: forall a. Ord a => File a -> File a -> Bool
<= :: File a -> File a -> Bool
$c<= :: forall a. Ord a => File a -> File a -> Bool
< :: File a -> File a -> Bool
$c< :: forall a. Ord a => File a -> File a -> Bool
compare :: File a -> File a -> Ordering
$ccompare :: forall a. Ord a => File a -> File a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (File a)
Ord, Typeable (File a)
DataType
Constr
Typeable (File a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> File a -> c (File a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (File a))
-> (File a -> Constr)
-> (File a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (File a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (File a)))
-> ((forall b. Data b => b -> b) -> File a -> File a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> File a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> File a -> r)
-> (forall u. (forall d. Data d => d -> u) -> File a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> File a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> File a -> m (File a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> File a -> m (File a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> File a -> m (File a))
-> Data (File a)
File a -> DataType
File a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (File a))
(forall b. Data b => b -> b) -> File a -> File a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> File a -> c (File a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (File a)
forall a. Data a => Typeable (File a)
forall a. Data a => File a -> DataType
forall a. Data a => File a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> File a -> File a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> File a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> File a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (File a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> File a -> c (File a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (File a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (File 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) -> File a -> u
forall u. (forall d. Data d => d -> u) -> File a -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (File a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> File a -> c (File a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (File a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (File a))
$cFile :: Constr
$tFile :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> File a -> m (File a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
gmapMp :: (forall d. Data d => d -> m d) -> File a -> m (File a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
gmapM :: (forall d. Data d => d -> m d) -> File a -> m (File a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> File a -> m (File a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> File a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> File a -> u
gmapQ :: (forall d. Data d => d -> u) -> File a -> [u]
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> File a -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> File a -> r
gmapT :: (forall b. Data b => b -> b) -> File a -> File a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> File a -> File a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (File a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (File a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (File a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (File a))
dataTypeOf :: File a -> DataType
$cdataTypeOf :: forall a. Data a => File a -> DataType
toConstr :: File a -> Constr
$ctoConstr :: forall a. Data a => File a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (File a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (File a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> File a -> c (File a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> File a -> c (File a)
$cp1Data :: forall a. Data a => Typeable (File a)
Data, a -> File b -> File a
(a -> b) -> File a -> File b
(forall a b. (a -> b) -> File a -> File b)
-> (forall a b. a -> File b -> File a) -> Functor File
forall a b. a -> File b -> File a
forall a b. (a -> b) -> File a -> File b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> File b -> File a
$c<$ :: forall a b. a -> File b -> File a
fmap :: (a -> b) -> File a -> File b
$cfmap :: forall a b. (a -> b) -> File a -> File b
Functor, File a -> Bool
(a -> m) -> File a -> m
(a -> b -> b) -> b -> File a -> b
(forall m. Monoid m => File m -> m)
-> (forall m a. Monoid m => (a -> m) -> File a -> m)
-> (forall m a. Monoid m => (a -> m) -> File a -> m)
-> (forall a b. (a -> b -> b) -> b -> File a -> b)
-> (forall a b. (a -> b -> b) -> b -> File a -> b)
-> (forall b a. (b -> a -> b) -> b -> File a -> b)
-> (forall b a. (b -> a -> b) -> b -> File a -> b)
-> (forall a. (a -> a -> a) -> File a -> a)
-> (forall a. (a -> a -> a) -> File a -> a)
-> (forall a. File a -> [a])
-> (forall a. File a -> Bool)
-> (forall a. File a -> Int)
-> (forall a. Eq a => a -> File a -> Bool)
-> (forall a. Ord a => File a -> a)
-> (forall a. Ord a => File a -> a)
-> (forall a. Num a => File a -> a)
-> (forall a. Num a => File a -> a)
-> Foldable File
forall a. Eq a => a -> File a -> Bool
forall a. Num a => File a -> a
forall a. Ord a => File a -> a
forall m. Monoid m => File m -> m
forall a. File a -> Bool
forall a. File a -> Int
forall a. File a -> [a]
forall a. (a -> a -> a) -> File a -> a
forall m a. Monoid m => (a -> m) -> File a -> m
forall b a. (b -> a -> b) -> b -> File a -> b
forall a b. (a -> b -> b) -> b -> File 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 :: File a -> a
$cproduct :: forall a. Num a => File a -> a
sum :: File a -> a
$csum :: forall a. Num a => File a -> a
minimum :: File a -> a
$cminimum :: forall a. Ord a => File a -> a
maximum :: File a -> a
$cmaximum :: forall a. Ord a => File a -> a
elem :: a -> File a -> Bool
$celem :: forall a. Eq a => a -> File a -> Bool
length :: File a -> Int
$clength :: forall a. File a -> Int
null :: File a -> Bool
$cnull :: forall a. File a -> Bool
toList :: File a -> [a]
$ctoList :: forall a. File a -> [a]
foldl1 :: (a -> a -> a) -> File a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> File a -> a
foldr1 :: (a -> a -> a) -> File a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> File a -> a
foldl' :: (b -> a -> b) -> b -> File a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> File a -> b
foldl :: (b -> a -> b) -> b -> File a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> File a -> b
foldr' :: (a -> b -> b) -> b -> File a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> File a -> b
foldr :: (a -> b -> b) -> b -> File a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> File a -> b
foldMap' :: (a -> m) -> File a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> File a -> m
foldMap :: (a -> m) -> File a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> File a -> m
fold :: File m -> m
$cfold :: forall m. Monoid m => File m -> m
Foldable, Functor File
Foldable File
Functor File
-> Foldable File
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> File a -> f (File b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    File (f a) -> f (File a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> File a -> m (File b))
-> (forall (m :: * -> *) a. Monad m => File (m a) -> m (File a))
-> Traversable File
(a -> f b) -> File a -> f (File 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 => File (m a) -> m (File a)
forall (f :: * -> *) a. Applicative f => File (f a) -> f (File a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> File a -> m (File b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> File a -> f (File b)
sequence :: File (m a) -> m (File a)
$csequence :: forall (m :: * -> *) a. Monad m => File (m a) -> m (File a)
mapM :: (a -> m b) -> File a -> m (File b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> File a -> m (File b)
sequenceA :: File (f a) -> f (File a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => File (f a) -> f (File a)
traverse :: (a -> f b) -> File a -> f (File b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> File a -> f (File b)
$cp2Traversable :: Foldable File
$cp1Traversable :: Functor File
Traversable)

-- | A top level definition
data Definition a
  = TypeDef (Datatype a) -- ^ A type definition
  | TermDef (TermDef a) -- ^ A term definition
  deriving (Int -> Definition a -> ShowS
[Definition a] -> ShowS
Definition a -> String
(Int -> Definition a -> ShowS)
-> (Definition a -> String)
-> ([Definition a] -> ShowS)
-> Show (Definition a)
forall a. Show a => Int -> Definition a -> ShowS
forall a. Show a => [Definition a] -> ShowS
forall a. Show a => Definition a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Definition a] -> ShowS
$cshowList :: forall a. Show a => [Definition a] -> ShowS
show :: Definition a -> String
$cshow :: forall a. Show a => Definition a -> String
showsPrec :: Int -> Definition a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Definition a -> ShowS
Show, Definition a -> Definition a -> Bool
(Definition a -> Definition a -> Bool)
-> (Definition a -> Definition a -> Bool) -> Eq (Definition a)
forall a. Eq a => Definition a -> Definition a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Definition a -> Definition a -> Bool
$c/= :: forall a. Eq a => Definition a -> Definition a -> Bool
== :: Definition a -> Definition a -> Bool
$c== :: forall a. Eq a => Definition a -> Definition a -> Bool
Eq, Eq (Definition a)
Eq (Definition a)
-> (Definition a -> Definition a -> Ordering)
-> (Definition a -> Definition a -> Bool)
-> (Definition a -> Definition a -> Bool)
-> (Definition a -> Definition a -> Bool)
-> (Definition a -> Definition a -> Bool)
-> (Definition a -> Definition a -> Definition a)
-> (Definition a -> Definition a -> Definition a)
-> Ord (Definition a)
Definition a -> Definition a -> Bool
Definition a -> Definition a -> Ordering
Definition a -> Definition a -> Definition a
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
forall a. Ord a => Eq (Definition a)
forall a. Ord a => Definition a -> Definition a -> Bool
forall a. Ord a => Definition a -> Definition a -> Ordering
forall a. Ord a => Definition a -> Definition a -> Definition a
min :: Definition a -> Definition a -> Definition a
$cmin :: forall a. Ord a => Definition a -> Definition a -> Definition a
max :: Definition a -> Definition a -> Definition a
$cmax :: forall a. Ord a => Definition a -> Definition a -> Definition a
>= :: Definition a -> Definition a -> Bool
$c>= :: forall a. Ord a => Definition a -> Definition a -> Bool
> :: Definition a -> Definition a -> Bool
$c> :: forall a. Ord a => Definition a -> Definition a -> Bool
<= :: Definition a -> Definition a -> Bool
$c<= :: forall a. Ord a => Definition a -> Definition a -> Bool
< :: Definition a -> Definition a -> Bool
$c< :: forall a. Ord a => Definition a -> Definition a -> Bool
compare :: Definition a -> Definition a -> Ordering
$ccompare :: forall a. Ord a => Definition a -> Definition a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Definition a)
Ord, Typeable (Definition a)
DataType
Constr
Typeable (Definition a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Definition a -> c (Definition a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Definition a))
-> (Definition a -> Constr)
-> (Definition a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Definition a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Definition a)))
-> ((forall b. Data b => b -> b) -> Definition a -> Definition a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Definition a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Definition a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Definition a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Definition a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Definition a -> m (Definition a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Definition a -> m (Definition a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Definition a -> m (Definition a))
-> Data (Definition a)
Definition a -> DataType
Definition a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Definition a))
(forall b. Data b => b -> b) -> Definition a -> Definition a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Definition a -> c (Definition a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Definition a)
forall a. Data a => Typeable (Definition a)
forall a. Data a => Definition a -> DataType
forall a. Data a => Definition a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Definition a -> Definition a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Definition a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Definition a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Definition a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Definition a -> c (Definition a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Definition a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Definition 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) -> Definition a -> u
forall u. (forall d. Data d => d -> u) -> Definition a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Definition a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Definition a -> c (Definition a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Definition a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Definition a))
$cTermDef :: Constr
$cTypeDef :: Constr
$tDefinition :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
gmapMp :: (forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
gmapM :: (forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Definition a -> m (Definition a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Definition a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Definition a -> u
gmapQ :: (forall d. Data d => d -> u) -> Definition a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Definition a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Definition a -> r
gmapT :: (forall b. Data b => b -> b) -> Definition a -> Definition a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Definition a -> Definition a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Definition a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Definition a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Definition a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Definition a))
dataTypeOf :: Definition a -> DataType
$cdataTypeOf :: forall a. Data a => Definition a -> DataType
toConstr :: Definition a -> Constr
$ctoConstr :: forall a. Data a => Definition a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Definition a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Definition a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Definition a -> c (Definition a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Definition a -> c (Definition a)
$cp1Data :: forall a. Data a => Typeable (Definition a)
Data, a -> Definition b -> Definition a
(a -> b) -> Definition a -> Definition b
(forall a b. (a -> b) -> Definition a -> Definition b)
-> (forall a b. a -> Definition b -> Definition a)
-> Functor Definition
forall a b. a -> Definition b -> Definition a
forall a b. (a -> b) -> Definition a -> Definition b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Definition b -> Definition a
$c<$ :: forall a b. a -> Definition b -> Definition a
fmap :: (a -> b) -> Definition a -> Definition b
$cfmap :: forall a b. (a -> b) -> Definition a -> Definition b
Functor, Definition a -> Bool
(a -> m) -> Definition a -> m
(a -> b -> b) -> b -> Definition a -> b
(forall m. Monoid m => Definition m -> m)
-> (forall m a. Monoid m => (a -> m) -> Definition a -> m)
-> (forall m a. Monoid m => (a -> m) -> Definition a -> m)
-> (forall a b. (a -> b -> b) -> b -> Definition a -> b)
-> (forall a b. (a -> b -> b) -> b -> Definition a -> b)
-> (forall b a. (b -> a -> b) -> b -> Definition a -> b)
-> (forall b a. (b -> a -> b) -> b -> Definition a -> b)
-> (forall a. (a -> a -> a) -> Definition a -> a)
-> (forall a. (a -> a -> a) -> Definition a -> a)
-> (forall a. Definition a -> [a])
-> (forall a. Definition a -> Bool)
-> (forall a. Definition a -> Int)
-> (forall a. Eq a => a -> Definition a -> Bool)
-> (forall a. Ord a => Definition a -> a)
-> (forall a. Ord a => Definition a -> a)
-> (forall a. Num a => Definition a -> a)
-> (forall a. Num a => Definition a -> a)
-> Foldable Definition
forall a. Eq a => a -> Definition a -> Bool
forall a. Num a => Definition a -> a
forall a. Ord a => Definition a -> a
forall m. Monoid m => Definition m -> m
forall a. Definition a -> Bool
forall a. Definition a -> Int
forall a. Definition a -> [a]
forall a. (a -> a -> a) -> Definition a -> a
forall m a. Monoid m => (a -> m) -> Definition a -> m
forall b a. (b -> a -> b) -> b -> Definition a -> b
forall a b. (a -> b -> b) -> b -> Definition 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 :: Definition a -> a
$cproduct :: forall a. Num a => Definition a -> a
sum :: Definition a -> a
$csum :: forall a. Num a => Definition a -> a
minimum :: Definition a -> a
$cminimum :: forall a. Ord a => Definition a -> a
maximum :: Definition a -> a
$cmaximum :: forall a. Ord a => Definition a -> a
elem :: a -> Definition a -> Bool
$celem :: forall a. Eq a => a -> Definition a -> Bool
length :: Definition a -> Int
$clength :: forall a. Definition a -> Int
null :: Definition a -> Bool
$cnull :: forall a. Definition a -> Bool
toList :: Definition a -> [a]
$ctoList :: forall a. Definition a -> [a]
foldl1 :: (a -> a -> a) -> Definition a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Definition a -> a
foldr1 :: (a -> a -> a) -> Definition a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Definition a -> a
foldl' :: (b -> a -> b) -> b -> Definition a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Definition a -> b
foldl :: (b -> a -> b) -> b -> Definition a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Definition a -> b
foldr' :: (a -> b -> b) -> b -> Definition a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Definition a -> b
foldr :: (a -> b -> b) -> b -> Definition a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Definition a -> b
foldMap' :: (a -> m) -> Definition a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Definition a -> m
foldMap :: (a -> m) -> Definition a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Definition a -> m
fold :: Definition m -> m
$cfold :: forall m. Monoid m => Definition m -> m
Foldable, Functor Definition
Foldable Definition
Functor Definition
-> Foldable Definition
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Definition a -> f (Definition b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Definition (f a) -> f (Definition a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Definition a -> m (Definition b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Definition (m a) -> m (Definition a))
-> Traversable Definition
(a -> f b) -> Definition a -> f (Definition 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 =>
Definition (m a) -> m (Definition a)
forall (f :: * -> *) a.
Applicative f =>
Definition (f a) -> f (Definition a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Definition a -> m (Definition b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Definition a -> f (Definition b)
sequence :: Definition (m a) -> m (Definition a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
Definition (m a) -> m (Definition a)
mapM :: (a -> m b) -> Definition a -> m (Definition b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Definition a -> m (Definition b)
sequenceA :: Definition (f a) -> f (Definition a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Definition (f a) -> f (Definition a)
traverse :: (a -> f b) -> Definition a -> f (Definition b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Definition a -> f (Definition b)
$cp2Traversable :: Foldable Definition
$cp1Traversable :: Functor Definition
Traversable)

-- | A term definition
data TermDef a
  = Variable a Var (Expr a) -- ^ A variable
  | Function a Var [Maybe Var] (Expr a) -- ^ A function
  deriving (Int -> TermDef a -> ShowS
[TermDef a] -> ShowS
TermDef a -> String
(Int -> TermDef a -> ShowS)
-> (TermDef a -> String)
-> ([TermDef a] -> ShowS)
-> Show (TermDef a)
forall a. Show a => Int -> TermDef a -> ShowS
forall a. Show a => [TermDef a] -> ShowS
forall a. Show a => TermDef a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TermDef a] -> ShowS
$cshowList :: forall a. Show a => [TermDef a] -> ShowS
show :: TermDef a -> String
$cshow :: forall a. Show a => TermDef a -> String
showsPrec :: Int -> TermDef a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> TermDef a -> ShowS
Show, TermDef a -> TermDef a -> Bool
(TermDef a -> TermDef a -> Bool)
-> (TermDef a -> TermDef a -> Bool) -> Eq (TermDef a)
forall a. Eq a => TermDef a -> TermDef a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TermDef a -> TermDef a -> Bool
$c/= :: forall a. Eq a => TermDef a -> TermDef a -> Bool
== :: TermDef a -> TermDef a -> Bool
$c== :: forall a. Eq a => TermDef a -> TermDef a -> Bool
Eq, Eq (TermDef a)
Eq (TermDef a)
-> (TermDef a -> TermDef a -> Ordering)
-> (TermDef a -> TermDef a -> Bool)
-> (TermDef a -> TermDef a -> Bool)
-> (TermDef a -> TermDef a -> Bool)
-> (TermDef a -> TermDef a -> Bool)
-> (TermDef a -> TermDef a -> TermDef a)
-> (TermDef a -> TermDef a -> TermDef a)
-> Ord (TermDef a)
TermDef a -> TermDef a -> Bool
TermDef a -> TermDef a -> Ordering
TermDef a -> TermDef a -> TermDef a
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
forall a. Ord a => Eq (TermDef a)
forall a. Ord a => TermDef a -> TermDef a -> Bool
forall a. Ord a => TermDef a -> TermDef a -> Ordering
forall a. Ord a => TermDef a -> TermDef a -> TermDef a
min :: TermDef a -> TermDef a -> TermDef a
$cmin :: forall a. Ord a => TermDef a -> TermDef a -> TermDef a
max :: TermDef a -> TermDef a -> TermDef a
$cmax :: forall a. Ord a => TermDef a -> TermDef a -> TermDef a
>= :: TermDef a -> TermDef a -> Bool
$c>= :: forall a. Ord a => TermDef a -> TermDef a -> Bool
> :: TermDef a -> TermDef a -> Bool
$c> :: forall a. Ord a => TermDef a -> TermDef a -> Bool
<= :: TermDef a -> TermDef a -> Bool
$c<= :: forall a. Ord a => TermDef a -> TermDef a -> Bool
< :: TermDef a -> TermDef a -> Bool
$c< :: forall a. Ord a => TermDef a -> TermDef a -> Bool
compare :: TermDef a -> TermDef a -> Ordering
$ccompare :: forall a. Ord a => TermDef a -> TermDef a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (TermDef a)
Ord, Typeable (TermDef a)
DataType
Constr
Typeable (TermDef a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> TermDef a -> c (TermDef a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (TermDef a))
-> (TermDef a -> Constr)
-> (TermDef a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (TermDef a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (TermDef a)))
-> ((forall b. Data b => b -> b) -> TermDef a -> TermDef a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> TermDef a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> TermDef a -> r)
-> (forall u. (forall d. Data d => d -> u) -> TermDef a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TermDef a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a))
-> Data (TermDef a)
TermDef a -> DataType
TermDef a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (TermDef a))
(forall b. Data b => b -> b) -> TermDef a -> TermDef a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TermDef a -> c (TermDef a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TermDef a)
forall a. Data a => Typeable (TermDef a)
forall a. Data a => TermDef a -> DataType
forall a. Data a => TermDef a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> TermDef a -> TermDef a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> TermDef a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> TermDef a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TermDef a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TermDef a -> c (TermDef a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (TermDef a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TermDef 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) -> TermDef a -> u
forall u. (forall d. Data d => d -> u) -> TermDef a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TermDef a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TermDef a -> c (TermDef a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (TermDef a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TermDef a))
$cFunction :: Constr
$cVariable :: Constr
$tTermDef :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
gmapMp :: (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
gmapM :: (forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> TermDef a -> m (TermDef a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> TermDef a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> TermDef a -> u
gmapQ :: (forall d. Data d => d -> u) -> TermDef a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> TermDef a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TermDef a -> r
gmapT :: (forall b. Data b => b -> b) -> TermDef a -> TermDef a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> TermDef a -> TermDef a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TermDef a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (TermDef a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (TermDef a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (TermDef a))
dataTypeOf :: TermDef a -> DataType
$cdataTypeOf :: forall a. Data a => TermDef a -> DataType
toConstr :: TermDef a -> Constr
$ctoConstr :: forall a. Data a => TermDef a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TermDef a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (TermDef a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TermDef a -> c (TermDef a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TermDef a -> c (TermDef a)
$cp1Data :: forall a. Data a => Typeable (TermDef a)
Data, a -> TermDef b -> TermDef a
(a -> b) -> TermDef a -> TermDef b
(forall a b. (a -> b) -> TermDef a -> TermDef b)
-> (forall a b. a -> TermDef b -> TermDef a) -> Functor TermDef
forall a b. a -> TermDef b -> TermDef a
forall a b. (a -> b) -> TermDef a -> TermDef b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> TermDef b -> TermDef a
$c<$ :: forall a b. a -> TermDef b -> TermDef a
fmap :: (a -> b) -> TermDef a -> TermDef b
$cfmap :: forall a b. (a -> b) -> TermDef a -> TermDef b
Functor, TermDef a -> Bool
(a -> m) -> TermDef a -> m
(a -> b -> b) -> b -> TermDef a -> b
(forall m. Monoid m => TermDef m -> m)
-> (forall m a. Monoid m => (a -> m) -> TermDef a -> m)
-> (forall m a. Monoid m => (a -> m) -> TermDef a -> m)
-> (forall a b. (a -> b -> b) -> b -> TermDef a -> b)
-> (forall a b. (a -> b -> b) -> b -> TermDef a -> b)
-> (forall b a. (b -> a -> b) -> b -> TermDef a -> b)
-> (forall b a. (b -> a -> b) -> b -> TermDef a -> b)
-> (forall a. (a -> a -> a) -> TermDef a -> a)
-> (forall a. (a -> a -> a) -> TermDef a -> a)
-> (forall a. TermDef a -> [a])
-> (forall a. TermDef a -> Bool)
-> (forall a. TermDef a -> Int)
-> (forall a. Eq a => a -> TermDef a -> Bool)
-> (forall a. Ord a => TermDef a -> a)
-> (forall a. Ord a => TermDef a -> a)
-> (forall a. Num a => TermDef a -> a)
-> (forall a. Num a => TermDef a -> a)
-> Foldable TermDef
forall a. Eq a => a -> TermDef a -> Bool
forall a. Num a => TermDef a -> a
forall a. Ord a => TermDef a -> a
forall m. Monoid m => TermDef m -> m
forall a. TermDef a -> Bool
forall a. TermDef a -> Int
forall a. TermDef a -> [a]
forall a. (a -> a -> a) -> TermDef a -> a
forall m a. Monoid m => (a -> m) -> TermDef a -> m
forall b a. (b -> a -> b) -> b -> TermDef a -> b
forall a b. (a -> b -> b) -> b -> TermDef 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 :: TermDef a -> a
$cproduct :: forall a. Num a => TermDef a -> a
sum :: TermDef a -> a
$csum :: forall a. Num a => TermDef a -> a
minimum :: TermDef a -> a
$cminimum :: forall a. Ord a => TermDef a -> a
maximum :: TermDef a -> a
$cmaximum :: forall a. Ord a => TermDef a -> a
elem :: a -> TermDef a -> Bool
$celem :: forall a. Eq a => a -> TermDef a -> Bool
length :: TermDef a -> Int
$clength :: forall a. TermDef a -> Int
null :: TermDef a -> Bool
$cnull :: forall a. TermDef a -> Bool
toList :: TermDef a -> [a]
$ctoList :: forall a. TermDef a -> [a]
foldl1 :: (a -> a -> a) -> TermDef a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> TermDef a -> a
foldr1 :: (a -> a -> a) -> TermDef a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> TermDef a -> a
foldl' :: (b -> a -> b) -> b -> TermDef a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> TermDef a -> b
foldl :: (b -> a -> b) -> b -> TermDef a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> TermDef a -> b
foldr' :: (a -> b -> b) -> b -> TermDef a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> TermDef a -> b
foldr :: (a -> b -> b) -> b -> TermDef a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> TermDef a -> b
foldMap' :: (a -> m) -> TermDef a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> TermDef a -> m
foldMap :: (a -> m) -> TermDef a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> TermDef a -> m
fold :: TermDef m -> m
$cfold :: forall m. Monoid m => TermDef m -> m
Foldable, Functor TermDef
Foldable TermDef
Functor TermDef
-> Foldable TermDef
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> TermDef a -> f (TermDef b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    TermDef (f a) -> f (TermDef a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> TermDef a -> m (TermDef b))
-> (forall (m :: * -> *) a.
    Monad m =>
    TermDef (m a) -> m (TermDef a))
-> Traversable TermDef
(a -> f b) -> TermDef a -> f (TermDef 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 => TermDef (m a) -> m (TermDef a)
forall (f :: * -> *) a.
Applicative f =>
TermDef (f a) -> f (TermDef a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TermDef a -> m (TermDef b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TermDef a -> f (TermDef b)
sequence :: TermDef (m a) -> m (TermDef a)
$csequence :: forall (m :: * -> *) a. Monad m => TermDef (m a) -> m (TermDef a)
mapM :: (a -> m b) -> TermDef a -> m (TermDef b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> TermDef a -> m (TermDef b)
sequenceA :: TermDef (f a) -> f (TermDef a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
TermDef (f a) -> f (TermDef a)
traverse :: (a -> f b) -> TermDef a -> f (TermDef b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> TermDef a -> f (TermDef b)
$cp2Traversable :: Foldable TermDef
$cp1Traversable :: Functor TermDef
Traversable)

-- | A Block is a list of statements
type Block a = [Statement a]

-- | A data type definition
data Datatype a
  = Datatype a Constr [TypeVar] [Variant (Maybe Type)]
  deriving (Int -> Datatype a -> ShowS
[Datatype a] -> ShowS
Datatype a -> String
(Int -> Datatype a -> ShowS)
-> (Datatype a -> String)
-> ([Datatype a] -> ShowS)
-> Show (Datatype a)
forall a. Show a => Int -> Datatype a -> ShowS
forall a. Show a => [Datatype a] -> ShowS
forall a. Show a => Datatype a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Datatype a] -> ShowS
$cshowList :: forall a. Show a => [Datatype a] -> ShowS
show :: Datatype a -> String
$cshow :: forall a. Show a => Datatype a -> String
showsPrec :: Int -> Datatype a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Datatype a -> ShowS
Show, Datatype a -> Datatype a -> Bool
(Datatype a -> Datatype a -> Bool)
-> (Datatype a -> Datatype a -> Bool) -> Eq (Datatype a)
forall a. Eq a => Datatype a -> Datatype a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Datatype a -> Datatype a -> Bool
$c/= :: forall a. Eq a => Datatype a -> Datatype a -> Bool
== :: Datatype a -> Datatype a -> Bool
$c== :: forall a. Eq a => Datatype a -> Datatype a -> Bool
Eq, Eq (Datatype a)
Eq (Datatype a)
-> (Datatype a -> Datatype a -> Ordering)
-> (Datatype a -> Datatype a -> Bool)
-> (Datatype a -> Datatype a -> Bool)
-> (Datatype a -> Datatype a -> Bool)
-> (Datatype a -> Datatype a -> Bool)
-> (Datatype a -> Datatype a -> Datatype a)
-> (Datatype a -> Datatype a -> Datatype a)
-> Ord (Datatype a)
Datatype a -> Datatype a -> Bool
Datatype a -> Datatype a -> Ordering
Datatype a -> Datatype a -> Datatype a
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
forall a. Ord a => Eq (Datatype a)
forall a. Ord a => Datatype a -> Datatype a -> Bool
forall a. Ord a => Datatype a -> Datatype a -> Ordering
forall a. Ord a => Datatype a -> Datatype a -> Datatype a
min :: Datatype a -> Datatype a -> Datatype a
$cmin :: forall a. Ord a => Datatype a -> Datatype a -> Datatype a
max :: Datatype a -> Datatype a -> Datatype a
$cmax :: forall a. Ord a => Datatype a -> Datatype a -> Datatype a
>= :: Datatype a -> Datatype a -> Bool
$c>= :: forall a. Ord a => Datatype a -> Datatype a -> Bool
> :: Datatype a -> Datatype a -> Bool
$c> :: forall a. Ord a => Datatype a -> Datatype a -> Bool
<= :: Datatype a -> Datatype a -> Bool
$c<= :: forall a. Ord a => Datatype a -> Datatype a -> Bool
< :: Datatype a -> Datatype a -> Bool
$c< :: forall a. Ord a => Datatype a -> Datatype a -> Bool
compare :: Datatype a -> Datatype a -> Ordering
$ccompare :: forall a. Ord a => Datatype a -> Datatype a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Datatype a)
Ord, Typeable (Datatype a)
DataType
Constr
Typeable (Datatype a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Datatype a -> c (Datatype a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Datatype a))
-> (Datatype a -> Constr)
-> (Datatype a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Datatype a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Datatype a)))
-> ((forall b. Data b => b -> b) -> Datatype a -> Datatype a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Datatype a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Datatype a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Datatype a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Datatype a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a))
-> Data (Datatype a)
Datatype a -> DataType
Datatype a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Datatype a))
(forall b. Data b => b -> b) -> Datatype a -> Datatype a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Datatype a -> c (Datatype a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Datatype a)
forall a. Data a => Typeable (Datatype a)
forall a. Data a => Datatype a -> DataType
forall a. Data a => Datatype a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Datatype a -> Datatype a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Datatype a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Datatype a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Datatype a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Datatype a -> c (Datatype a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Datatype a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Datatype 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) -> Datatype a -> u
forall u. (forall d. Data d => d -> u) -> Datatype a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Datatype a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Datatype a -> c (Datatype a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Datatype a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Datatype a))
$cDatatype :: Constr
$tDatatype :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
gmapMp :: (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
gmapM :: (forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Datatype a -> m (Datatype a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Datatype a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Datatype a -> u
gmapQ :: (forall d. Data d => d -> u) -> Datatype a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Datatype a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Datatype a -> r
gmapT :: (forall b. Data b => b -> b) -> Datatype a -> Datatype a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Datatype a -> Datatype a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Datatype a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Datatype a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Datatype a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Datatype a))
dataTypeOf :: Datatype a -> DataType
$cdataTypeOf :: forall a. Data a => Datatype a -> DataType
toConstr :: Datatype a -> Constr
$ctoConstr :: forall a. Data a => Datatype a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Datatype a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Datatype a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Datatype a -> c (Datatype a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Datatype a -> c (Datatype a)
$cp1Data :: forall a. Data a => Typeable (Datatype a)
Data, a -> Datatype b -> Datatype a
(a -> b) -> Datatype a -> Datatype b
(forall a b. (a -> b) -> Datatype a -> Datatype b)
-> (forall a b. a -> Datatype b -> Datatype a) -> Functor Datatype
forall a b. a -> Datatype b -> Datatype a
forall a b. (a -> b) -> Datatype a -> Datatype b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Datatype b -> Datatype a
$c<$ :: forall a b. a -> Datatype b -> Datatype a
fmap :: (a -> b) -> Datatype a -> Datatype b
$cfmap :: forall a b. (a -> b) -> Datatype a -> Datatype b
Functor, Datatype a -> Bool
(a -> m) -> Datatype a -> m
(a -> b -> b) -> b -> Datatype a -> b
(forall m. Monoid m => Datatype m -> m)
-> (forall m a. Monoid m => (a -> m) -> Datatype a -> m)
-> (forall m a. Monoid m => (a -> m) -> Datatype a -> m)
-> (forall a b. (a -> b -> b) -> b -> Datatype a -> b)
-> (forall a b. (a -> b -> b) -> b -> Datatype a -> b)
-> (forall b a. (b -> a -> b) -> b -> Datatype a -> b)
-> (forall b a. (b -> a -> b) -> b -> Datatype a -> b)
-> (forall a. (a -> a -> a) -> Datatype a -> a)
-> (forall a. (a -> a -> a) -> Datatype a -> a)
-> (forall a. Datatype a -> [a])
-> (forall a. Datatype a -> Bool)
-> (forall a. Datatype a -> Int)
-> (forall a. Eq a => a -> Datatype a -> Bool)
-> (forall a. Ord a => Datatype a -> a)
-> (forall a. Ord a => Datatype a -> a)
-> (forall a. Num a => Datatype a -> a)
-> (forall a. Num a => Datatype a -> a)
-> Foldable Datatype
forall a. Eq a => a -> Datatype a -> Bool
forall a. Num a => Datatype a -> a
forall a. Ord a => Datatype a -> a
forall m. Monoid m => Datatype m -> m
forall a. Datatype a -> Bool
forall a. Datatype a -> Int
forall a. Datatype a -> [a]
forall a. (a -> a -> a) -> Datatype a -> a
forall m a. Monoid m => (a -> m) -> Datatype a -> m
forall b a. (b -> a -> b) -> b -> Datatype a -> b
forall a b. (a -> b -> b) -> b -> Datatype 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 :: Datatype a -> a
$cproduct :: forall a. Num a => Datatype a -> a
sum :: Datatype a -> a
$csum :: forall a. Num a => Datatype a -> a
minimum :: Datatype a -> a
$cminimum :: forall a. Ord a => Datatype a -> a
maximum :: Datatype a -> a
$cmaximum :: forall a. Ord a => Datatype a -> a
elem :: a -> Datatype a -> Bool
$celem :: forall a. Eq a => a -> Datatype a -> Bool
length :: Datatype a -> Int
$clength :: forall a. Datatype a -> Int
null :: Datatype a -> Bool
$cnull :: forall a. Datatype a -> Bool
toList :: Datatype a -> [a]
$ctoList :: forall a. Datatype a -> [a]
foldl1 :: (a -> a -> a) -> Datatype a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Datatype a -> a
foldr1 :: (a -> a -> a) -> Datatype a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Datatype a -> a
foldl' :: (b -> a -> b) -> b -> Datatype a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Datatype a -> b
foldl :: (b -> a -> b) -> b -> Datatype a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Datatype a -> b
foldr' :: (a -> b -> b) -> b -> Datatype a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Datatype a -> b
foldr :: (a -> b -> b) -> b -> Datatype a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Datatype a -> b
foldMap' :: (a -> m) -> Datatype a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Datatype a -> m
foldMap :: (a -> m) -> Datatype a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Datatype a -> m
fold :: Datatype m -> m
$cfold :: forall m. Monoid m => Datatype m -> m
Foldable, Functor Datatype
Foldable Datatype
Functor Datatype
-> Foldable Datatype
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Datatype a -> f (Datatype b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Datatype (f a) -> f (Datatype a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Datatype a -> m (Datatype b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Datatype (m a) -> m (Datatype a))
-> Traversable Datatype
(a -> f b) -> Datatype a -> f (Datatype 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 => Datatype (m a) -> m (Datatype a)
forall (f :: * -> *) a.
Applicative f =>
Datatype (f a) -> f (Datatype a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Datatype a -> m (Datatype b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Datatype a -> f (Datatype b)
sequence :: Datatype (m a) -> m (Datatype a)
$csequence :: forall (m :: * -> *) a. Monad m => Datatype (m a) -> m (Datatype a)
mapM :: (a -> m b) -> Datatype a -> m (Datatype b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Datatype a -> m (Datatype b)
sequenceA :: Datatype (f a) -> f (Datatype a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Datatype (f a) -> f (Datatype a)
traverse :: (a -> f b) -> Datatype a -> f (Datatype b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Datatype a -> f (Datatype b)
$cp2Traversable :: Foldable Datatype
$cp1Traversable :: Functor Datatype
Traversable)

-- | A Statement
data Statement a
  = SExpr a (Expr a) -- ^ An expression
  | SDef a (TermDef a) -- ^ A term definition
  | SBind a Var (Expr a) -- ^ A bind statement
  deriving (Int -> Statement a -> ShowS
[Statement a] -> ShowS
Statement a -> String
(Int -> Statement a -> ShowS)
-> (Statement a -> String)
-> ([Statement a] -> ShowS)
-> Show (Statement a)
forall a. Show a => Int -> Statement a -> ShowS
forall a. Show a => [Statement a] -> ShowS
forall a. Show a => Statement a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Statement a] -> ShowS
$cshowList :: forall a. Show a => [Statement a] -> ShowS
show :: Statement a -> String
$cshow :: forall a. Show a => Statement a -> String
showsPrec :: Int -> Statement a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Statement a -> ShowS
Show, Statement a -> Statement a -> Bool
(Statement a -> Statement a -> Bool)
-> (Statement a -> Statement a -> Bool) -> Eq (Statement a)
forall a. Eq a => Statement a -> Statement a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Statement a -> Statement a -> Bool
$c/= :: forall a. Eq a => Statement a -> Statement a -> Bool
== :: Statement a -> Statement a -> Bool
$c== :: forall a. Eq a => Statement a -> Statement a -> Bool
Eq, Eq (Statement a)
Eq (Statement a)
-> (Statement a -> Statement a -> Ordering)
-> (Statement a -> Statement a -> Bool)
-> (Statement a -> Statement a -> Bool)
-> (Statement a -> Statement a -> Bool)
-> (Statement a -> Statement a -> Bool)
-> (Statement a -> Statement a -> Statement a)
-> (Statement a -> Statement a -> Statement a)
-> Ord (Statement a)
Statement a -> Statement a -> Bool
Statement a -> Statement a -> Ordering
Statement a -> Statement a -> Statement a
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
forall a. Ord a => Eq (Statement a)
forall a. Ord a => Statement a -> Statement a -> Bool
forall a. Ord a => Statement a -> Statement a -> Ordering
forall a. Ord a => Statement a -> Statement a -> Statement a
min :: Statement a -> Statement a -> Statement a
$cmin :: forall a. Ord a => Statement a -> Statement a -> Statement a
max :: Statement a -> Statement a -> Statement a
$cmax :: forall a. Ord a => Statement a -> Statement a -> Statement a
>= :: Statement a -> Statement a -> Bool
$c>= :: forall a. Ord a => Statement a -> Statement a -> Bool
> :: Statement a -> Statement a -> Bool
$c> :: forall a. Ord a => Statement a -> Statement a -> Bool
<= :: Statement a -> Statement a -> Bool
$c<= :: forall a. Ord a => Statement a -> Statement a -> Bool
< :: Statement a -> Statement a -> Bool
$c< :: forall a. Ord a => Statement a -> Statement a -> Bool
compare :: Statement a -> Statement a -> Ordering
$ccompare :: forall a. Ord a => Statement a -> Statement a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Statement a)
Ord, Typeable (Statement a)
DataType
Constr
Typeable (Statement a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Statement a -> c (Statement a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Statement a))
-> (Statement a -> Constr)
-> (Statement a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Statement a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Statement a)))
-> ((forall b. Data b => b -> b) -> Statement a -> Statement a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Statement a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Statement a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Statement a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Statement a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Statement a -> m (Statement a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Statement a -> m (Statement a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Statement a -> m (Statement a))
-> Data (Statement a)
Statement a -> DataType
Statement a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Statement a))
(forall b. Data b => b -> b) -> Statement a -> Statement a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Statement a -> c (Statement a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Statement a)
forall a. Data a => Typeable (Statement a)
forall a. Data a => Statement a -> DataType
forall a. Data a => Statement a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Statement a -> Statement a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Statement a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Statement a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Statement a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Statement a -> c (Statement a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Statement a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Statement 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) -> Statement a -> u
forall u. (forall d. Data d => d -> u) -> Statement a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Statement a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Statement a -> c (Statement a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Statement a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Statement a))
$cSBind :: Constr
$cSDef :: Constr
$cSExpr :: Constr
$tStatement :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
gmapMp :: (forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
gmapM :: (forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Statement a -> m (Statement a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Statement a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Statement a -> u
gmapQ :: (forall d. Data d => d -> u) -> Statement a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Statement a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Statement a -> r
gmapT :: (forall b. Data b => b -> b) -> Statement a -> Statement a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Statement a -> Statement a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Statement a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Statement a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Statement a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Statement a))
dataTypeOf :: Statement a -> DataType
$cdataTypeOf :: forall a. Data a => Statement a -> DataType
toConstr :: Statement a -> Constr
$ctoConstr :: forall a. Data a => Statement a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Statement a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Statement a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Statement a -> c (Statement a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Statement a -> c (Statement a)
$cp1Data :: forall a. Data a => Typeable (Statement a)
Data, a -> Statement b -> Statement a
(a -> b) -> Statement a -> Statement b
(forall a b. (a -> b) -> Statement a -> Statement b)
-> (forall a b. a -> Statement b -> Statement a)
-> Functor Statement
forall a b. a -> Statement b -> Statement a
forall a b. (a -> b) -> Statement a -> Statement b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Statement b -> Statement a
$c<$ :: forall a b. a -> Statement b -> Statement a
fmap :: (a -> b) -> Statement a -> Statement b
$cfmap :: forall a b. (a -> b) -> Statement a -> Statement b
Functor, Statement a -> Bool
(a -> m) -> Statement a -> m
(a -> b -> b) -> b -> Statement a -> b
(forall m. Monoid m => Statement m -> m)
-> (forall m a. Monoid m => (a -> m) -> Statement a -> m)
-> (forall m a. Monoid m => (a -> m) -> Statement a -> m)
-> (forall a b. (a -> b -> b) -> b -> Statement a -> b)
-> (forall a b. (a -> b -> b) -> b -> Statement a -> b)
-> (forall b a. (b -> a -> b) -> b -> Statement a -> b)
-> (forall b a. (b -> a -> b) -> b -> Statement a -> b)
-> (forall a. (a -> a -> a) -> Statement a -> a)
-> (forall a. (a -> a -> a) -> Statement a -> a)
-> (forall a. Statement a -> [a])
-> (forall a. Statement a -> Bool)
-> (forall a. Statement a -> Int)
-> (forall a. Eq a => a -> Statement a -> Bool)
-> (forall a. Ord a => Statement a -> a)
-> (forall a. Ord a => Statement a -> a)
-> (forall a. Num a => Statement a -> a)
-> (forall a. Num a => Statement a -> a)
-> Foldable Statement
forall a. Eq a => a -> Statement a -> Bool
forall a. Num a => Statement a -> a
forall a. Ord a => Statement a -> a
forall m. Monoid m => Statement m -> m
forall a. Statement a -> Bool
forall a. Statement a -> Int
forall a. Statement a -> [a]
forall a. (a -> a -> a) -> Statement a -> a
forall m a. Monoid m => (a -> m) -> Statement a -> m
forall b a. (b -> a -> b) -> b -> Statement a -> b
forall a b. (a -> b -> b) -> b -> Statement 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 :: Statement a -> a
$cproduct :: forall a. Num a => Statement a -> a
sum :: Statement a -> a
$csum :: forall a. Num a => Statement a -> a
minimum :: Statement a -> a
$cminimum :: forall a. Ord a => Statement a -> a
maximum :: Statement a -> a
$cmaximum :: forall a. Ord a => Statement a -> a
elem :: a -> Statement a -> Bool
$celem :: forall a. Eq a => a -> Statement a -> Bool
length :: Statement a -> Int
$clength :: forall a. Statement a -> Int
null :: Statement a -> Bool
$cnull :: forall a. Statement a -> Bool
toList :: Statement a -> [a]
$ctoList :: forall a. Statement a -> [a]
foldl1 :: (a -> a -> a) -> Statement a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Statement a -> a
foldr1 :: (a -> a -> a) -> Statement a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Statement a -> a
foldl' :: (b -> a -> b) -> b -> Statement a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Statement a -> b
foldl :: (b -> a -> b) -> b -> Statement a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Statement a -> b
foldr' :: (a -> b -> b) -> b -> Statement a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Statement a -> b
foldr :: (a -> b -> b) -> b -> Statement a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Statement a -> b
foldMap' :: (a -> m) -> Statement a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Statement a -> m
foldMap :: (a -> m) -> Statement a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Statement a -> m
fold :: Statement m -> m
$cfold :: forall m. Monoid m => Statement m -> m
Foldable, Functor Statement
Foldable Statement
Functor Statement
-> Foldable Statement
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Statement a -> f (Statement b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Statement (f a) -> f (Statement a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Statement a -> m (Statement b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Statement (m a) -> m (Statement a))
-> Traversable Statement
(a -> f b) -> Statement a -> f (Statement 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 =>
Statement (m a) -> m (Statement a)
forall (f :: * -> *) a.
Applicative f =>
Statement (f a) -> f (Statement a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Statement a -> m (Statement b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Statement a -> f (Statement b)
sequence :: Statement (m a) -> m (Statement a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
Statement (m a) -> m (Statement a)
mapM :: (a -> m b) -> Statement a -> m (Statement b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Statement a -> m (Statement b)
sequenceA :: Statement (f a) -> f (Statement a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Statement (f a) -> f (Statement a)
traverse :: (a -> f b) -> Statement a -> f (Statement b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Statement a -> f (Statement b)
$cp2Traversable :: Foldable Statement
$cp1Traversable :: Functor Statement
Traversable)

-- | An expression
data Expr a
  -- | Annotates the child expression with some annotation
  = EAnnotated a (Expr a)
  -- | A Literal
  | ELit Lit
  -- | A variable name
  | EVar Var
  -- | An anonymous function
  | EFun [Maybe Var] (Expr a)
  -- | A function call
  | EFunCall (Expr a) [Expr a]
  -- | A do block
  | EBlock (Block a)
  -- | A let expression
  | ELet (TermDef a) (Expr a)
  -- | A variant (or data constructor)
  | EVariant Constr
  -- | An open variant
  | EOpenVariant Constr
  -- | A record
  | ERecord (Record (Expr a))
  -- | Record access to a specific label
  | ERecordAccess (Expr a) Label
  -- | Extends a record
  | ERecordExtension (Record (Expr a)) (Expr a)
  -- | A 2-way if expression
  | EIf (Expr a) (Expr a) (Expr a)
  -- | A case expression (pattern matching)
  | ECase (Expr a) [(Pattern, Expr a)]
  -- | A foreign function interface call
  | EFfi T.Text (Maybe Type) [Expr a]
  deriving (Int -> Expr a -> ShowS
[Expr a] -> ShowS
Expr a -> String
(Int -> Expr a -> ShowS)
-> (Expr a -> String) -> ([Expr a] -> ShowS) -> Show (Expr a)
forall a. Show a => Int -> Expr a -> ShowS
forall a. Show a => [Expr a] -> ShowS
forall a. Show a => Expr a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Expr a] -> ShowS
$cshowList :: forall a. Show a => [Expr a] -> ShowS
show :: Expr a -> String
$cshow :: forall a. Show a => Expr a -> String
showsPrec :: Int -> Expr a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Expr a -> ShowS
Show, Expr a -> Expr a -> Bool
(Expr a -> Expr a -> Bool)
-> (Expr a -> Expr a -> Bool) -> Eq (Expr a)
forall a. Eq a => Expr a -> Expr a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Expr a -> Expr a -> Bool
$c/= :: forall a. Eq a => Expr a -> Expr a -> Bool
== :: Expr a -> Expr a -> Bool
$c== :: forall a. Eq a => Expr a -> Expr a -> Bool
Eq, Eq (Expr a)
Eq (Expr a)
-> (Expr a -> Expr a -> Ordering)
-> (Expr a -> Expr a -> Bool)
-> (Expr a -> Expr a -> Bool)
-> (Expr a -> Expr a -> Bool)
-> (Expr a -> Expr a -> Bool)
-> (Expr a -> Expr a -> Expr a)
-> (Expr a -> Expr a -> Expr a)
-> Ord (Expr a)
Expr a -> Expr a -> Bool
Expr a -> Expr a -> Ordering
Expr a -> Expr a -> Expr a
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
forall a. Ord a => Eq (Expr a)
forall a. Ord a => Expr a -> Expr a -> Bool
forall a. Ord a => Expr a -> Expr a -> Ordering
forall a. Ord a => Expr a -> Expr a -> Expr a
min :: Expr a -> Expr a -> Expr a
$cmin :: forall a. Ord a => Expr a -> Expr a -> Expr a
max :: Expr a -> Expr a -> Expr a
$cmax :: forall a. Ord a => Expr a -> Expr a -> Expr a
>= :: Expr a -> Expr a -> Bool
$c>= :: forall a. Ord a => Expr a -> Expr a -> Bool
> :: Expr a -> Expr a -> Bool
$c> :: forall a. Ord a => Expr a -> Expr a -> Bool
<= :: Expr a -> Expr a -> Bool
$c<= :: forall a. Ord a => Expr a -> Expr a -> Bool
< :: Expr a -> Expr a -> Bool
$c< :: forall a. Ord a => Expr a -> Expr a -> Bool
compare :: Expr a -> Expr a -> Ordering
$ccompare :: forall a. Ord a => Expr a -> Expr a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (Expr a)
Ord, Typeable (Expr a)
DataType
Constr
Typeable (Expr a)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Expr a -> c (Expr a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Expr a))
-> (Expr a -> Constr)
-> (Expr a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Expr a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr a)))
-> ((forall b. Data b => b -> b) -> Expr a -> Expr a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Expr a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Expr a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Expr a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Expr a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Expr a -> m (Expr a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Expr a -> m (Expr a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Expr a -> m (Expr a))
-> Data (Expr a)
Expr a -> DataType
Expr a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (Expr a))
(forall b. Data b => b -> b) -> Expr a -> Expr a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr a -> c (Expr a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Expr a)
forall a. Data a => Typeable (Expr a)
forall a. Data a => Expr a -> DataType
forall a. Data a => Expr a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> Expr a -> Expr a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Expr a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> Expr a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Expr a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr a -> c (Expr a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Expr a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr 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) -> Expr a -> u
forall u. (forall d. Data d => d -> u) -> Expr a -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Expr a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr a -> c (Expr a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Expr a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr a))
$cEFfi :: Constr
$cECase :: Constr
$cEIf :: Constr
$cERecordExtension :: Constr
$cERecordAccess :: Constr
$cERecord :: Constr
$cEOpenVariant :: Constr
$cEVariant :: Constr
$cELet :: Constr
$cEBlock :: Constr
$cEFunCall :: Constr
$cEFun :: Constr
$cEVar :: Constr
$cELit :: Constr
$cEAnnotated :: Constr
$tExpr :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
gmapMp :: (forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
gmapM :: (forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Expr a -> m (Expr a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> Expr a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Expr a -> u
gmapQ :: (forall d. Data d => d -> u) -> Expr a -> [u]
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> Expr a -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Expr a -> r
gmapT :: (forall b. Data b => b -> b) -> Expr a -> Expr a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Expr a -> Expr a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Expr a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Expr a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Expr a))
dataTypeOf :: Expr a -> DataType
$cdataTypeOf :: forall a. Data a => Expr a -> DataType
toConstr :: Expr a -> Constr
$ctoConstr :: forall a. Data a => Expr a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Expr a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Expr a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr a -> c (Expr a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expr a -> c (Expr a)
$cp1Data :: forall a. Data a => Typeable (Expr a)
Data, a -> Expr b -> Expr a
(a -> b) -> Expr a -> Expr b
(forall a b. (a -> b) -> Expr a -> Expr b)
-> (forall a b. a -> Expr b -> Expr a) -> Functor Expr
forall a b. a -> Expr b -> Expr a
forall a b. (a -> b) -> Expr a -> Expr b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Expr b -> Expr a
$c<$ :: forall a b. a -> Expr b -> Expr a
fmap :: (a -> b) -> Expr a -> Expr b
$cfmap :: forall a b. (a -> b) -> Expr a -> Expr b
Functor, Expr a -> Bool
(a -> m) -> Expr a -> m
(a -> b -> b) -> b -> Expr a -> b
(forall m. Monoid m => Expr m -> m)
-> (forall m a. Monoid m => (a -> m) -> Expr a -> m)
-> (forall m a. Monoid m => (a -> m) -> Expr a -> m)
-> (forall a b. (a -> b -> b) -> b -> Expr a -> b)
-> (forall a b. (a -> b -> b) -> b -> Expr a -> b)
-> (forall b a. (b -> a -> b) -> b -> Expr a -> b)
-> (forall b a. (b -> a -> b) -> b -> Expr a -> b)
-> (forall a. (a -> a -> a) -> Expr a -> a)
-> (forall a. (a -> a -> a) -> Expr a -> a)
-> (forall a. Expr a -> [a])
-> (forall a. Expr a -> Bool)
-> (forall a. Expr a -> Int)
-> (forall a. Eq a => a -> Expr a -> Bool)
-> (forall a. Ord a => Expr a -> a)
-> (forall a. Ord a => Expr a -> a)
-> (forall a. Num a => Expr a -> a)
-> (forall a. Num a => Expr a -> a)
-> Foldable Expr
forall a. Eq a => a -> Expr a -> Bool
forall a. Num a => Expr a -> a
forall a. Ord a => Expr a -> a
forall m. Monoid m => Expr m -> m
forall a. Expr a -> Bool
forall a. Expr a -> Int
forall a. Expr a -> [a]
forall a. (a -> a -> a) -> Expr a -> a
forall m a. Monoid m => (a -> m) -> Expr a -> m
forall b a. (b -> a -> b) -> b -> Expr a -> b
forall a b. (a -> b -> b) -> b -> Expr 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 :: Expr a -> a
$cproduct :: forall a. Num a => Expr a -> a
sum :: Expr a -> a
$csum :: forall a. Num a => Expr a -> a
minimum :: Expr a -> a
$cminimum :: forall a. Ord a => Expr a -> a
maximum :: Expr a -> a
$cmaximum :: forall a. Ord a => Expr a -> a
elem :: a -> Expr a -> Bool
$celem :: forall a. Eq a => a -> Expr a -> Bool
length :: Expr a -> Int
$clength :: forall a. Expr a -> Int
null :: Expr a -> Bool
$cnull :: forall a. Expr a -> Bool
toList :: Expr a -> [a]
$ctoList :: forall a. Expr a -> [a]
foldl1 :: (a -> a -> a) -> Expr a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Expr a -> a
foldr1 :: (a -> a -> a) -> Expr a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Expr a -> a
foldl' :: (b -> a -> b) -> b -> Expr a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Expr a -> b
foldl :: (b -> a -> b) -> b -> Expr a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Expr a -> b
foldr' :: (a -> b -> b) -> b -> Expr a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Expr a -> b
foldr :: (a -> b -> b) -> b -> Expr a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Expr a -> b
foldMap' :: (a -> m) -> Expr a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Expr a -> m
foldMap :: (a -> m) -> Expr a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Expr a -> m
fold :: Expr m -> m
$cfold :: forall m. Monoid m => Expr m -> m
Foldable, Functor Expr
Foldable Expr
Functor Expr
-> Foldable Expr
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> Expr a -> f (Expr b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Expr (f a) -> f (Expr a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Expr a -> m (Expr b))
-> (forall (m :: * -> *) a. Monad m => Expr (m a) -> m (Expr a))
-> Traversable Expr
(a -> f b) -> Expr a -> f (Expr 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 => Expr (m a) -> m (Expr a)
forall (f :: * -> *) a. Applicative f => Expr (f a) -> f (Expr a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Expr a -> m (Expr b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Expr a -> f (Expr b)
sequence :: Expr (m a) -> m (Expr a)
$csequence :: forall (m :: * -> *) a. Monad m => Expr (m a) -> m (Expr a)
mapM :: (a -> m b) -> Expr a -> m (Expr b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Expr a -> m (Expr b)
sequenceA :: Expr (f a) -> f (Expr a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Expr (f a) -> f (Expr a)
traverse :: (a -> f b) -> Expr a -> f (Expr b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Expr a -> f (Expr b)
$cp2Traversable :: Foldable Expr
$cp1Traversable :: Functor Expr
Traversable)

-- | A literal
data Lit
  = LInt Int -- ^ Integers
  | LFloat Float -- ^ Floating point numbers
  | LString T.Text -- ^ Strings
  deriving (Int -> Lit -> ShowS
[Lit] -> ShowS
Lit -> String
(Int -> Lit -> ShowS)
-> (Lit -> String) -> ([Lit] -> ShowS) -> Show Lit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Lit] -> ShowS
$cshowList :: [Lit] -> ShowS
show :: Lit -> String
$cshow :: Lit -> String
showsPrec :: Int -> Lit -> ShowS
$cshowsPrec :: Int -> Lit -> ShowS
Show, Lit -> Lit -> Bool
(Lit -> Lit -> Bool) -> (Lit -> Lit -> Bool) -> Eq Lit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Lit -> Lit -> Bool
$c/= :: Lit -> Lit -> Bool
== :: Lit -> Lit -> Bool
$c== :: Lit -> Lit -> Bool
Eq, Eq Lit
Eq Lit
-> (Lit -> Lit -> Ordering)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Bool)
-> (Lit -> Lit -> Lit)
-> (Lit -> Lit -> Lit)
-> Ord Lit
Lit -> Lit -> Bool
Lit -> Lit -> Ordering
Lit -> Lit -> Lit
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 :: Lit -> Lit -> Lit
$cmin :: Lit -> Lit -> Lit
max :: Lit -> Lit -> Lit
$cmax :: Lit -> Lit -> Lit
>= :: Lit -> Lit -> Bool
$c>= :: Lit -> Lit -> Bool
> :: Lit -> Lit -> Bool
$c> :: Lit -> Lit -> Bool
<= :: Lit -> Lit -> Bool
$c<= :: Lit -> Lit -> Bool
< :: Lit -> Lit -> Bool
$c< :: Lit -> Lit -> Bool
compare :: Lit -> Lit -> Ordering
$ccompare :: Lit -> Lit -> Ordering
$cp1Ord :: Eq Lit
Ord, Typeable Lit
DataType
Constr
Typeable Lit
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Lit -> c Lit)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Lit)
-> (Lit -> Constr)
-> (Lit -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Lit))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit))
-> ((forall b. Data b => b -> b) -> Lit -> Lit)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r)
-> (forall u. (forall d. Data d => d -> u) -> Lit -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Lit -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Lit -> m Lit)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Lit -> m Lit)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Lit -> m Lit)
-> Data Lit
Lit -> DataType
Lit -> Constr
(forall b. Data b => b -> b) -> Lit -> Lit
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
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) -> Lit -> u
forall u. (forall d. Data d => d -> u) -> Lit -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Lit)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit)
$cLString :: Constr
$cLFloat :: Constr
$cLInt :: Constr
$tLit :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Lit -> m Lit
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
gmapMp :: (forall d. Data d => d -> m d) -> Lit -> m Lit
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
gmapM :: (forall d. Data d => d -> m d) -> Lit -> m Lit
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Lit -> m Lit
gmapQi :: Int -> (forall d. Data d => d -> u) -> Lit -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Lit -> u
gmapQ :: (forall d. Data d => d -> u) -> Lit -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Lit -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit -> r
gmapT :: (forall b. Data b => b -> b) -> Lit -> Lit
$cgmapT :: (forall b. Data b => b -> b) -> Lit -> Lit
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Lit)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Lit)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Lit)
dataTypeOf :: Lit -> DataType
$cdataTypeOf :: Lit -> DataType
toConstr :: Lit -> Constr
$ctoConstr :: Lit -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Lit
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Lit -> c Lit
$cp1Data :: Typeable Lit
Data)

-- | A pattern
data Pattern
  = PWildcard -- ^ A catch all pattern
  | PVar Var -- ^ A variable capture pattern
  | PLit Lit -- ^ A literal pattern
  | PVariant (Variant (Maybe Pattern)) -- ^ A variant pattern
  | POpenVariant (Variant Pattern) -- ^ An open variant pattern
  | PRecord (Record Pattern) -- ^ A record pattern
  deriving (Int -> Pattern -> ShowS
[Pattern] -> ShowS
Pattern -> String
(Int -> Pattern -> ShowS)
-> (Pattern -> String) -> ([Pattern] -> ShowS) -> Show Pattern
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Pattern] -> ShowS
$cshowList :: [Pattern] -> ShowS
show :: Pattern -> String
$cshow :: Pattern -> String
showsPrec :: Int -> Pattern -> ShowS
$cshowsPrec :: Int -> Pattern -> ShowS
Show, Pattern -> Pattern -> Bool
(Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool) -> Eq Pattern
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pattern -> Pattern -> Bool
$c/= :: Pattern -> Pattern -> Bool
== :: Pattern -> Pattern -> Bool
$c== :: Pattern -> Pattern -> Bool
Eq, Eq Pattern
Eq Pattern
-> (Pattern -> Pattern -> Ordering)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Bool)
-> (Pattern -> Pattern -> Pattern)
-> (Pattern -> Pattern -> Pattern)
-> Ord Pattern
Pattern -> Pattern -> Bool
Pattern -> Pattern -> Ordering
Pattern -> Pattern -> Pattern
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 :: Pattern -> Pattern -> Pattern
$cmin :: Pattern -> Pattern -> Pattern
max :: Pattern -> Pattern -> Pattern
$cmax :: Pattern -> Pattern -> Pattern
>= :: Pattern -> Pattern -> Bool
$c>= :: Pattern -> Pattern -> Bool
> :: Pattern -> Pattern -> Bool
$c> :: Pattern -> Pattern -> Bool
<= :: Pattern -> Pattern -> Bool
$c<= :: Pattern -> Pattern -> Bool
< :: Pattern -> Pattern -> Bool
$c< :: Pattern -> Pattern -> Bool
compare :: Pattern -> Pattern -> Ordering
$ccompare :: Pattern -> Pattern -> Ordering
$cp1Ord :: Eq Pattern
Ord, Typeable Pattern
DataType
Constr
Typeable Pattern
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Pattern -> c Pattern)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Pattern)
-> (Pattern -> Constr)
-> (Pattern -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Pattern))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern))
-> ((forall b. Data b => b -> b) -> Pattern -> Pattern)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Pattern -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Pattern -> r)
-> (forall u. (forall d. Data d => d -> u) -> Pattern -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Pattern -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Pattern -> m Pattern)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pattern -> m Pattern)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Pattern -> m Pattern)
-> Data Pattern
Pattern -> DataType
Pattern -> Constr
(forall b. Data b => b -> b) -> Pattern -> Pattern
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
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) -> Pattern -> u
forall u. (forall d. Data d => d -> u) -> Pattern -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pattern)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern)
$cPRecord :: Constr
$cPOpenVariant :: Constr
$cPVariant :: Constr
$cPLit :: Constr
$cPVar :: Constr
$cPWildcard :: Constr
$tPattern :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Pattern -> m Pattern
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
gmapMp :: (forall d. Data d => d -> m d) -> Pattern -> m Pattern
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
gmapM :: (forall d. Data d => d -> m d) -> Pattern -> m Pattern
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Pattern -> m Pattern
gmapQi :: Int -> (forall d. Data d => d -> u) -> Pattern -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Pattern -> u
gmapQ :: (forall d. Data d => d -> u) -> Pattern -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Pattern -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Pattern -> r
gmapT :: (forall b. Data b => b -> b) -> Pattern -> Pattern
$cgmapT :: (forall b. Data b => b -> b) -> Pattern -> Pattern
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pattern)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Pattern)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Pattern)
dataTypeOf :: Pattern -> DataType
$cdataTypeOf :: Pattern -> DataType
toConstr :: Pattern -> Constr
$ctoConstr :: Pattern -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Pattern
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Pattern -> c Pattern
$cp1Data :: Typeable Pattern
Data)

-- | A variable name
type Var = T.Text

-- * Utils

-- | Create a record expression (or extension) from a a list of (label, expression)
--   and a expression to extend (if needed).
--
--   Note that this function is left-biased - duplicate fields will preserve the first field.
mkERec :: [(Label, Expr a)] -> Maybe (Expr a) -> Expr a
mkERec :: [(Label, Expr a)] -> Maybe (Expr a) -> Expr a
mkERec [(Label, Expr a)]
fields = Expr a -> (Expr a -> Expr a) -> Maybe (Expr a) -> Expr a
forall b a. b -> (a -> b) -> Maybe a -> b
maybe
  (Record (Expr a) -> Expr a
forall a. Record (Expr a) -> Expr a
ERecord (Record (Expr a) -> Expr a) -> Record (Expr a) -> Expr a
forall a b. (a -> b) -> a -> b
$ (Expr a -> Expr a -> Expr a)
-> [(Label, Expr a)] -> Record (Expr a)
forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
M.fromListWith ((Expr a -> Expr a -> Expr a) -> Expr a -> Expr a -> Expr a
forall a b c. (a -> b -> c) -> b -> a -> c
flip Expr a -> Expr a -> Expr a
forall a b. a -> b -> a
const) [(Label, Expr a)]
fields)
  (Record (Expr a) -> Expr a -> Expr a
forall a. Record (Expr a) -> Expr a -> Expr a
ERecordExtension (Record (Expr a) -> Expr a -> Expr a)
-> Record (Expr a) -> Expr a -> Expr a
forall a b. (a -> b) -> a -> b
$ (Expr a -> Expr a -> Expr a)
-> [(Label, Expr a)] -> Record (Expr a)
forall k a. Ord k => (a -> a -> a) -> [(k, a)] -> Map k a
M.fromListWith ((Expr a -> Expr a -> Expr a) -> Expr a -> Expr a -> Expr a
forall a b c. (a -> b -> c) -> b -> a -> c
flip Expr a -> Expr a -> Expr a
forall a b. a -> b -> a
const) [(Label, Expr a)]
fields)

-- | A lambda without wildcards
efun :: [Var] -> Expr a -> Expr a
efun :: [Label] -> Expr a -> Expr a
efun [Label]
args Expr a
body = [Maybe Label] -> Expr a -> Expr a
forall a. [Maybe Label] -> Expr a -> Expr a
EFun (Label -> Maybe Label
forall a. a -> Maybe a
Just (Label -> Maybe Label) -> [Label] -> [Maybe Label]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Label]
args) Expr a
body

-- | Extract a term definition and annotation.
getTermDef :: Definition ann -> Maybe (TermDef ann)
getTermDef :: Definition ann -> Maybe (TermDef ann)
getTermDef = \case
  TermDef TermDef ann
def -> TermDef ann -> Maybe (TermDef ann)
forall a. a -> Maybe a
Just TermDef ann
def
  TypeDef{} -> Maybe (TermDef ann)
forall a. Maybe a
Nothing

-- | Get the name of a term definition.
getTermName :: TermDef a -> Var
getTermName :: TermDef a -> Label
getTermName = \case
  Variable a
_ Label
name Expr a
_ -> Label
name
  Function a
_ Label
name [Maybe Label]
_ Expr a
_ -> Label
name

-- | Get definition name
getDefName :: Definition ann -> Text
getDefName :: Definition ann -> Label
getDefName = \case
  TermDef (Variable ann
_ Label
name Expr ann
_) -> Label
name
  TermDef (Function ann
_ Label
name [Maybe Label]
_ Expr ann
_) -> Label
name
  TypeDef (Datatype ann
_ Label
name [Label]
_ [Variant (Maybe Type)]
_) -> Label
name

-- | Extract a type definition and annotation.
getTypeDef :: Definition ann -> Maybe (Datatype ann)
getTypeDef :: Definition ann -> Maybe (Datatype ann)
getTypeDef = \case
  TermDef{} -> Maybe (Datatype ann)
forall a. Maybe a
Nothing
  TypeDef Datatype ann
def -> Datatype ann -> Maybe (Datatype ann)
forall a. a -> Maybe a
Just Datatype ann
def

-- | Get the name of a term definition.
getTermAnn :: TermDef ann -> ann
getTermAnn :: TermDef ann -> ann
getTermAnn = \case
  Variable ann
ann Label
_ Expr ann
_ -> ann
ann
  Function ann
ann Label
_ [Maybe Label]
_ Expr ann
_ -> ann
ann

-- | Set the annotation of a term definition.
setTermAnn :: a -> TermDef a -> TermDef a
setTermAnn :: a -> TermDef a -> TermDef a
setTermAnn a
ann = \case
  Variable a
_ Label
name Expr a
expr -> a -> Label -> Expr a -> TermDef a
forall a. a -> Label -> Expr a -> TermDef a
Variable a
ann Label
name Expr a
expr
  Function a
_ Label
name [Maybe Label]
args Expr a
body -> a -> Label -> [Maybe Label] -> Expr a -> TermDef a
forall a. a -> Label -> [Maybe Label] -> Expr a -> TermDef a
Function a
ann Label
name [Maybe Label]
args Expr a
body

-- | Get the name of a datatype definition.
getTypeName :: Datatype ann -> Constr
getTypeName :: Datatype ann -> Label
getTypeName = \case
  Datatype ann
_ Label
name [Label]
_ [Variant (Maybe Type)]
_ -> Label
name

-- | Get the annotation of a datatype definition.
getTypeAnn :: Datatype ann -> ann
getTypeAnn :: Datatype ann -> ann
getTypeAnn = \case
  Datatype ann
ann Label
_ [Label]
_ [Variant (Maybe Type)]
_ -> ann
ann

-- | Set the annotation of a datatype definition.
setTypeAnn :: b -> Datatype a -> Datatype b
setTypeAnn :: b -> Datatype a -> Datatype b
setTypeAnn b
ann = \case
  Datatype a
_ Label
a [Label]
b [Variant (Maybe Type)]
c -> b -> Label -> [Label] -> [Variant (Maybe Type)] -> Datatype b
forall a.
a -> Label -> [Label] -> [Variant (Maybe Type)] -> Datatype a
Datatype b
ann Label
a [Label]
b [Variant (Maybe Type)]
c

-- | Retrieve the annotation of an expression. Will explode when used on a non @EAnnotated@ node.
getExprAnn :: Show a => Expr a -> a
getExprAnn :: Expr a -> a
getExprAnn = \case
  EAnnotated a
typ Expr a
_ -> a
typ
  Expr a
e -> String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ Label -> String
toString (Label -> String) -> Label -> String
forall a b. (a -> b) -> a -> b
$ Label
"Expr is not annotated: " Label -> Label -> Label
forall a. Semigroup a => a -> a -> a
<> Expr a -> Label
forall a. Show a => a -> Label
pShow Expr a
e