diff options
Diffstat (limited to 'src/Utils.hs')
| -rw-r--r-- | src/Utils.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Utils.hs b/src/Utils.hs index ec8cfc8..4421f8a 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -30,6 +30,8 @@ data LState = LState { stateDepth :: Int } +type LineNo = Int + type LContext a = StateT LState (ExceptT LException IO) a runL :: LState -> LContext a -> IO (Either LException (a, LState)) @@ -58,6 +60,10 @@ incrementDepth :: LContext () incrementDepth = modify (\s -> s { stateDepth = stateDepth s + 1 }) +decrementDepth :: LContext () +decrementDepth = + modify (\s -> s { stateDepth = stateDepth s - 1 }) + getDepth :: LContext Int getDepth = do s <- get |
