Functional CSharp 0.6

Rating: No reviews yet
Downloads: 673
Released: Sep 7, 2010
Updated: Sep 12, 2010 by holoed
Dev status: Beta Help Icon

Recommended Download

Application FunctionalCSharp_bin_0.6.zip
application, 56K, uploaded Sep 12, 2010 - 320 downloads

Other Available Downloads

Source Code FunctionalCSharp_src_0.6.zip
source code, 733K, uploaded Sep 12, 2010 - 353 downloads

Release Notes

New features in this release.

*C# Discriminated Unions (with structural equality)
public interface Exp
{
   Exp Var(string x);
   Exp Lam(string x, Exp e);
   Exp Let(string x, Exp e1, Exp e2);
   Exp App(Exp e1, Exp e2);
}

var exp = DataType.New<Exp>();

exp = exp.Let("f", exp.Lam("x", exp.Var("x")), exp.Var("f"));    

*Pattern matching on Discriminated Unions

 Func<Exp, string> toString = null;
 toString = expr => expr.Match()
         .With(o => o.Var, (string x) => x)
         .With(o => o.Let, (string x, Exp e1, Exp e2) => string.Format("let {0} = {1} in {2}", x, toString(e1), toString(e2)))
         .With(o => o.Lam, (string x, Exp e) => string.Format("fun {0} -> {1}", x, toString(e)))
         .Return<string>();

*Added more Active Patterns of LINQ Expressions
  • UnaryExpression
  • MethodCallExpression

Reviews for this release

No reviews yet for this release. (Previous release: 5 stars out of five with 1 rating and 1 review)