This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- BEGIN PRELUDE -------------------------------------------------------------- | |
------------------------------------------------------------------------------- | |
{-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} | |
{-# LANGUAGE FlexibleInstances, UndecidableInstances #-} | |
{-# LANGUAGE OverlappingInstances #-} | |
undefined = undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance Monad IO where | |
{-# INLINE return #-} | |
{-# INLINE (>>) #-} | |
{-# INLINE (>>=) #-} | |
m >> k = m >>= \ _ -> k | |
return = returnIO | |
(>>=) = bindIO | |
fail s = failIO s | |
returnIO :: a -> IO a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: sh hackagedocs.sh mypackage 0.1 UserName Password | |
cabal configure && cabal build && cabal haddock --hyperlink-source \ | |
--html-location='http://hackage.haskell.org/package/$pkg/docs' \ | |
--contents-location='http://hackage.haskell.org/package/$pkg' | |
S=$? | |
if [ "${S}" -eq "0" ]; then | |
cd "dist/doc/html" | |
DDIR="${1}-${2}-docs" | |
cp -r "${1}" "${DDIR}" && tar -c -v -z --format ustar -f "${DDIR}.tar.gz" "${DDIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Eval (eval) where | |
import Syntax | |
import Control.Monad.State | |
import qualified Data.Map as Map | |
data Value | |
= VInt Int | |
| VUnit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Diehl | |
Asymptotics | |
frontend | |
AST | |
desugar | |
primops | |
unboxed | |
desugaring | |
Lexer | |
REPL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_class_template = '''\ | |
class {typename}(tuple): | |
'{typename}({arg_list})' | |
__slots__ = () | |
_fields = {field_names!r} | |
def __new__(_cls, {arg_list}): | |
'Create new instance of {typename}({arg_list})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------- | |
// MurmurHash3 was written by Austin Appleby, and is placed in the public | |
// domain. The author hereby disclaims copyright to this source code. | |
// Note - The x86 and x64 versions do _not_ produce the same results, as the | |
// algorithms are optimized for their respective platforms. You can still | |
// compile and run any of them on any platform, but your performance with the | |
// non-native version will be less than optimal. | |
#include "MurmurHash3.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Eval ( | |
eval | |
) where | |
import Syntax | |
import Data.Functor ((<$>)) | |
isNum :: Expr -> Bool | |
isNum Zero = True | |
isNum (Succ x) = isNum x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SVN Gource | |
# Download http://gource.googlecode.com/files/svn-gource-1.2.tar.gz and place svn-source.py in directory | |
# 1 Day = 0.05 seconds | |
COMPRESSION=0.05 | |
svn log --verbose --xml > my-project.log | |
python svn-gource.py --filter-dirs my-project.log > data_unsorted.log | |
sort -t'|' -k1 data_unsorted.log > data_sorted.log | |
gource --log-format custom data_sorted.log -s $(COMPRESSION) --disable-progress --stop-at-end --output-ppm-stream - | ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -vpre libx264-default gource.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stephen Diehl ( sdiehl@clarku.edu ) | |
# Build up an OWL ontology recursively from the Python given Python objects inheritance tree. | |
from xml.dom import minidom | |
def generate(icls): | |
xml = minidom.Document() | |
rdf = xml.createElement('rdf:RDF') | |
rdf.setAttribute('xmlns:owl','http://www.w3.org/2002/07/owl#') |
OlderNewer