Skip to content

Instantly share code, notes, and snippets.

View KozzyKoder's full-sized avatar

Vladimir Pestov KozzyKoder

  • Booking.com
  • Amsterdam, Netherlands
View GitHub Profile
@tonymorris
tonymorris / PureIO.cs
Last active April 2, 2022 16:23
A demonstration of pure-functional I/O using the free monad in C#
using System;
namespace PureIO {
/*
C# does not have proper sum types. They must be emulated.
This data type is one of 4 possible values:
- WriteOut, being a pair of a string and A
- WriteErr, being a pair of a string and A
- readLine, being a function from string to A