8000 GitHub - StepWoodProductions/CSharpx: Functional programming and other utilities for C#
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

StepWoodProductions/CSharpx

 
 

Repository files navigation

CSharpx

Functional programming and other utilities for C# (pre-release).

Every source file contains conditional compilation symbols to change type visibility from public to internal and set other preferences.

Source files are conceived to be manually added to other projects or by setting a reference via Paket. See these paket.dependencies and paket.references as example.

Maybe.cs

  • C# native implementation of F# 'T option / Haskell data Maybe a = Just a | Nothing type.

Either.cs

  • C# native implementation of Haskell data Either a b = Left a | Right b type.
  • Similar also to F# Choice<'T, 'U>.
  • Like in Haskell the convention is to let Right case hold the value and Left keep track of error or similar data.
  • If you want a better implementation of this kind of data, please check my C# port of Chessie, named RailwaySharp.

EnumerableExtensions.cs

  • Most useful extension methods from code.google.com/p/morelinq/.
  • With other useful methods too.

Unit.cs

  • Equivalent to F# unit.

Identity.cs

  • Identity monadic type.
  • The use of this monad can be easly replaced by direct function application.

Note

  • Actually Maybe.cs and EnumerableExtensions.cs are the more mature implementations.
  • I'm working for adding tests, time allowing.
  • Please report any your thought.

About

Functional programming and other utilities for C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 95.8%
  • F# 2.4%
  • Shell 1.4%
  • Batchfile 0.4%
0