GithubHelp home page GithubHelp logo

davidboers / elmeither Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 9 KB

Implements the Either declaration in Elm.

License: BSD 3-Clause "New" or "Revised" License

Elm 100.00%
elm functional-programming either package

elmeither's Introduction

Either Elm

The first time I tried Functional Programming, I thought "What the hell is this? Why would anybody program this way?" Then, I tried it out a little more. Then I realized how fun it is. Particularly the genius that comes with having to be resourceful. In no instance is that clearer than Haskell's Maybe and Either declarations.

-- Basically a nullable value. It could exist (as any type) or it could be Nothing. 
-- Akin to Java's '@nullable' annotation

type Maybe a
    = Just a
    | Nothing

-- Could be of type a or type b.

type Either a b
    = Left a
    | Right b

Although Maybe is implemented in Elm, Either is not; until now. This module contains a declaration of Haskell's Either type, verbatim from the source code of the GHC library. It also contains a couple of other functions related to the declaration.

Just do

elm install kingwither/elmeither

and the package will be installed!

import Either exposing (Either(..))

You're all set! Either is now Either Haskell Elm!

elmeither's People

Contributors

davidboers avatar

Watchers

 avatar

Forkers

elm-review-bot

elmeither's Issues

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.