module Language.Drasil.Code.Imperative.Helpers (
liftS, convScope
) where
import Control.Monad.State (State)
import Drasil.GOOL (SharedProg, ScopeSym(..))
import Language.Drasil.Code.Imperative.DrasilState (ScopeType(..))
liftS :: State a b -> State a [b]
liftS :: forall a b. State a b -> State a [b]
liftS = (b -> [b]) -> StateT a Identity b -> StateT a Identity [b]
forall a b. (a -> b) -> StateT a Identity a -> StateT a Identity b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (b -> [b] -> [b]
forall a. a -> [a] -> [a]
: [])
convScope :: (SharedProg r) => ScopeType -> r (Scope r)
convScope :: forall (r :: * -> *). SharedProg r => ScopeType -> r (Scope r)
convScope ScopeType
Local = r (Scope r)
forall (r :: * -> *). ScopeSym r => r (Scope r)
local
convScope ScopeType
Global = r (Scope r)
forall (r :: * -> *). ScopeSym r => r (Scope r)
global
convScope ScopeType
MainFn = r (Scope r)
forall (r :: * -> *). ScopeSym r => r (Scope r)
mainFn