module Language.Drasil.Code.Imperative.Helpers (
liftS, convScope
) where
import Control.Monad.State (State)
import Drasil.GOOL (SharedProg, ScopeSym(..), ScopeData)
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 ScopeData
convScope :: forall (r :: * -> *). SharedProg r => ScopeType -> r ScopeData
convScope ScopeType
Local = r ScopeData
forall (r :: * -> *). ScopeSym r => r ScopeData
local
convScope ScopeType
Global = r ScopeData
forall (r :: * -> *). ScopeSym r => r ScopeData
global
convScope ScopeType
MainFn = r ScopeData
forall (r :: * -> *). ScopeSym r => r ScopeData
mainFn