Copyright | disco team and contributors |
---|---|
License | BSD-3-Clause |
Maintainer | byorgey@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Polysemy effect for local fresh name generation, compatible with the unbound-generics library.
Synopsis
- data LFresh m a where
- getAvoids :: forall r. Member LFresh r => Sem r (Set AnyName)
- avoid :: forall r a. Member LFresh r => [AnyName] -> Sem r a -> Sem r a
- lfresh :: forall r a. (Member LFresh r, Typeable a) => Name a -> Sem r (Name a)
- runLFresh :: Sem (LFresh ': r) a -> Sem r a
- runLFresh' :: Sem (LFresh ': r) a -> Sem (Reader (Set AnyName) ': r) a
- lunbind :: (Member LFresh r, Alpha p, Alpha t) => Bind p t -> ((p, t) -> Sem r c) -> Sem r c
- absorbLFresh :: Member LFresh r => (LFresh (Sem r) => Sem r a) -> Sem r a
- data LFreshDict m = LFreshDict {}
- newtype Action m s' a = Action (m a)
Documentation
lunbind :: (Member LFresh r, Alpha p, Alpha t) => Bind p t -> ((p, t) -> Sem r c) -> Sem r c Source #
Open a binder, automatically freshening the names of the bound variables, and providing the opened pattern and term to the provided continuation. The bound variables are also added to the set of in-scope variables within in the continuation.
data LFreshDict m Source #
newtype Action m s' a Source #
Wrapper for a monadic action with phantom type parameter for reflection. Locally defined so that the instance we are going to build with reflection must be coherent, that is there cannot be orphans.
Action (m a) |