language-pts-0: Pure Type Systems

Safe HaskellNone
LanguageHaskell2010

Bound.ScopeT

Synopsis

Documentation

newtype ScopeT n t f a Source #

`'Scope n' ~ ScopeT n Identity'.

Constructors

ScopeT 

Fields

Instances

(Functor (t f), Functor f) => Functor (ScopeT n t f) Source # 

Methods

fmap :: (a -> b) -> ScopeT n t f a -> ScopeT n t f b #

(<$) :: a -> ScopeT n t f b -> ScopeT n t f a #

(Foldable (t f), Foldable f) => Foldable (ScopeT n t f) Source # 

Methods

fold :: Monoid m => ScopeT n t f m -> m #

foldMap :: Monoid m => (a -> m) -> ScopeT n t f a -> m #

foldr :: (a -> b -> b) -> b -> ScopeT n t f a -> b #

foldr' :: (a -> b -> b) -> b -> ScopeT n t f a -> b #

foldl :: (b -> a -> b) -> b -> ScopeT n t f a -> b #

foldl' :: (b -> a -> b) -> b -> ScopeT n t f a -> b #

foldr1 :: (a -> a -> a) -> ScopeT n t f a -> a #

foldl1 :: (a -> a -> a) -> ScopeT n t f a -> a #

toList :: ScopeT n t f a -> [a] #

null :: ScopeT n t f a -> Bool #

length :: ScopeT n t f a -> Int #

elem :: Eq a => a -> ScopeT n t f a -> Bool #

maximum :: Ord a => ScopeT n t f a -> a #

minimum :: Ord a => ScopeT n t f a -> a #

sum :: Num a => ScopeT n t f a -> a #

product :: Num a => ScopeT n t f a -> a #

(Traversable (t f), Traversable f) => Traversable (ScopeT n t f) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> ScopeT n t f a -> f (ScopeT n t f b) #

sequenceA :: Applicative f => ScopeT n t f (f a) -> f (ScopeT n t f a) #

mapM :: Monad m => (a -> m b) -> ScopeT n t f a -> m (ScopeT n t f b) #

sequence :: Monad m => ScopeT n t f (m a) -> m (ScopeT n t f a) #

(Show n, Show1 (t f), Show1 f) => Show1 (ScopeT n t f) Source # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ScopeT n t f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ScopeT n t f a] -> ShowS #

(PrettyPrec n, PrettyPrec1 (t f), PrettyPrec1 f) => PrettyPrec1 (ScopeT n t f) Source # 

Methods

liftPpp :: (Int -> a -> Doc ()) -> Int -> ScopeT n t f a -> Doc () Source #

(Show n, Show1 (t f), Show1 f, Show a) => Show (ScopeT n t f a) Source # 

Methods

showsPrec :: Int -> ScopeT n t f a -> ShowS #

show :: ScopeT n t f a -> String #

showList :: [ScopeT n t f a] -> ShowS #

(>>>>=) :: (Monad f, Functor (t f)) => ScopeT n t f a -> (a -> f b) -> ScopeT n t f b infixl 1 Source #

abstractT :: (Functor (t f), Monad f) => (a -> Maybe n) -> t f a -> ScopeT n t f a Source #

abstract1T :: (Functor (t f), Monad f, Eq a) => a -> t f a -> ScopeT () t f a Source #

Abstract over a single variable.

>>> abstract1T 'x' (MaybeT (Nothing : map Just "xyz"))
ScopeT (MaybeT [Nothing,Just (B ()),Just (F "y"),Just (F "z")])

abstractTName :: (Functor (t f), Monad f) => (a -> Maybe b) -> t f a -> ScopeT (Name a b) t f a Source #

Abstraction, capturing named bound variables.

abstract1TName :: (Functor (t f), Monad f, Eq a) => a -> t f a -> ScopeT (Name a ()) t f a Source #

Abstract over a single variable

instantiateT :: (Bound t, Monad f) => (n -> f a) -> ScopeT n t f a -> t f a Source #

instantiate1T :: (Bound t, Monad f) => f a -> ScopeT n t f a -> t f a Source #

fromScopeT :: (Bound t, Monad f) => ScopeT n t f a -> t f (Var n a) Source #

toScopeT :: (Functor (t f), Monad f) => t f (Var n a) -> ScopeT n t f a Source #

lowerScopeT :: Functor (t f) => (forall x. t f x -> g x) -> (forall x. f x -> g x) -> ScopeT n t f a -> Scope n g a Source #

bindingsT :: Foldable (t f) => ScopeT b t f a -> [b] Source #

Return a list of occurences of the variables bound by this Scope.

>>> import Control.Monad.Trans.Maybe