Skip to content

Instantly share code, notes, and snippets.

function assertThrows(triggeringFn, testFn) {
var sawError = false;
try {
triggeringFn();
} catch (Exception e) {
sawError = true;
assert(testFn(e), "Exception did not pass test!");
}
assert(sawError, "Error was not thrown!");
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title>Writing Shell Scripts in Haskell</title>
<style type="text/css">
code{white-space: pre-wrap;}
2018-08-04 18:09:14 ☆ glamdring in ~/Projects/moot
± |detached:origin/HEAD {1} S:1 U:1 ✗| → stack build
Cloning 08c9b4cdf977d5bcd1baba046a007940c1940758 from https://github.com/bitemyapp/esqueleto.git
Cloning into '/Users/joel/Projects/moot/.stack-work/downloaded/LFPGB_S1ZA4V'...
remote: Counting objects: 3137, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 3137 (delta 7), reused 24 (delta 5), pack-reused 3105
Receiving objects: 100% (3137/3137), 1.21 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1350/1350), done.
Cloning 6bf765e000c6fd14e09ebdea6c4c5b1510ff5376 from https://github.com/yesodweb/wai.git
make migration
STACK_YAML="stack.yaml" stack build moot
Getting project config file from STACK_YAML environment
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.9.1. unix requires: >=1.2 && <1.9
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.9.1. directory requires: >=1.4 && <1.9
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.9.1. Cabal requires: >=1.4 && <1.9
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.9.1. http-api-data requires: >=1.4.2 && <1.9
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.9.1. aeson-compat requires: >=1.4.0.1 && <1.9
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.9.1. esqueleto requires: >=1.5.0.1 && <=1.8.0.2
moot-0.0.0: unregistering (components added: exe:fixtures, exe:migration, exe:moot, exe:truncate)
/Users/joel/.stack/programs/x86_64-osx/ghc-7.10.3/lib/ghc-7.10.3/include/rts/storage/ClosureMacros.h:505:5:
warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK
^
/Users/joel/.stack/programs/x86_64-osx/ghc-7.10.3/lib/ghc-7.10.3/include/rts/storage/ClosureMacros.h:502:37:
note: expanded from macro 'ZERO_SLOP_FOR_LDV_PROF'
#define ZERO_SLOP_FOR_LDV_PROF (defined(PROFILING))
^
it "property for the definition of ($)" $ do
let
test :: Fun Int Int -> Int -> Bool
test fn x =
((apply fn) x) == ((apply fn) $ x)
property test
@joelmccracken
joelmccracken / junk.hs
Created April 26, 2017 00:36
random haskell snippets, mostly putzing with turtle, gpg, tar, etc
_tar <- tar
stdout _tar
putStrLn $ (show r)
stdout $ inproc "gpg" ["--passphrase-fd", Data.Text.pack (show r), "--symmetric", "--batch", "--output", "encrypted.gpg"] _tar
proc "gpg" ["--passphrase", "helloworld", "--symmetric", "--batch", "--output", "encrypted.gpg"] _tar
x <- tar
y <- x
case y of
ExitSuccess -> return ()
Server Error
A server error has occurred. Send the following information to Cloudera.
Path: http://cloudera-1.blatbrun.com:7180/cmf/add-hosts-wizard/wizard
Version: Cloudera Express 5.10.0 (#85 built by jenkins on 20170120-1038 git: aa0b5cd5eceaefe2f971c13ab657020d96bb842a)
java.lang.NullPointerException:
at IOUtils.java line 1792
<Response><Say voice="alice">Your so-nice code is 555326</Say><Play>http://demo.twilio.com/docs/classic.mp3</Play></Response>