Skip to content

Instantly share code, notes, and snippets.

View wraithm's full-sized avatar

Matthew Wraith wraithm

View GitHub Profile
;; Set ghcid-target to change the stack target
(setq ghcid-target "")
(setq ghcid-height 15)
(defun ghcid-stack-cmd (target)
(format "stack ghci %s --test --bench --ghci-options=-fno-code" target))
(setq ghcid-buf-name "*ghcid*")
(define-minor-mode ghcid-mode
import System.Random
import Control.Monad.Random
import qualified Data.Map.Lazy as Map
import Data.Map.Lazy (Map)
import Data.Maybe
import Data.Traversable as T
-- for the moment consider this a constant
max_speed = 2
@wraithm
wraithm / bifurcate.hs
Last active August 29, 2015 14:16
Bifurcate io-streams example
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad (when)
import Data.Maybe (isJust)
import Data.ByteString.Char8 as C
import System.IO.Streams as Streams
@wraithm
wraithm / groundhog-records.hs
Last active August 29, 2015 14:13
Groundhog with record
{-# LANGUAGE QuasiQuotes, DeriveGeneric, OverloadedStrings, FlexibleInstances, GADTs, TypeFamilies, RankNTypes #-}
module Main where
import Record
import Control.Lens hiding ((.=))
import Control.Monad.IO.Class (liftIO)
import Data.Aeson
import GHC.Generics
import Database.Groundhog
@wraithm
wraithm / monad.ml
Last active August 29, 2015 14:12
Monad with modular implicits
module type Functor = sig
type 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
end
let fmap (implicit F : Functor) = F.map
implicit module FunctorList = struct
type 'a t = 'a list
let map = List.map

Keybase proof

I hereby claim:

  • I am wraithm on github.
  • I am wraithm (https://keybase.io/wraithm) on keybase.
  • I have a public key whose fingerprint is D73E 3052 015F 49E5 E1B6 B204 BDFE D79A 5356 27B7

To claim this, I am signing this object: