Skip to content

Instantly share code, notes, and snippets.

View arseniiv's full-sized avatar
🌜

Arsenii A. arseniiv

🌜
View GitHub Profile

Monads and delimited control are very closely related, so it isn’t too hard to understand them in terms of one another. From a monadic point of view, the big idea is that if you have the computation m >>= f, then f is m’s continuation. It’s the function that is called with m’s result to continue execution after m returns.

If you have a long chain of binds, the continuation is just the composition of all of them. So, for example, if you have

m >>= f >>= g >>= h

then the continuation of m is f >=> g >=> h. Likewise, the continuation of m >>= f is g >=> h.

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using Teclado.Common;
namespace Teclado.WinApi
{
public static class Hooks
{
#region Public methods
@gavinking
gavinking / README.md
Last active February 7, 2018 09:42
Ceylon Web Runner: Records

Typesafe Records for Ceylon

The example demonstrates the use of Ceylon's powerful type system to define typesafe heterogenous maps, otherwise known as record types.

  • records.ceylon defines a tiny library for creating records
  • keys.ceylon defines example typesafe keys