Skip to content

Instantly share code, notes, and snippets.

View thoferon's full-sized avatar

Tom Feron thoferon

View GitHub Profile
@thoferon
thoferon / .emacs
Last active December 22, 2015 20:59
Emacs configuration
;; Packages required :
;; jujube-theme
;; haskell-mode
;; ghc
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
(package-initialize)
@thoferon
thoferon / Pickle.hs
Created August 30, 2013 21:28
So, your PM is talking about Cucumber... Just an idea
import Control.Monad
import Control.Monad.Identity
import Control.Monad.Trans
import Control.Monad.Writer.Lazy
data Step
= Action String
| Assertion Bool String
deriving (Show, Eq)
@thoferon
thoferon / dependent-types-confidence.hs
Last active December 20, 2015 09:30
Quick test with dependent types in Haskell
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
data Confidence = High | Medium | Low deriving (Show, Eq)
data Dataset :: Confidence -> * -> * where
Dataset :: [a] -> Dataset c a
@thoferon
thoferon / monad.rb
Last active December 11, 2015 13:09
Simple example to understand monads for Rubyists. See http://en.wikipedia.org/wiki/Monad_(functional_programming)#Formal_definition.
class Monad
attr_reader :value
def bind(f)
raise "not implemented"
end
def self.return(v)
self.new v
end
@thoferon
thoferon / .gitconfig
Created November 29, 2012 13:19
Configuration files
[alias]
st = status
br = branch
co = checkout
ci = commit
[user]
name = Thomas Feron
email = /email/
[color]
branch = auto
(defproject name-with-dashes "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]]
:main name-with-dashes.core)