Skip to content

Instantly share code, notes, and snippets.

View m-renaud's full-sized avatar

Matt Renaud m-renaud

  • Google Inc.
  • San Francisco, CA
View GitHub Profile
these derivations will be built:
/nix/store/lxk22wmjmwf2xadrw7pm37k80m9lcnql-project1-1.0.0.drv
building path(s) ‘/nix/store/81gy6a8m1iin193507qyr580i2mj6n77-project1-1.0.0’
setupCompilerEnvironmentPhase
Build with /nix/store/qijwxnz9s8gas6pc6n5qfv976w523xyb-ghc-8.0.2.
unpacking sources
unpacking source archive /nix/store/cp5d14hvbpkhhv6r0yw6a1520nyr326v-project1
source root is project1
patching sources
compileBuildDriverPhase
# control-left control-right nav
set-window-option -g xterm-keys on
setw -g mode-keys emacs
bind-key q confirm-before kill-session
bind-key Q confirm-before kill-server
# remap prefix from 'C-b' to 'C-o'
unbind C-b
set-option -g prefix C-o
data Entry = Entry
{ entryState :: EntryState
, entryPayload :: Maybe Payload
}
data EntryState = NO_ENTRY | IN_PROGRESS | HAS_ENTRY
data Cache = ...
lookup :: Cache -> Key -> Entry
@m-renaud
m-renaud / ElegantFizzBuzz.hs
Last active December 11, 2017 04:21
Elegant fizzbuzz implementation based on Monoids. Inspired by http://www.parsonsmatt.org/2016/02/27/an_elegant_fizzbuzz.html.
module Main where
import Data.Foldable (fold)
import Data.Maybe (fromMaybe, listToMaybe)
fizzBuzz :: Functor f => f Int -> f String
fizzBuzz =
fmap (fromMaybe <$> show <*> fold rules)
where
rules = [fizz, buzz]
@m-renaud
m-renaud / Lib.hs
Last active November 21, 2018 07:05
Default project template for `cabal init`
-- File: src/Lib.hs
module Lib (greeting) where
greeting :: String
greeting = "Hello, world!"
@m-renaud
m-renaud / pretty-haskell-operators.el
Last active November 28, 2018 07:54
Pretty Haskell operators
;; Prefix variable name with mrenaud/ in case haskell-mode adds
;; a 'haskell-prettify-alist in a future release.
(defvar mrenaud/haskell-prettify-alist
'(("\\" . ?λ)
("->>" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s
(Bl . Bl) ?- (Bc . Br) ?- (Bc . Bc) ?>
(Bc . Bl) ?- (Br . Br) ?>))
(">>=" . (?\s (Br . Bl) ?\s (Br . Bl) ?\s