Skip to content

Instantly share code, notes, and snippets.

@jdh30
jdh30 / DraggableRectangles.fs
Created September 17, 2019 01:23
F#+WPF solution to the Draggable Rectangles challenge by Panicz Godek
open System.Windows
let goldenRatio = (1.0 + sqrt 5.0) / 2.0
let newBrush =
let mutable hue = 0.0
fun () ->
hue <- hue + System.Math.PI / goldenRatio
let s x = byte(255.0 * x)
let c x = 0.5 * (cos x + 1.0)
@cmeeren
cmeeren / App.fs
Last active September 18, 2019 09:07
Movable, hierarchical boxes with MVU architecture using Elmish (triggered by this comment thread: http://bit.ly/2O9eAnu)
module Elmish.Boxes
open System
open Fable.React.Helpers
open Fable.React.Props
open Fable.React.Standard
[<AutoOpen>]
module Domain =
@reborg
reborg / rich-already-answered-that.md
Last active October 17, 2025 18:52
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@CMCDragonkai
CMCDragonkai / semicolons.md
Created June 1, 2015 13:08
Haskell: Semicolons vs Monads

Semicolons vs Monads

The reason why Haskell sometimes calls monads "programmable semicolons", is because in imperative semicolon enabled languages, the semicolon acts as a sequencing operator that sequences side effects. It enables the passing of an effectful state space from one statement/expression to the next.

In the same way, the bind >>= and then >> operator in Haskell, allows a sequencing of effects as well, but in a more explicit manner. The effects are often typed as well, depending

@jackrusher
jackrusher / abstract.md
Last active November 3, 2025 16:13
An old programming koan.

The venerable master Qc Na was walking with his student, Anton. Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing - is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil - objects are merely a poor man's closures."

Chastised, Anton took his leave from his master and returned to his cell, intent on studying closures. He carefully read the entire "Lambda: The Ultimate..." series of papers and its cousins, and implemented a small Scheme interpreter with a closure-based object system. He learned much, and