GithubHelp home page GithubHelp logo

dgnaegi / galaxus.functional Goto Github PK

View Code? Open in Web Editor NEW

This project forked from digitecgalaxus/galaxus.functional

0.0 0.0 0.0 82 KB

A package bringing popular functional abstractions (e.g. Option or Either) to C#.

License: Other

C# 100.00%

galaxus.functional's Introduction

Galaxus.Functional

Introduction

Galaxus.Functional is a package that aims to bring FP-style features to C#. Note though, that this is not true functional programming; this package contains some useful abstractions often found in functional languages.

The style is greatly inspired by the way Rust does this. If you have worked with Rust's std::option or std::result, you will probably feel right at home.

Abstractions

There currently are the following abstractions found inside Galaxus.Functional:

Option

A type used to explicitly mark the presence or absence of a value. This is an alternative to checking for null and is similar to e.g. Haskell's Maybe or Java's Optional.

Unit

A type for something that does not exist, similar to void - except that it can be returned and stored as a value.

Either

A type that can be one of several variants, sort of like a discriminated union or an enum with a stored value for each enum member.

Result

A type that explicitly propagates success or error to the caller, similar to used explicitly annotated exceptions. It can be seen as a specialization of an Either with the second variant being an error.

Contribute

No matter how small, we value every contribution! If you wish to contribute,

  1. Please create an issue first - this way, we can discuss the feature and flesh out the nitty-gritty details
  2. Fork the repository, implement the feature and submit a pull request
  3. Add yourself to the CONTRIBUTORS.txt file in that pull request
  4. Once the maintainers have released a new version, your feature will be part of the NuGet package

And always remember the golden rule for every contribution: Be excellent to each other!

galaxus.functional's People

Contributors

phkiener avatar flipbug avatar boskicthebrain avatar mindswipe avatar b4n4n4j03 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.