relude-1.2.2.0: Safe, performant, user-friendly and lightweight Haskell Standard Library

Copyright | (c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2023 Kowainik
License | MIT
Maintainer | Kowainik <xrom.xkov@gmail.com>
Stability | Stable
Portability | Portable
Safe Haskell | Safe
Language | Haskell2010

Relude.Lifted.Exit

Description

Lifted versions of functions that work with exit processes.

Synopsis

- exitWith :: MonadIO m => ExitCode -> m a
- exitFailure :: MonadIO m => m a
- exitSuccess :: MonadIO m => m a
- die :: MonadIO m => String -> m a

# Documentation

exitWith :: MonadIO m => ExitCode -> m a #

Lifted version of `exitWith`.

    >>> exitWith (ExitFailure 3)
    *** Exception: ExitFailure 3

    >>> exitWith ExitSuccess
    *** Exception: ExitSuccess

exitFailure :: MonadIO m => m a #

Lifted version of `exitFailure`.

    >>> exitFailure
    *** Exception: ExitFailure 1

exitSuccess :: MonadIO m => m a #

Lifted version of `exitSuccess`.

    >>> exitSuccess
    *** Exception: ExitSuccess

die :: MonadIO m => String -> m a #

Lifted version of `die`.

    >>> die "Goodbye!"
    Goodbye!
    *** Exception: ExitFailure 1