Relude.Lifted

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

Description

Lifted versions of base functions.

These functions are lifted in a sense that you can use them inside various monad transformers without adding `liftIO` calls explicitly. However, you still can use all these functions inside plain `IO` monad as usual.

### Example

#### `base`

With the `base` function, you can easily work with these functions in the `IO` monad:

    main :: IO ()
    main = do
        x <- getLine
        print x

However, to work in `MonadIO` you already need to "lift" them:

    main :: MonadIO m => m ()
    main = do
        x <- liftIO getLine
        liftIO (print x)

#### `relude`

In the meantime, `relude` provides these function that can work in `IO` the same way:

    main :: IO ()
    main = do
        x <- getLine
        print x

But also allows you to work in the `MonadIO` monads more easily:

    main :: MonadIO m => m ()
    main = do
        x <- getLine
        print x

Synopsis

- module Relude.Lifted.Concurrent
- module Relude.Lifted.IORef
- module Relude.Lifted.Exit
- module Relude.Lifted.File
- module Relude.Lifted.Terminal
- module Relude.Lifted.Handle
- module Relude.Lifted.Env

# Documentation

module Relude.Lifted.Concurrent

Lifted `MVar` and `STM` functions.

module Relude.Lifted.IORef

Lifted reexports from Data.IORef module.

module Relude.Lifted.Exit

Lifted versions of functions that work with exit processes.

module Relude.Lifted.File

Lifted versions of functions working with files and common `IO`.

module Relude.Lifted.Terminal

Lifted functions to work with stdin and stdout.

module Relude.Lifted.Handle

Lifted functions to work with `IO` `Handle`s.

module Relude.Lifted.Env

Lifted functions to work with system environment.