Giter Site home page Giter Site logo

monad-io-adapter's Introduction

monad-io-adapter Build Status

This Haskell package provides utilities for converting between computations parameterized via two different typeclasses, both of which can be used to abstract over monad transformer stacks with IO at the base. Unfortunately, both classes are frequently used in the Haskell ecosystem, since they have minor differences:

  • MonadIO comes from the base package (as of base version 4.9.0.0), and it provides a liftIO operation. It is an extremely simple typeclass, focusing exclusively on lifting IO actions through transformer stacks with IO at the base.

  • MonadBase comes from the transformers-base package, and it is a generalized version of MonadIO. It provides a more general liftBase function, which allows lifting to an arbitrary base monad.

    Generally, this additional power isn’t especially useful, but MonadBase appears most often through MonadBaseControl, a subclass from the monad-control package that enables lifting operations that accept an action in negative position. This class has no IO-specialized equivalent (not directly, at least), so it often appears in lifted “control” operations.

Due to these typeclasses being unrelated, it’s not entirely uncommon to end up with type signatures like (MonadIO m, MonadBaseControl IO m) => ..., which are a little silly, since MonadBaseControl IO really includes all the power of MonadIO.

For more information, see the documentation on Hackage.

monad-io-adapter's People

Contributors

lexi-lambda avatar

Stargazers

 avatar Pavel Kogan avatar  avatar Val Packett avatar Marco Z avatar Daniel Kahlenberg avatar Elliot Cameron avatar

Watchers

 avatar Franklin Henderson avatar  avatar James Cloos avatar Stu Penrose avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.