Skip to content

Instantly share code, notes, and snippets.

View jml's full-sized avatar

Jonathan Lange jml

View GitHub Profile
---
- hosts:
- localhost
connection: local
gather_facts: False
vars:
ami_id: ami-29ebb519 # Ubuntu 14.04 amd64 server
region: us-west-2 # XXX: Arbitrarily chosen
http_port: 80
domain_name: haverer.jml.io
@jml
jml / playbook.yml
Created March 8, 2015 12:05
WIP ansible for Haskell build machine
---
- hosts: all
tasks:
# XXX: This is pretty manual. Would just like a thing that says 'install
# these packages from this PPA'
- name: approve cabal PPA
apt_key: keyserver=keyserver.ubuntu.com
id=063DAB2BDC0B3F9FCEBC378BFF3AEACEF6F88286
state=present
sudo: yes
{
packageOverrides = pkgs: rec {
haskellPackages = with pkgs.haskellPackages; pkgs.haskellPackages // rec {
monadLogger = callPackage ./haskell/monad-logger.nix {};
monadControl_0_3_x = callPackage ./haskell/monad-control-0.3.3.1.nix {};
transformers = callPackage ./haskell/transformers.nix {};
};
};
}
# This file was auto-generated by cabal2nix. Please do NOT edit manually!
{ cabal, aeson, classyPrelude, classyPreludeConduit
, classyPreludeYesod, conduit, dataDefault, fastLogger, fileEmbed
, hjsmin, hspec, httpConduit, monadControl, monadLogger, persistent
, persistentSqlite, persistentTemplate, resourcet, safe
, shakespeare, text, time, transformers, unorderedContainers
, vector, waiExtra, waiLogger, warp, yaml, yesod, yesodAuth
, yesodCore, yesodForm, yesodStatic, yesodTest
, yesodBin
@jml
jml / foo.hs
Created February 28, 2015 21:58
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
import Prelude hiding (FilePath)
import qualified Data.ByteString
import Data.ByteString (ByteString)
import Foreign
@jml
jml / gist:661db09e76157acf4265
Created February 28, 2015 18:48
ghc-pkg list
/Users/jml/.nix-profile/bin/../lib/ghc-7.8.4/package.conf.d/aeson-0.8.0.2.installedconf:
aeson-0.8.0.2
/Users/jml/.nix-profile/bin/../lib/ghc-7.8.4/package.conf.d/aeson-0.8.0.2.installedconf:
aeson-0.8.0.2
/Users/jml/.nix-profile/bin/../lib/ghc-7.8.4/package.conf.d/ansi-terminal-0.6.2.1.installedconf:
ansi-terminal-0.6.2.1
/Users/jml/.nix-profile/bin/../lib/ghc-7.8.4/package.conf.d/ansi-terminal-0.6.2.1.installedconf:
@jml
jml / cabal test output
Created February 28, 2015 18:34
nix-shell for system-fileio
[nix-shell:~/src/haskell-filesystem/system-fileio]$ cabal test
Preprocessing library system-fileio-0.3.16...
lib/Filesystem.hs:82:18:
Could not find module ‘Data.Text’
Perhaps you haven't installed the profiling libraries for package ‘text-1.2.0.3’?
Use -v to see a list of the files searched for.
lib/Filesystem.hs:83:18:
Could not find module ‘Data.Text.IO’
[nix-shell:~/src/haverer-api]$ cabal build -v
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
/nix/store/psk32g0fz8rz1wcchcrkwldmljh7whq6-ghc-7.8.4-wrapper/bin/ghc --numeric-version
looking for tool ghc-pkg near compiler in
/nix/store/psk32g0fz8rz1wcchcrkwldmljh7whq6-ghc-7.8.4-wrapper/bin
found ghc-pkg in
/nix/store/psk32g0fz8rz1wcchcrkwldmljh7whq6-ghc-7.8.4-wrapper/bin/ghc-pkg
/nix/store/psk32g0fz8rz1wcchcrkwldmljh7whq6-ghc-7.8.4-wrapper/bin/ghc-pkg --version
/nix/store/psk32g0fz8rz1wcchcrkwldmljh7whq6-ghc-7.8.4-wrapper/bin/ghc --supported-languages
@jml
jml / gist:a15415b26b9209d5e570
Created December 10, 2014 10:19
rust cloning & ownership

(edited conversation from #rust, featuring jml, reem, and Yurume).

I have a value type Foo, implemented as a struct with methods that return Foo such that the struct is never mutated but only new ones returned. If I want one of those to return the value unchanged, do I have to clone? e.g. http://is.gd/rm4gmY

#[deriving(Eq, PartialEq, PartialOrd, Ord, Show, Clone)]
struct Foo {
  x: int,
$ echo $PATH
~/Library/Haskell/bin:~/.cabal/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin
$ ls -l ~/Library/Haskell/bin/cabal
-rwxr-xr-x 1 jml staff 19475336 Aug 16 16:06 /Users/jml/Library/Haskell/bin/cabal
$ which cabal
/usr/bin/cabal
$