From d69313ce44a9415555033926c6a64b4120455502 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 6 Oct 2022 10:04:14 +0300 Subject: Add "stack trace" output on error --- src/Utils.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Utils.hs') diff --git a/src/Utils.hs b/src/Utils.hs index 8dd233f..ec8cfc8 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -201,6 +201,10 @@ throwL :: String -> String -> LContext a throwL p s = throwError $ LException mp s where mp = if p == "" then Nothing else Just p +appendError :: String -> LException -> LContext a +appendError as (LException psM es) = + throwError $ LException psM $ es ++ "\n " ++ as + asPairsM :: [a] -> LContext [(a, a)] asPairsM [] = return [] asPairsM (a:b:rest) = do -- cgit v1.3