Skip to content

Instantly share code, notes, and snippets.

View cartazio's full-sized avatar

Carter Tazio Schonwald cartazio

View GitHub Profile
anonymous
anonymous / gist:1194308
Created September 5, 2011 07:27
Smarter do notation desugaring
module Main where
import qualified Data.Set as S
type Var = String
-- For the purposes of the desugaring the only important thing
-- about the nested terms are the free variables
data HsTerm = HsTerm { dsHsTerm' :: String, hsTermFVs' :: [Var] }
anonymous
anonymous / gist:1253064
Created September 30, 2011 08:16
GHC alias analysis
// Originally based on PyAliasAnalysis from the unladen-swallow project!
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/Argument.h"
#include "llvm/Constants.h"
@deepakjois
deepakjois / README.md
Created January 26, 2012 17:30 — forked from cartazio/gist:1655271
Installing GHC 7.2.2 and diagrams on OS X Lion

Installing GHC 7.2.2 and diagrams on OS X Lion

Install prerequisites

GHC 7.2.2 64-bit

Make sure you have the 64-bit version of GHC. If you installed GHC using brew install haskell-platform, you are using the 32-bit version which wont work with the instructions below. To install the 64-bit version

  • Follow instructions in this [gist][ghcinstallgist]. However, note that the patch for cabal-install that they point to is not available anymore. There is a similar patch in [this gist][cabalinstallgist], which worked for me. Read [this comment][cabalinstallcomment] for more info on how to apply the patch.
anonymous
anonymous / Hdfs.hs
Created March 19, 2012 17:19
A Haskell API wrapping libhdfs
module System.Hdfs where
import Data.ByteString (ByteString)
import qualified Data.ByteString as B
import Data.Int
import Data.Vector (Vector)
import Data.Word
import Foreign.Ptr
type Size = Int32
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@ekmett
ekmett / Remote.hs
Created August 4, 2012 16:46
remote dsl
{-# LANGUAGE GADTs, Rank2Types, KindSignatures, ScopedTypeVariables, TypeOperators, DataKinds, PolyKinds, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, DoRec, ExtendedDefaultRules #-}
import Control.Applicative
import Control.Category
import Control.Comonad
import Control.Monad.Fix
import Control.Monad (ap)
import Data.Functor.Identity
import Data.Typeable
import Data.Monoid
import Data.Unique
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@23Skidoo
23Skidoo / CYK.hs
Created September 29, 2012 04:16
The CYK algorithm in Haskell
module CYK
where
import Control.Monad
import Data.Array.IArray
import Data.Array.MArray
import Data.Array.ST
import Data.Maybe
import qualified Data.Map as M
@rustle
rustle / gist:4115414
Created November 20, 2012 01:45
Source Tree with Kaleidoscope 2 beta

SourceTree does not yet officially support Kaleidoscope 2, so here is how to set it up:

In Preferences, under Diff:

Screen Shot

You can try selecting Kaleidoscope, but we have had reports of mixed results. Some people have rebuilt their launch services database and restarted and been able to use Kaleidoscope this way:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain use

source :rubygems
gem "rack"