Skip to content

Instantly share code, notes, and snippets.

View dbrattli's full-sized avatar
👨‍💻
Python ❤️ F#

Dag Brattli dbrattli

👨‍💻
Python ❤️ F#
View GitHub Profile
@dbrattli
dbrattli / IOAction.hs
Created October 16, 2019 17:12 — forked from chris-taylor/IOAction.hs
Code for my blog post about pure I/O
data IOAction a = Return a
| Put String (IOAction a)
| Get (String -> IOAction a)
get = Get Return
put s = Put s (Return ())
seqio :: IOAction a -> (a -> IOAction b) -> IOAction b
seqio (Return a) f = f a
seqio (Put s io) f = Put s (seqio io f)
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */