brew install golang
# For info on building go programs, see: https://golang.org/doc/code.html#GOPATH
mkdir build-hound
cd build-hound
mkdir src bin
export GOPATH=$PWD
export PATH=$GOPATH/bin
mkdir -p src/github.com/etsy
{-# LANGUAGE OverloadedStrings #-} | |
-- build-depends: tar, bytestring, zlib | |
-- Example of how to iterate through a .tar.gz file | |
module Lib | |
where | |
import qualified Codec.Archive.Tar as Tar |
# Script to install threadscope. | |
# | |
# Also see: | |
# - http://www.edsko.net/2015/03/09/sandboxes-revisited/ | |
# - http://stackoverflow.com/a/33105802/866915 | |
cabal sandbox init | |
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig | |
brew install gtk+ | |
brew install poppler |
#!/bin/bash | |
# | |
# Found at: https://github.com/andrewthad/lens-prelude/blob/master/scripts/hackage-docs.sh | |
set -e | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: scripts/hackage-docs.sh HACKAGE_USER" | |
exit 1 | |
fi |
brew install golang
# For info on building go programs, see: https://golang.org/doc/code.html#GOPATH
mkdir build-hound
cd build-hound
mkdir src bin
export GOPATH=$PWD
export PATH=$GOPATH/bin
mkdir -p src/github.com/etsy
brew install gettext
git clone git://git.zx2c4.com/cgit
cd cgit
git submodule init
git submodule update
Then modify the definitions of CFLAGS and LDFLAGS in git/Makefile
:
import Pipes | |
import Pipes.Files | |
import Pipes.Safe | |
import Data.Monoid | |
import Data.Time.Clock | |
import System.Posix.Files.ByteString ( fileSize ) | |
example = do | |
let megs = 1024 * 1024 | |
days = 86400 |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
-- build-depends: base >= 4.7 && < 5, xml-conduit, text, conduit, transformers, resourcet, html-conduit, conduit-extra | |
module Lib | |
where | |
import qualified Text.XML.Stream.Parse as P | |
import qualified Text.XML.Stream.Render as R | |
import qualified Data.Conduit.List as CL |
import System.Environment | |
import System.Timeout (timeout) | |
import Control.Concurrent | |
import Control.Concurrent (forkIO, threadDelay, killThread) | |
import Control.Concurrent.MVar (newEmptyMVar, putMVar, takeMVar) | |
import System.Process | |
import System.IO | |
-- blocking IO |
A gist collecting examples of how to use `Data.List.Ordered` | |
> import Data.List.Ordered | |
Sieve of Eratosthenes | |
=== | |
From the Haskellwiki entry on the [Sieve of Eratosthenes][HaskellWikiSieve]: |
Using Parsec to score a bowling game. | |
=== | |
In this gist we'll see how to use Parsec to solve the problem of | |
scoring a bowling game. This was inspired by a | |
Reddit Daily Programmer problem: | |
https://www.reddit.com/r/dailyprogrammer/comments/3ntsni/20151007_challenge_235_intermediate_scoring_a/ |