Skip to content

Instantly share code, notes, and snippets.

View berewt's full-sized avatar

Nicolas B. berewt

View GitHub Profile
{-# language RankNTypes #-}
{-# language GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
module Data.Optics where
@gelisam
gelisam / Main.hs
Last active January 9, 2018 23:16
Distributing a computation using Cloud Haskell
-- in response to https://twitter.com/jfischoff/status/948768178070470656
{-# LANGUAGE TemplateHaskell #-}
module Main where
import Control.Concurrent (threadDelay)
import Control.Monad.IO.Class (liftIO)
import Data.Traversable (for)
import Text.Printf (printf)
import Control.Distributed.Process (Process, NodeId, spawn)
import Control.Distributed.Process (SendPort, newChan, sendChan, receiveChan)
@tonymorris
tonymorris / PureIO.java
Last active December 18, 2017 02:30
Pure-functional terminal I/O in java
import java.util.function.Function;
import java.util.function.BiFunction;
import java.util.Scanner;
abstract class TerminalOperation<A> {
// this ensures that there are no subclasses of TerminalOperation
// outside of this class
private TerminalOperation() {
}
@miikka
miikka / Simple.hs
Created August 24, 2010 19:07
Simple Haskell Twitter OAuth example
{-# LANGUAGE PackageImports #-}
{-
You need to register your Twitter application at <http://dev.twitter.com/>
to get the consumer key and secret needed for OAuth. When connecting to
Twitter for the first time, do this:
let consumer = Consumer "consumer key" "consumer secret"
token <- authenticate