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
~/ghc/ghc-osx64-unreg $ make bootstrapping-files
make -r --no-print-directory -f ghc.mk bootstrapping-files
find: libraries/ghc-prim/dist-install/build: No such file or directory
find: libraries/ghc-prim/dist-install/build: No such file or directory
find: libraries/integer-gmp/dist-install/build: No such file or directory
find: libraries/integer-gmp/dist-install/build: No such file or directory
find: libraries/integer/dist-install/build: No such file or directory
find: libraries/integer/dist-install/build: No such file or directory
find: libraries/base/dist-install/build: No such file or directory
find: libraries/base/dist-install/build: No such file or directory
mkdir utils/ghc-cabal/dist
mkdir utils/ghc-cabal/dist/build
mkdir utils/ghc-cabal/dist/build/tmp
"/Users/austinseipp/bin/ghc" -H32m -O -H32m --make utils/ghc-cabal/ghc-cabal.hs -o utils/ghc-cabal/dist/build/tmp/ghc-cabal \
-Wall \
-DCABAL_VERSION=1,7,2 \
-odir bootstrapping \
-hidir bootstrapping \
-ilibraries/Cabal \
-ilibraries/filepath \
~/src/C-ObjC-Blocks $ cat t.c
#include <stdio.h>
#include "blocks_runtime.h"
int main() {
int x[5] = { 0, 1, 2, 3, 4 };
for(int i=0; i<5; i++) {
void (^f)(int) = ^(int y) { printf("v: %d\n", i+y); };
~/code/AwesomePrelude/src $ cat test.hs
import AwesomePrelude
import HaskellPrelude
import JsPrelude
import qualified Prelude as P
test :: P.Bool
test = not false && false || true
test2 :: Js JsBool
import Prelude hiding (and)
import Criterion.Main(defaultMain, bench, B(..))
import Data.Word
import LLVM.Core
import LLVM.Util.Optimize
import LLVM.ExecutionEngine
import Test.QuickCheck
#include <iostream>
#include <assert.h>
#include <sys/vfs.h>
#include <boost/asio.hpp>
#include <boost/asio/posix/random_access_descriptor.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/system/error_code.hpp>
#include <boost/bind.hpp>
@thoughtpolice
thoughtpolice / DerivativesViaDualNumbers.hs
Created December 10, 2010 06:27
Computing derivatives of functions using dual numbers
{-# LANGUAGE ViewPatterns #-}
module DerivativesViaDualNumbers where
{--
Dual numbers are an extension of the real numbers, like Complex
numbers, only with the identity that d^2 = 0. They are represented
similarly to complex numbers as well, i.e. a+b*d where 'a' and 'b' are
real numbers.
@thoughtpolice
thoughtpolice / gist:750279
Created December 21, 2010 17:49
Lightweight dependent types + a proof of a 'mirror' function
{-# LANGUAGE TypeFamilies, RankNTypes, FlexibleContexts, ScopedTypeVariables #-}
{-
based heavily on Ryan Ingram's lightweight type-level dependent programming
in haskell, posted to haskell-cafe:
http://www.haskell.org/pipermail/haskell-cafe/2009-June/062690.html
I would suggest reading it before continuing further
-}
/**//*/};)/**/main(/*//**/tang ,gnat/**//*/,ABBA~,0-0(avnz;)0-0,tang,raeN
,ABBA(niam&&)))2-]--tang-[kri - =raeN(&&0<)/*clerk*/,noon,raeN){(!tang&&
noon!=-1&&(gnat&2)&&((raeN&&( getchar(noon+0)))||(1-raeN&&(trgpune(noon
)))))||tang&&znva(/*//**/tang ,tang,tang/**|**//*/((||)))0(enupgrt=raeN
(&&tang!(||)))0(rahcteg=raeN( &&1==tang((&&1-^)gnat=raeN(;;;)tang,gnat
,ABBA,0(avnz;)gnat:46+]552&)191+gnat([kri?0>]652%)191+gnat([kri=gnat
(&&)1-^gnat(&&)1& ABBA(!;)raeN,tang,gnat,ABBA(avnz&&0>ABBA{)raeN
,/**/);}znva(/*//**/tang,gnat,ABBA/**//*/(niam;}1-,78-,611-,321
-,321-,001-,64-,43-,801-,001-,301-,321-,511-,53-,54,44,34,24
@thoughtpolice
thoughtpolice / refl.hs
Created March 15, 2011 02:02
strange segfault with ghc7/windows
import Data.Reflection
test1 :: Int
test1 =
let x = 2
in reify x reflect
main = print test1