TsMonad - Little monad library designed for TypeScript

  •        410

This library provides implementations of the most useful monads outside of Haskell (subjectively, this is Maybe and Either). It also provides a strongly-typed emulation of pattern matching to help enforce program correctness. I won't presume to attempt a monad tutorial here. There are several online - I recommend Douglas Crockford's Monads & Gonads talk.




Related Projects

static-land - Specification for common algebraic structures in JavaScript based on Fantasy Land

  •    Javascript

This is a specification for common algebraic structures in JavaScript based on Fantasy Land.Fantasy Land uses methods to define interfaces that a type must implement in order to support a particular Algebra. For example values of a type that implements the Monoid algebra must have fantasy-land/empty and fantasy-land/concat methods on them.

fantasy-land - Specification for interoperability of common algebraic structures in JavaScript

  •    Javascript

An algebra is a set of values, a set of operators that it is closed under and some laws it must obey. Each Fantasy Land algebra is a separate specification. An algebra may have dependencies on other algebras which must be implemented.

eff - Eff monad for cats - http://atnos-org.github.io/eff

  •    Scala

Extensible effects are an alternative to monad transformers for computing with effects in a functional way. This library is based on the "free-er" monad and extensible effects described in Oleg Kiselyov in Freer monads, more extensible effects. You can also check out this presentation at flatMap Oslo 2016 (slides).

learn-fp - learn-by-doing course/tutorial for functional programming on scala

  •    Scala

This course/tutorial was created with purpose to better understand functional programming idioms using Scala language. It covers type classes, monoids, functors, applicatives, monads, traversable/foldable, monad transformers, free monad. Material is structured as set of stub/unimplemented functions/classes and tests for them. Your objective is to make all unit tests green. It is learn-by-doing course. NICTA course was a great and interesting challenge for me to do in Haskell. I think Scala community will benefit from the similar course.

arrow - Functional companion to Kotlin's Standard Library

  •    Kotlin

Λrrow is a library for Typed Functional Programming in Kotlin. Arrow aims to provide a lingua franca of interfaces and abstractions across Kotlin libraries. For this, it includes the most popular data types, type classes and abstractions such as Option, Try, Either, IO, Functor, Applicative, Monad to empower users to write pure FP apps and libraries built atop higher order abstractions.

SCALAZ - An extension to the core Scala library for functional programming

  •    Scala

An extension to the core Scala library for functional programming. It provides purely functional data structures to complement those from the Scala standard library. It defines a set of foundational type classes (e.g. Functor, Monad) and corresponding instances for a large number of data structures.

pointfree-fantasy - Point free wrappers for fantasy land

  •    Javascript

Point-free wrappers for fantasy-land. Functions are curried using lodash's curry function, and receive their data last. Gives us aliases with our familar haskell names as well. pointfree-fantasy implements a point-free version of the fantasy-land spec, in order to promote a less cluttered, more Haskell-like approach to algebraic programming. We'll justify this approach using Functor as an example.

data.task - Migrating to https://github.com/origamitower/folktale

  •    Javascript

The Task(a, b) structure represents values that depend on time. This allows one to model time-based effects explicitly, such that one can have full knowledge of when they're dealing with delayed computations, latency, or anything that can not be computed immediately. A common use for this monad is to replace the usual Continuation-Passing Style form of programming, in order to be able to compose and sequence time-dependent effects using the generic and powerful monadic operations.

crocks - A collection of well known Algebraic Data Types for your utter enjoyment.

  •    Javascript

crocks is a collection of popular Algebraic Data Types (ADTs) that are all the rage in functional programming. You have heard of things like Maybe and Either and heck maybe even IO, that is what these are. The main goal of crocks is to curate and provide not only a common interface between each type (where possible of course), but also provide all of the helper functions needed to hit the ground running. There are many options to use crocks to suit the needs of your, projects. When used on the backend or in an environment where size is not a big concern, the entire lib can be brought in and the various elements can be either be plucked off of or referenced by the namespace.

cyclops-react - An advanced, but easy to use, platform for writing functional applications in Java 8

  •    Java

Powerful Streams and functional data types for building modern Java 8 applications. We extend JDK interfaces where possible for maximum integration.ReactiveSeq extends JDK Stream and offers multiple modes of execution - synchonous, asynchronous, asynchronous with backpressure, parallel and more.

list - 🐆 An immutable list with unmatched performance and a comprehensive functional API.

  •    TypeScript

A fast immutable list with a functional API. List is a purely functional alternative to arrays. It is an implementation of a fast persistent sequence data structure. Compared to JavaScript's Array List has three major benefits.

language-ext - C# functional language extensions - a base class library for functional programming

  •    CSharp

This library uses and abuses the features of C# 6+ to provide a functional 'Base class library', that, if you squint, can look like extensions to the language itself.language-ext is an MIT-licensed open source project. Its ongoing development is made possible thanks to the support by these awesome backers. If you'd like to join them, check out the language-ext Patreon campaign. Or if you'd just like to help support the coffee fund, that is very welcome too!.

scalaz-zio - ZIO — A principled, powerful, standalone effect data type for any Scala project.

  •    Scala

The ZIO library provides a general-purpose effect monad and associated abstractions for purely functional Scala applications. Effect monads like IO are how purely functional programs interact with the real world. Functional programmers use them to build complex, real world software without giving up the equational reasoning, composability, and type safety afforded by purely functional programming.

monads - Simple Ruby implementations of some common monads.

  •    Ruby

This library provides simple Ruby implementations of some common monads. The most important method of each implementation is #and_then (a.k.a. bind or >>=), which is used to connect together a sequence of operations involving the value(s) inside the monad. Each monad also has a .from_value class method (a.k.a. return or unit) for constructing an instance of that monad from an arbitrary value.

hamsters - A mini Scala utility library

  •    Scala

A mini Scala utility library. Compatible with functional programming beginners. For the JVM and Scala.js.

MonadEx - Upgrade your pipelines with monads.

  •    Elixir

MonadEx introduces monads into Elixir. Monads encapsulate state and control the flow of code. A monad's bind operation is similar, but more powerful, than Elixir's built-in pipelines. Monads may be combined to make even more useful constructs. For example, you may want to use a state monad in combination with a result monad. The state monad can track a shared environment and the result monad can keep track of the success or failure state.

csharp-monad - Library of monads for C#

  •    CSharp

A C# library of monads and a full set of parser combinators based on the Haskell Parsec library.The library is stable, functional and pretty well tested.

monad-bayes - A library for probabilistic programming in Haskell.

  •    Haskell

A library for probabilistic programming in Haskell using probability monads. The emphasis is on composition of inference algorithms implemented in terms of monad transformers. Created by Adam Scibior (@adscib), maintained by Tweag I/O.

We have large collection of open source products. Follow the tags from Tag Cloud >>

Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.