Skip to content

Instantly share code, notes, and snippets.

@dminuoso

dminuoso/f.hs Secret

Created September 28, 2022 19:33
Show Gist options
  • Save dminuoso/065e043d05cd601008729bc3c8198239 to your computer and use it in GitHub Desktop.
Save dminuoso/065e043d05cd601008729bc3c8198239 to your computer and use it in GitHub Desktop.
parseNested :: FilePath -> Parser ()
parseNested path = do
txt <- readBuf path
oldBase <- gets (_psCurrentPath)
setCurrentPath (takeDirectory path)
r <- lift $ runParserT principleFile' path txt
case r of
Left bundle -> liftIO $ throwIO (CpeNestedError bundle)
Right () -> setCurrentPath oldBase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment