Giter Club home page Giter Club logo

endofunk-fx's Introduction

Platform

Twitter

This library provides a functional-programming core library: Endofunk.FX, that adds many of the data types needed for exploiting a functional programming style in your codebase; more data types will be added in due course.

Functional Data Types

The following is an incompete list of the functional data types included in Endofunc.FX.

Type Overview
Identity The Identity type is a trivial type to access functor, monad, applicative functor, etc. algebras.
Maybe The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing)
Either The Either type encapsulates a logical disjunction of two possibilities: either Left or Right.
Result The Result type is similar to the Either type except that the left disjunction is fixed to capture of a C# Exception.
Validation The Validation data type is isomorphic to Either, but has an instance of Applicative that accumulates on the error side.
Reader The Reader type (also called the Environment monad). Represents a computation, which can read values from a shared environment, pass values from function to function, and execute sub-computations in a modified environment.
State The State monad wraps computations in the context of reading and modifying a global state object.
Coyoneda The Coyoneda is a contravariant Functor suitable for Yoneda reduction.
Yoneda The yoneda is a covariant Functor suitable for Yoneda reduction.
Tagged The Tagged union type is comparable to Swift enums with generically associated values.
Store The Store is modelled on the Redux concept.
Reducer The Reducer is modelled on the Redux concept.
Subscriber The Suscriber is modelled on the Redux concept.
Action The Tagged type fulfills the role of the Action in the Redux concept.
Lazy The Lazy type extends the existing Microsoft Lazy type with functor, monad, applicative functor algebras.
Lens Functional getter and setter for product types.
Prism Functional getter and setter for sum types.

All types support Functor, Applicative Functor and Monad; with monadic lifters, applicative lifters, Kleisli monadic composition, Linq, Traverse and Sequence.

Further enhancements and functional syntactic sugar has been incorporated in a Endofunc.FX.Prelude static class to simplify general use of the functional data types.

Nu-get

Nu-get package Description
Endofunk.FX All of the core data types and functional 'prelude'.
Endofunk.Data Functional wrapper for SQLClient and SQLite (WIP)
Endofunk.Net Functional wrapper for System.Net (WIP)

License

License.md

Future Plans

  • The IO, Writer and Union type monads are a work in progress.
  • I intend to explore adding functional extension methods to the C# 8.0 Nullable types to turn Nullable into a 1st class functional type similar to Maybe, and hopefully to also enabe smooth transforms between value and class element types.
  • Functional concurrency with Task, and/or Promise / Future types.
  • ...

This documentation is a work in progress and will be significantly enhanced as part of the firming up of the API, the data types and the usage examples for each data type.

Secondly we have a goal to provide existing functional API wrappers frequently used .NET Core functonality; Endofunc.Net and EndoFunc.Data are the first two functional API wrapperss for Web, SQLite and SqlClient connections respectively.

Examples will be added in due course to demonstrate how these APIs can be used to simplify and crash proof your code without sacrificing features.

endofunk-fx's People

Contributors

endofunk avatar

Stargazers

 avatar  avatar  avatar  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.