Copyright | (c) Edward Kmett |
---|---|
License | BSD3 |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides extensions to the bound
package.
- hoistScope :: Functor f => (forall x. f x -> g x) -> Scope b f a -> Scope b g a
- bitraverseScope :: (Bitraversable t, Applicative f) => (k -> f k') -> (a -> f a') -> Scope b (t k) a -> f (Scope b (t k') a')
- transverseScope :: (Applicative f, Monad f, Traversable g) => (forall r. g r -> f (h r)) -> Scope b g a -> f (Scope b h a)
- class Monad m => BoundBy tm m | tm -> m where
- boundBy :: (a -> m b) -> tm a -> tm b
- instantiateVars :: Monad t => [a] -> Scope Int t a -> t a
- serializeScope3 :: MonadPut m => (b -> m ()) -> (forall a. (a -> m ()) -> f a -> m ()) -> (v -> m ()) -> Scope b f v -> m ()
- deserializeScope3 :: MonadGet m => m b -> (forall a. m a -> m (f a)) -> m v -> m (Scope b f v)
- mergeScope :: Monad c => Scope b1 (Scope b2 c) a -> Scope (Var b1 b2) c a
- splitScope :: (Applicative c, Monad c) => Scope (Var b1 b2) c a -> Scope b1 (Scope b2 c) a
- rebind :: Functor f => (b -> Var b' (f a)) -> Scope b f a -> Scope b' f a
- inScope :: (Functor f, Monad t) => (t (Var b a) -> f (t (Var b a))) -> Scope b t a -> f (Scope b t a)
- _Scope :: Iso (Scope b f a) (Scope b' f' a') (f (Var b (f a))) (f' (Var b' (f' a')))
Documentation
hoistScope :: Functor f => (forall x. f x -> g x) -> Scope b f a -> Scope b g a
bitraverseScope :: (Bitraversable t, Applicative f) => (k -> f k') -> (a -> f a') -> Scope b (t k) a -> f (Scope b (t k') a')
transverseScope :: (Applicative f, Monad f, Traversable g) => (forall r. g r -> f (h r)) -> Scope b g a -> f (Scope b h a)
class Monad m => BoundBy tm m | tm -> m where Source
Generalizes Bound
to permit binding by another type without taking it as a parameter.
instantiateVars :: Monad t => [a] -> Scope Int t a -> t a
serializeScope3 :: MonadPut m => (b -> m ()) -> (forall a. (a -> m ()) -> f a -> m ()) -> (v -> m ()) -> Scope b f v -> m () Source
deserializeScope3 :: MonadGet m => m b -> (forall a. m a -> m (f a)) -> m v -> m (Scope b f v) Source
mergeScope :: Monad c => Scope b1 (Scope b2 c) a -> Scope (Var b1 b2) c a Source
splitScope :: (Applicative c, Monad c) => Scope (Var b1 b2) c a -> Scope b1 (Scope b2 c) a Source
rebind :: Functor f => (b -> Var b' (f a)) -> Scope b f a -> Scope b' f a Source
Enables a partial rebinding and instantiation of the bound variables in a
Scope
.