Skip to content

Instantly share code, notes, and snippets.

View cartazio's full-sized avatar

Carter Tazio Schonwald cartazio

View GitHub Profile
@cartazio
cartazio / gist:4589712
Created January 21, 2013 21:40
trick for having a CI tool do the quick ghc build
- echo "BuildFlavour = quick\n" > bquick
- cat bquick mk/build.mk.sample > mk/build.mk
@cartazio
cartazio / gist:4632572
Created January 25, 2013 07:43
ghc make test resulst on mb air
OVERALL SUMMARY for test run started at Fri Jan 25 01:58:38 EST 2013
3402 total tests, which gave rise to
16608 test cases, of which
10 caused framework failures
13530 were skipped
2971 expected passes
50 had missing libraries
35 expected failures
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TemplateHaskell #-}
@cartazio
cartazio / gist:4979663
Created February 18, 2013 18:51
template haskell staged foldl
foldl'th f a ls = foldl' fth ath ls $! id
where
fth = \resAFun b comp ->
[|$(resAFun $! \aval -> [| case f aval b of v -> $(comp b) |]) |]
ath = \ comp -> [| case a of v -> $(comp v) |]
@cartazio
cartazio / gist:4979871
Created February 18, 2013 19:22
second go at th
foldrth op [] = [| id |]
foldrth op (l:ls) = [| \a -> case ($op a $l) of v-> $( foldrth op ls) v |]
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TupleSections #-}
module Data.Counting.HyperLogLog.Adjusted where
import Language.Haskell.TH
heres some tools using haskell on embedded systems:
harduino http://leventerkok.github.com/hArduino/
atom http://hackage.haskell.org/package/atom/
and
copilot http://hackage.haskell.org/package/copilot
@cartazio
cartazio / DFT.hs
Created March 21, 2013 20:35
a toy DFT module using Data.
{-# LANGUAGE BangPatterns #-}
module DFT where
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as MV
import Data.Complex
import Control.Monad.Identity
--import
@cartazio
cartazio / gist:5282666
Created April 1, 2013 00:53
casMutVar vs AtomicModifyMutVar
/// cmm code for CAS primop
stg_casMutVarzh ( gcptr mv, gcptr old, gcptr new )
/* MutVar# s a -> a -> a -> State# s -> (# State#, Int#, a #) */
{
gcptr h;
(h) = ccall cas(mv + SIZEOF_StgHeader + OFFSET_StgMutVar_var,
old, new);
if (h != old) {
return (1,h);
@cartazio
cartazio / gist:5324626
Created April 6, 2013 03:30
rounded hacking
carter active/rounded ‹master*› » cabal build 1 ↵
--> Building MPFR 3.1.0...
Command "make" failed with exit code: 2
Making all in doc
make[1]: Nothing to be done for `all'.
Making all in src
make all-am
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_LOCALE_H=1 -DHAVE_WCHAR_H=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_STDINT_H=1 -DHAVE_VA_COPY=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LONG_LONG=1 -DHAVE_INTMAX_T=1 -DMPFR_HAVE_INTMAX_MAX=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_DENORMS=1 -DHAVE_ROUND=1 -DHAVE_TRUNC=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_NEARBYINT=1 -DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DMPFR_USE_THREAD_SAFE=1 -DLT_OBJDIR=\".libs/\" -DHAVE_ATTRIBUTE_MODE=1 -DHAVE___GMPN_ROOTREM=1 -DHAVE___GMPN_SBPI1_DIVAPPR_Q=1 -I. -Wall -Wmissing-prototypes -Wpointer-arith -O2 -pedantic -fomit-frame-pointer -m64 -mtune=corei7 -march=corei7 -MT exceptions.lo -MD -MP -MF .deps/ex