Skip to content

Instantly share code, notes, and snippets.

View cartazio's full-sized avatar

Carter Tazio Schonwald cartazio

View GitHub Profile
@cartazio
cartazio / README.md
Created June 19, 2012 20:50 — forked from deepakjois/README.md
Installing GHC and diagrams on OS X Lion

Installing GHC 7.4.2 (and/or current haskell platform) and diagrams on OS X Lion

Install prerequisites

GHC 7.4.2 64-bit (or other recent 64bit version)

use haskell platform install via haskell platform site or mac homebrew. Both should by default provide (currently) ghc 7.4.2 64bit.

Install dependencies (ordered by dependencies)

@cartazio
cartazio / gist:3364775
Created August 15, 2012 23:43
epic thing
Epic/CodegenC.lhs:100:6:
Could not deduce (Num a0) arising from the ambiguity check for `cg'
from the context (Num a, MonadState Int m)
bound by the inferred type for `cg':
(Num a, MonadState Int m) => ByteOp -> m [Char]
at Epic/CodegenC.lhs:(100,6)-(215,64)
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
@cartazio
cartazio / source thingy.hs
Created August 16, 2012 00:44
possible 7.6rc1 bug?
cabal configure ; cabal build 1 ↵
Resolving dependencies...
Configuring idris-0.9.3...
rm -f closure.o libidris_rts.a
Building idris-0.9.3...
Preprocessing executable 'idris' for idris-0.9.3...
[ 1 of 41] Compiling Util.Pretty ( src/Util/Pretty.hs, dist/build/idris/idris-tmp/Util/Pretty.o )
[ 2 of 41] Compiling Core.TT ( src/Core/TT.hs, dist/build/idris/idris-tmp/Core/TT.o )
src/Core/TT.hs:624:5:
@cartazio
cartazio / gist:3365312
Created August 16, 2012 01:22
more idris ghc 7.6 weird errors
[20 of 41] Compiling Idris.AbsSyntaxTree ( src/Idris/AbsSyntaxTree.hs, dist/build/idris/idris-tmp/Idris/AbsSyntaxTree.o )
src/Idris/AbsSyntaxTree.hs:622:5:
Could not deduce (Ord a0)
arising from the ambiguity check for `prettyArgS'
from the context (Num a, Ord a)
bound by the inferred type for `prettyArgS':
(Num a, Ord a) => PArg -> Doc
at src/Idris/AbsSyntaxTree.hs:(622,5)-(793,105)
The type variable `a0' is ambiguous
@cartazio
cartazio / gist:3405712
Created August 20, 2012 16:47
idris install error
carter ~ » cabal install idris
Resolving dependencies...
[1 of 1] Compiling Main ( /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/idris-0.9.2.1-1497/idris-0.9.2.1/Setup.hs, /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/idris-0.9.2.1-1497/idris-0.9.2.1/dist/setup/Main.o )
Linking /var/folders/py/wgp_hj9d2rl3cx48yym_ynj00000gn/T/idris-0.9.2.1-1497/idris-0.9.2.1/dist/setup/setup ...
Configuring idris-0.9.2.1...
Building idris-0.9.2.1...
Preprocessing executable 'idris' for idris-0.9.2.1...
[ 1 of 32] Compiling Util.Pretty ( src/Util/Pretty.hs, dist/build/idris/idris-tmp/Util/Pretty.o )
[ 2 of 32] Compiling Core.TT ( src/Core/TT.hs, dist/build/idris/idris-tmp/Core/TT.o )
@cartazio
cartazio / gist:3445419
Created August 24, 2012 04:30
type lit example problem 1
{-# LANGUAGE DataKinds #-} -- to declare the kinds
{-# LANGUAGE KindSignatures #-} -- (used all over)
{-# LANGUAGE TypeFamilies #-} -- for declaring operators + sing family
{-# LANGUAGE TypeOperators #-} -- for declaring operator
{-# LANGUAGE EmptyDataDecls #-} -- for declaring the kinds
{-# LANGUAGE GADTs #-} -- for examining type nats
{-# LANGUAGE PolyKinds #-} -- for Sing family
{-# LANGUAGE UndecidableInstances #-} -- for a bunch of the instances
{-# LANGUAGE FlexibleInstances #-} -- for kind parameters
{-# LANGUAGE FlexibleContexts #-} -- for kind parameters
@cartazio
cartazio / gist:3445456
Created August 24, 2012 04:35
more type lit woe
{-# LANGUAGE DataKinds #-} -- to declare the kinds
{-# LANGUAGE KindSignatures #-} -- (used all over)
{-# LANGUAGE TypeFamilies #-} -- for declaring operators + sing family
{-# LANGUAGE TypeOperators #-} -- for declaring operator
{-# LANGUAGE EmptyDataDecls #-} -- for declaring the kinds
{-# LANGUAGE GADTs #-} -- for examining type nats
{-# LANGUAGE PolyKinds #-} -- for Sing family
{-# LANGUAGE UndecidableInstances #-} -- for a bunch of the instances
{-# LANGUAGE FlexibleInstances #-} -- for kind parameters
{-# LANGUAGE FlexibleContexts #-} -- for kind parameters
@cartazio
cartazio / golf.hs
Created September 23, 2012 19:56
golf
-- assumes hmatrix installed
module Main where
import Numeric.LinearAlgebra
import Graphics.Plot
x:: Vector Double
x = linspace 2000 (-10.0,10.0)
randomSeed= 7331 --because its funny, also because i don't want to break in some io for a simple example
rnorm :: Int -> Double -> Double -> Vector Double
rnorm size mean sd = flatten $ (gaussianSample randomSeed size $ constant mean 1 ) $ fromLists [[sd]]
@cartazio
cartazio / gist:4508127
Created January 11, 2013 05:14
want to read about the silliness of the memcached protocol, saved it here to read!
from https://raw.github.com/memcached/memcached/master/doc/protocol.txt
(look at http://code.google.com/p/memcached/wiki/BinaryProtocolRevamped
and
http://www.slideshare.net/tmaesaka/memcached-binary-protocol-in-a-nutshell-presentation/
for the binary version)
Protocol
--------
Clients of memcached communicate with server through TCP connections.
@cartazio
cartazio / gist:4568629
Created January 18, 2013 21:19
my attempt to describe modern telecom using simple english http://splasho.nfshost.com/upgoer5/
Why can people go to space? It is because we can throw more heavy things to the world than the world pulls back at us. We call this a space car. Space cars look like long boxes. We use space cars to throw thinking rocks around the world. The thinking rocks help people talk. The people talk using small boxes that share pictures and sound using the thinking rocks moving around the world.