Skip to content

Instantly share code, notes, and snippets.

View thoughtpolice's full-sized avatar
👊
omae wa mou shindeiru

Austin Seipp thoughtpolice

👊
omae wa mou shindeiru
View GitHub Profile
@thoughtpolice
thoughtpolice / blake256.cry
Last active August 28, 2015 21:45
BLAKE-256 in Cryptol 2
/*
$ cryptol blake256.cry
_ _
___ _ __ _ _ _ __ | |_ ___ | |
/ __| '__| | | | '_ \| __/ _ \| |
| (__| | | |_| | |_) | || (_) | |
\___|_| \__, | .__/ \__\___/|_|
|___/|_| version 2.2.4
Loading module Cryptol
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDKN53e1R17ha560eN3TJ/uV63vgppBVOGB2bZ5H7AnvVdrV6ZnrRU0LY9VBx0bF5q2+Hst8X9xOuTKLg38XFLkSWjI0Bxt4qYbwRr8RyafI8n0UUV/sLFPEkVw2Y2jUlMxGhPUtCXZbB8V2n8Zcn/QESnUKOzZHGh2VuQ1ydra58gCK6jDot51lNh4oT0WL3F+KY7cKGv5uyDLtaGxxiPYBRZvhBLjdPAYfkTa1NOAYoN3wPfFtH4xuCP2nTSbodAgQ/UsY/aNdNkK97//GZzT5h7cA4G+//b5tNaGCN0j7RJ6wSGFCut3QvKiYlsU0sAuwyYhizuo/+IoWV2LT2W6pHRe5Ivodyzm97bkWzI+UzGKLP5VKH55Pol4iIhnavhUP5j4IIr5Xplbvp+BdVVgfaSWpRH0t4ALyn1oDZZNUkzjwFbw/EPkdndJjChziEPO31koPBFcm/IB7DvXYjPrTY9S5nlF7QbA2A3118oem4V9A4FNi9gijFJspkHPFJ2CzFoYbCg9fCwPkeS/poS6ZgBL0p4sMoqxj+2OUdS6Vg8IO143YIUmA7FcFYafhhpTWSD44lja7a8RkDcukOA2YdcuMf5f10xbW3auZ3Gjatj1Jp0hTqIT78FaEBoZJnSmJSwi/hyMWV/vix+SCw3BPwjIJ/xQUccpNwh++E/Zdw== a@link
[1 of 1] Compiling Main ( T8762.hs, T8762.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.20140130 for x86_64-apple-darwin):
dsLet: unlifted
AbsBinds [a{tv aB0} [tv]] []
{Exports: [a{v aqn} [lid] <= a{v aAW} [lid]
/\(@ a{tv aB2} [tv]). (<>) @ ghc-prim:GHC.Prim.Any{(w) tc 31N},
b{v aqo} [lid] <= b{v aAX} [lid]
(<>) @ ghc-prim:GHC.Prim.Any{(w) tc 31N}]
Exported types: a{v aqn} [lid]
[a@snake:~]$ cat test.c
int main() { return 42; }
[a@snake:~]$ clang -v test.c
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /nix/store/94l17wjg65wpkwcm4x51pr5dlvarip6a-gcc-4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2
Selected GCC installation: /nix/store/94l17wjg65wpkwcm4x51pr5dlvarip6a-gcc-4.8.2/lib/gcc/x86_64-unknown-linux-gnu/4.8.2
"/nix/store/5bw9l0mgdjnnb2gppiijx4c44i4n8d6r-clang-3.4/bin/clang-3.4" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -v -resource-dir /nix/store/5bw9l0mgdjnnb2gppiijx4c44i4n8d6r-clang-3.4/bin/../lib/clang/3.4 -internal-isystem /usr/local/include -internal-isystem /nix/store/5bw9l0mgdjnnb2gppiijx4c44i4n8d6r-clang-3.4/bin/../lib/clang/3.4/include -internal-externc-isystem /nix/store
@thoughtpolice
thoughtpolice / Vagrantfile
Last active August 29, 2015 13:57
NixOS configuration for Vagrant Boxes
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |c|
c.vm.box = "thoughtpolice/nixos-13.10"
c.vm.provider "virtualbox" do |vb|
vb.gui = false; vb.memory = 4096; vb.cpus = 2
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
@thoughtpolice
thoughtpolice / Pushover.hs
Created May 1, 2014 19:29
Pushover.net Haskell API
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
-- |
-- Module : Network.Pushover
-- Copyright : (c) Austin Seipp 2013
-- License : BSD3
--
-- Maintainer : aseipp@pobox.com
-- Stability : experimental
-- Portability : portable
@thoughtpolice
thoughtpolice / auto-parallelism.c
Created May 11, 2014 01:48
Auto-parallelism and vectorization in the Intel compiler.
#include <stdio.h>
#define ARR_SIZE 500 //Define array
int main() {
int matrix[ARR_SIZE][ARR_SIZE];
int arrA[ARR_SIZE]={10};
int arrB[ARR_SIZE]={30};
int i, j;
for(i=0;i<ARR_SIZE;i++) {
for(j=0;j<ARR_SIZE;j++) { matrix[i][j] = arrB[i]*(arrA[i]%2+10); }
} printf("%d\n",matrix[0][0]);
libraries/haskeline/System/Console/Haskeline/Backend/DumbTerm.hs:25:49:
Could not coerce from ‘StateT
Window (PosixT m) (StateT Window (PosixT m) a)’
to ‘StateT Window (PosixT m) (DumbTerm m a)’
because the third type argument of ‘StateT’ has role Nominal,
but the arguments ‘StateT Window (PosixT m) a’ and ‘DumbTerm m a’
differ
arising from the coercion of the method ‘GHC.Base.join’
from type ‘forall a.
StateT Window (PosixT m) (StateT Window (PosixT m) a)
$ time icc -march=native -ipo -std=gnu99 -O3 -parallel sign.c -o sign.icc
icc -march=native -ipo -std=gnu99 -O3 -parallel sign.c -o sign.icc 9.94s user 0.22s system 99% cpu 10.203 total
$ time gcc -march=native -flto -O3 -fuse-linker-plugin -std=gnu99 -O3 sign.c -o sign.gcc
gcc -march=native -flto -O3 -fuse-linker-plugin -std=gnu99 -O3 sign.c -o 9.51s user 0.43s system 99% cpu 9.957 total
$ time clang -march=native -O3 -std=gnu99 -O3 sign.c -o sign.clang
clang -march=native -O3 -std=gnu99 -O3 sign.c -o sign.clang 2.64s user 0.04s system 99% cpu 2.674 total
$ ./sign.icc 4096
diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs
index 1bf02e3..405bf20 100644
--- a/src/Haddock/Convert.hs
+++ b/src/Haddock/Convert.hs
@@ -94,10 +94,10 @@ tyThingToLHsDecl t = noLoc $ case t of
(synifyType ImplicitizeForAll (dataConUserType dc)))
AConLike (PatSynCon ps) ->
- let (_, _, (req_theta, prov_theta)) = patSynSig ps
+ let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps