Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines a convenience monad/typeclass for creating normalised programs.
Synopsis
- data BinderT lore m a
- runBinderT :: MonadFreshNames m => BinderT lore m a -> Scope lore -> m (a, Stms lore)
- class Attributes lore => BinderOps lore where
- mkExpAttrB :: (MonadBinder m, Lore m ~ lore) => Pattern lore -> Exp lore -> m (ExpAttr lore)
- mkBodyB :: (MonadBinder m, Lore m ~ lore) => Stms lore -> Result -> m (Body lore)
- mkLetNamesB :: (MonadBinder m, Lore m ~ lore) => [VName] -> Exp lore -> m (Stm lore)
- bindableMkExpAttrB :: (MonadBinder m, Bindable (Lore m)) => Pattern (Lore m) -> Exp (Lore m) -> m (ExpAttr (Lore m))
- bindableMkBodyB :: (MonadBinder m, Bindable (Lore m)) => Stms (Lore m) -> Result -> m (Body (Lore m))
- bindableMkLetNamesB :: (MonadBinder m, Bindable (Lore m)) => [VName] -> Exp (Lore m) -> m (Stm (Lore m))
- type Binder lore = BinderT lore (State VNameSource)
- runBinder :: (MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Binder lore a -> m (a, Stms lore)
- runBinder_ :: (MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Binder lore a -> m (Stms lore)
- joinBinder :: MonadBinder m => Binder (Lore m) a -> m a
- runBodyBinder :: (Bindable lore, MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Binder lore (Body lore) -> m (Body lore)
- addBinderStms :: Monad m => Stms lore -> BinderT lore m ()
- collectBinderStms :: Monad m => BinderT lore m a -> BinderT lore m (a, Stms lore)
- certifyingBinder :: (MonadFreshNames m, BinderOps lore) => Certificates -> BinderT lore m a -> BinderT lore m a
- module Futhark.Binder.Class
A concrete MonadBinder
monad.
data BinderT lore m a Source #
Instances
runBinderT :: MonadFreshNames m => BinderT lore m a -> Scope lore -> m (a, Stms lore) Source #
class Attributes lore => BinderOps lore where Source #
mkExpAttrB :: (MonadBinder m, Lore m ~ lore) => Pattern lore -> Exp lore -> m (ExpAttr lore) Source #
mkBodyB :: (MonadBinder m, Lore m ~ lore) => Stms lore -> Result -> m (Body lore) Source #
mkLetNamesB :: (MonadBinder m, Lore m ~ lore) => [VName] -> Exp lore -> m (Stm lore) Source #
Instances
bindableMkExpAttrB :: (MonadBinder m, Bindable (Lore m)) => Pattern (Lore m) -> Exp (Lore m) -> m (ExpAttr (Lore m)) Source #
bindableMkBodyB :: (MonadBinder m, Bindable (Lore m)) => Stms (Lore m) -> Result -> m (Body (Lore m)) Source #
bindableMkLetNamesB :: (MonadBinder m, Bindable (Lore m)) => [VName] -> Exp (Lore m) -> m (Stm (Lore m)) Source #
runBinder :: (MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Binder lore a -> m (a, Stms lore) Source #
runBinder_ :: (MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Binder lore a -> m (Stms lore) Source #
Like runBinder
, but throw away the result and just return the
added bindings.
joinBinder :: MonadBinder m => Binder (Lore m) a -> m a Source #
runBodyBinder :: (Bindable lore, MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Binder lore (Body lore) -> m (Body lore) Source #
Non-class interface
certifyingBinder :: (MonadFreshNames m, BinderOps lore) => Certificates -> BinderT lore m a -> BinderT lore m a Source #
The MonadBinder
typeclass
module Futhark.Binder.Class