Skip to content

Instantly share code, notes, and snippets.

@bspaans
bspaans / gist:0b6dbb4adfe93692447f
Last active October 21, 2016 19:53
Marathon service discovery: writing HAProxy and hosts file
#!/usr/bin/env python
import urllib2
import json
import random
import subprocess
slave_ip = "10.0.10.1"
marathons = ["10.0.10.1", "10.0.10.2"]
domain = ".example.com"
-- | A simply typed lambda calculus with type reconstruction
-- extended with integers and let bindings.
-- Using the new Evaluator monad to do the variable generation
-- for us.
-- No alpha reduction.
--
module Lambda where
import Evaluator4
-- | A general purpose evaluator; useful for evaluating
-- languages/structures that need to:
-- * Access an environment
-- * Log messages or signal errors
-- * Generate free variables
--
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
module Evaluator where
import Control.Applicative
-- | A simply typed lambda calculus with type reconstruction.
-- extended with integers and let bindings.
-- No alpha reduction.
--
module Lambda where
import Evaluator
import Control.Monad.Writer
import Control.Monad.Reader
module Lambda where
import Evaluator
import Control.Monad.Writer
import Control.Monad.Reader
import qualified Data.Map as M
-- | A simply typed lambda calculus,
-- extended with integers and let bindings.
-- No alpha reduction.
-- | Untyped lambda calculus
--
import qualified Data.List as L
import Data.Char
import ParseLib.Abstract
import System.Console.Editline.Readline
-- * Lexer