Skip to content

Instantly share code, notes, and snippets.

@luite
luite / nqueens.js
Created October 8, 2012 01:43
n-queens 12
/*
StgRec [
( Main.listAppend,StgRhsClosure CostCentreStack StgBinderInfo [] ReEntrant SRT [ds,l2]
( StgCase
( StgApp ds []
)
UniqSet UniqSet wild SRT Alg Main.List [
( DataAlt Main.Cons,[a,l1],[True,True],StgLet
( StgNonRec sat_s1Dy
( StgRhsClosure CostCentreStack StgBinderInfo [l1,l2] Updatable SRT []
@luite
luite / nqueens12.js
Created September 24, 2012 22:09
n-queens on 12x12, crashes v8 here or gives wrong result (exception)
/*
StgRec [
( Main.listAppend,StgRhsClosure CostCentreStack StgBinderInfo [] ReEntrant SRT [ds,l2]
( StgCase
( StgApp ds []
)
UniqSet UniqSet wild SRT Alg Main.List [
( DataAlt Main.Cons,[a,l1],[True,True],StgLet
( StgNonRec sat_s1OT
( StgRhsClosure CostCentreStack StgBinderInfo [l1,l2] Updatable SRT []
@luite
luite / fib35.js
Created September 24, 2012 22:06
calculates 35th fibonacci number
/*
StgRec [
( Fibs.$wfib,StgRhsClosure CostCentreStack StgBinderInfo [] ReEntrant SRT [ww]
( StgCase
( StgApp ww []
)
UniqSet UniqSet ds SRT Prim GHC.Prim.Int# [
( DEFAULT,[],[],StgCase
( StgOpApp
( StgPrimOp IntSubOp
@luite
luite / gen2 ghcjs
Created September 24, 2012 20:33
n-queens
/*
StgRec [
( Main.listAppend,StgRhsClosure CostCentreStack StgBinderInfo [] ReEntrant SRT [ds,l2]
( StgCase
( StgApp ds []
)
UniqSet UniqSet wild SRT Alg Main.List [
( DataAlt Main.Cons,[a,l1],[True,True],StgLet
( StgNonRec sat_s1Pj
( StgRhsClosure CostCentreStack StgBinderInfo [l1,l2] Updatable SRT []
@luite
luite / InstallJs.hs
Created May 8, 2012 16:46
Build javascript files for installed packages
#!/usr/bin/env runhaskell
module Main where
import System.Process
import System.Environment
import Distribution.Simple.GHC
import Distribution.Verbosity
import Data.List (nub, isPrefixOf)
import Distribution.Simple.PackageIndex
import Distribution.InstalledPackageInfo
@luite
luite / Root.hs
Created January 31, 2012 15:17
Hanging POST request
module Handler.Root where
import Import
-- This is a handler function for the GET request method on the RootR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majority of the code you will write in Yesod lives in these handler
-- functions. You can spread them across multiple files if you are so