Skip to content

Instantly share code, notes, and snippets.

@mietek
mietek / clang-xcode5-wrapper.hs
Created July 2, 2014 22:50
clang wrapper for GHC 7.6.3 and OS X 10.9
import System.Environment
import System.Process
import Data.List (isInfixOf)
-- | This script wraps clang to pass it essential arguments that keep it from dying when
-- GHC uses it as a C pre-processor during the build process.
-- To use it, choose the version of clang you'd like to use,
-- (GHC-iOS needs to use Xcode5's clang, which is already set here)
-- then compile it (ghc clang-xcode5-wrapper.hs).
-- Then, find your GHC settings file (usually something like /usr/local/lib/ghc-7.6.3/settings)
@mietek
mietek / Makefile
Last active April 16, 2016 15:51
Example Makefile for a Haskell project
all: test
ci: depclean test doc
PKG_DESCRIPTION = example.cabal
DEP = .cabal-sandbox
CONFIGURE = dist/setup-config
ifndef PREFIX
PREFIX = /usr/local
@mietek
mietek / ghci-fail-one.txt
Created July 7, 2014 10:09
GHCi Fail One
$ ghci -v dist/build/ghci-fail-one/ghci-fail-one-tmp/cbits/glue.o
GHCi, version 7.8.2: http://www.haskell.org/ghc/ :? for help
Glasgow Haskell Compiler, Version 7.8.2, stage 2 booted by GHC version 7.6.3
Using binary package database: /opt/ghc-7.8.2/lib/ghc-7.8.2/package.conf.d/package.cache
wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-948744e1f99cc8bcc7c7d3ba60c7c2d8
wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-dc47f6b546fc171f67a7f7d311684a99
wired-in package base mapped to base-4.7.0.0-a333addb6892f3cc2e6baa5ec782bd04
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.9.0.0-ed6ecfb467e6936688bb20f968f702e1
wired-in package dph-seq not found.
@mietek
mietek / ghci-1.txt
Last active August 29, 2015 14:03
GHCi 7.6.3 ignoring Foo.o
$ cat >Foo.hs <<EOF
module Foo where
foo :: IO ()
foo = print "Foo"
EOF
$ ghc -Wall -c -o Foo.o Foo.hs
$ cat >Foo.hs <<EOF
@mietek
mietek / ghci-1.txt
Created July 7, 2014 14:34
GHCi 7.8.2 crashing with Foo.o
$ cat >Foo.hs <<EOF
module Foo where
foo :: IO ()
foo = print "Foo"
EOF
$ ghc -Wall -c -o Foo.o Foo.hs
$ rm Foo.hs
@mietek
mietek / lazy.py
Created August 18, 2014 10:42
Laziness in Python 2.x
#!/usr/bin/env python
def force(thunk):
return thunk()
class delay:
def __init__(self, func):
self.func = func
def remember():
result = self.func()
@mietek
mietek / woes.purs
Created August 18, 2014 22:35
Indentation woes
> let author =
{ name: "P"
, interests: []
}
(line 2, column 5):
unexpected "n"
expecting expression
> let author =
{ name: "P"
@mietek
mietek / npm-spewage.txt
Last active August 29, 2015 14:05
`npm install [email protected]` spewage
$ npm cache clean && npm install [email protected]
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/private/tmp/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/private/tmp/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/private/tmp/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules' }
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/private/tmp/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wra
@mietek
mietek / npm-spewage.txt
Created August 26, 2014 19:33
`npm install [email protected]` spewage
$ npm cache clean && npm install [email protected]
npm ERR! Error: ENOENT, lstat '/private/tmp/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/fs-extra/lib/move.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "[email protected]"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.31
@mietek
mietek / npm-debug-spewage.txt
Created August 26, 2014 19:37
`npm install [email protected]` debug spewage
This file has been truncated, but you can view the full file.
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', '[email protected]' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose cache add [ '[email protected]', null ]
6 verbose cache add spec="[email protected]" args=["[email protected]",null]
7 verbose parsed spec { raw: '[email protected]',
7 verbose parsed spec scope: null,
7 verbose parsed spec name: 'imagemin',