by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
void Main() | |
{ | |
var d = new Dictionary<BigInteger, BigInteger>(); | |
var t = DateTime.Now; | |
var howfar = 0; | |
var r = 0; | |
for (int x = 0; x < 100000; x++) | |
{ | |
for (int i = 0; i < 10000000; i++) | |
{ |
// | |
// See https://github.com/louthy/language-ext | |
// | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using LanguageExt; | |
using static LanguageExt.Prelude; |
/* | |
Modified from the original https://gist.github.com/louthy/524fbe8965d3a2aae1b576cdd8e971e4 | |
- removed dependency on [language-ext](https://github.com/louthy/language-ext) | |
- separated monadic boilerplate, so you may concentrate on describing the operations and interpretation of the program | |
- removed `IO<A>.Faulted` to simplify the examples. It can be added back in straightforward manner. | |
Useful links: | |
- [John DeGoes: Beyond Free Monads - λC Winter Retreat 2017](https://www.youtube.com/watch?v=A-lmrvsUi2Y) | |
- [Free and tagless compared - how not to commit to a monad too early](https://softwaremill.com/free-tagless-compared-how-not-to-commit-to-monad-too-early) |