Giter Site home page Giter Site logo

exceptional's Introduction

exceptional

This is a Haskell library that exists to house a type:

data Exceptional x
  = Failure String
  | Success x

It's much like Maybe, except instead of Nothing, we have Failure String.

A comparison could also be made to Either String. I made this library because I was dissatisfied with the Monad instance for Either. In this type, fail = Failure. It's rather simple.

Installing

cabal install exceptional

Or, add exceptional to the build-depends field in your .cabal file.

exceptional's People

Contributors

pharpend avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bergmark

exceptional's Issues

Compilation issues with GHC 8.10

The fail method for Monad was removed in ghc 8.8.1, see:
https://downloads.haskell.org/~ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html#base-library

Configuring library for exceptional-0.3.0.0..
Preprocessing library for exceptional-0.3.0.0..
Building library for exceptional-0.3.0.0..
[1 of 1] Compiling Control.Exceptional ( Control/Exceptional.hs, dist/build/Control/Exceptional.o, dist/build/Control/Exceptional.dyn_o )

Control/Exceptional.hs:43:3: error:
    ‘fail’ is not a (visible) method of class ‘Monad’
   |
43 |   fail = Failure
   |   ^^^^

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.