项目作者: seymourpoler

项目描述 :
An implementation of monads in csharp, with JetBrains Rider as IDE and Lubuntu as operating system
高级语言: C#
项目地址: git://github.com/seymourpoler/Monads.git
创建时间: 2020-04-03T14:19:03Z
项目社区:https://github.com/seymourpoler/Monads

开源协议:MIT License

下载


Monads

Build Status

An implementation of monads in csharp, in Lubuntu 18.04 LTS as operating system and with JetBrains Rider as IDE

Monad.Maybe

Very simple monad Maybe library written in c-sharp.

Create Monad from:

  1. Maybe<string>.Of("Hello")

Return value or another element

  1. var result = Maybe<string>.Of("Hello")
  2. .match(() => "bye", null);

Simple string tokenizer

  1. var result = Maybe<string>.Of("Hello")
  2. .Bind<List<string>> (y => y.Split(' ').ToList<string>())
  3. .Match(x => x, _ => new List<string>());