Skip to content

Instantly share code, notes, and snippets.

View tjweir's full-sized avatar

Tyler Weir tjweir

View GitHub Profile
@ptessier
ptessier / roles.md
Last active July 13, 2020 00:37
Acquisition Incorporated
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE GADTs #-}
{-# OPTIONS_GHC -Wall #-}
module Main where
@marcosh
marcosh / Application.hs
Created June 14, 2018 13:20
Web applications as profunctors
module Application where
import Data.Profunctor
newtype Application request response = Application {unApplication :: request -> IO response}
instance Profunctor Application where
dimap actOnRequest actOnResponse application = Application $ (fmap actOnResponse) . (unApplication application) . actOnRequest
@dawei-dev
dawei-dev / bulkindex.hs
Last active June 28, 2018 12:59
servant client for Elasticsearch bulk index API
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeOperators #-}
import Data.Aeson
import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.Proxy
@dwhitney
dwhitney / README.md
Last active May 17, 2024 09:25
Quick React Native with PureScript
  1. create-react-native-app purescript-app; cd purescript-app

  2. pulp init --force

  3. pulp build

  4. src/Main.js

var React = require("react");
var RN = require("react-native");

exports.text = function(props){
@mrkgnao
mrkgnao / IosevkaConfigGen.hs
Last active February 25, 2025 07:23
Render Iosevka ligatures to Private Use Area glyphs, for Emacs
{-# LANGUAGE RecordWildCards, Arrows #-}
import Numeric
import Data.Char
import Control.Monad
import Data.Monoid ((<>))
import Data.List (nub, sort, reverse)
data RepeatBounds = RB
@naoto-ogawa
naoto-ogawa / servant_fileupload_sample.hs
Created March 14, 2017 12:03
servant file upload sample
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
import Control.Monad.IO.Class -- liftIO
{-# language KindSignatures #-}
{-# language PolyKinds #-}
{-# language DataKinds #-}
{-# language TypeFamilies #-}
{-# language RankNTypes #-}
{-# language NoImplicitPrelude #-}
{-# language FlexibleContexts #-}
{-# language MultiParamTypeClasses #-}
{-# language GADTs #-}
{-# language ConstraintKinds #-}

I'm putting this list together as a sort of reading plan for myself in order to learn more about general cluster scheduling/utilization and various ways of generically programming to them. Lists of direct links to PDFs here in the order I think makes some sense from skimming reference sections.

Happy to here of any additions that might be sensible.

The Basics

  1. Google File System since everything references it and data locality is a thing.
  2. Google MapReduce because it's one of the earlier well-known functional approaches to programming against a cluster.
  3. Dryad for a more general (iterative?) programming model.
  4. Quincy for a different take on scheduling.
  5. [Delay Scheduling](h
@cqfd
cqfd / echoz.scala
Created February 3, 2015 15:11
scalaz-stream echo server
import java.net.InetSocketAddress
import scala.concurrent.Task
import scalaz.stream._
object Main {
def main(args: Array[String]): Unit = {
val address = new InetSocketAddress(45678)
implicit val cg = nio.DefaultAsynchronousChannelGroup
val s: Process[Task, Process[Task, Unit]] = nio.server(address).map { client =>
client.flatMap { ex =>