Skip to content

Instantly share code, notes, and snippets.

#! runhugs
-- Testfaelle fuer Aufgabe 6 der LVA 185.161 Funktionale Programmierung im WS09/10
-- an der Technischen Universitaet Wien
-- Aufgabenstellung: http://www.complang.tuwien.ac.at/knoop/fp185161_ws0910.html
-- Module ----------------------------------------------------------------------
module Main where
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern unsigned char *asmb(unsigned char *a);
unsigned char *asmb_ref(unsigned char *s)
{
unsigned long i;
for (i=0; s[i]; i++) {
" diese datei nach ~/.vim/syntax/ub10.vim kopieren und
" folgendes in die ~/.vimrc schmeissen:
" > syntax on
" > filetype on
" > augroup filetypedetect
" > au BufNewFile,BufRead *.0 setf ub10
" > au BufNewFile,BufRead *.1 setf ub10
" > au BufNewFile,BufRead *.2 setf ub10
" > au BufNewFile,BufRead *.3 setf ub10
" > augroup END
@lewurm
lewurm / .gitignore
Created June 8, 2011 18:25
C implementation of assignment 13.12.2010. compiler + VM.
13122010
*.o
@lewurm
lewurm / .gitignore
Created April 26, 2012 21:13
ghc: segmentation fault under strange conditions
*.hi
stackoverflow_segv
@lewurm
lewurm / .gitignore
Created May 18, 2012 10:47
ghci: "GHCi runtime linker: fatal error: I found a duplicate definition for symbol"
*.hi
*_stub.*
ffiso
@lewurm
lewurm / .gitignore
Created June 10, 2012 09:17
haskell: get address of a haskell function (at runtime)
*.hi
*_stub.h
*.o
main
@lewurm
lewurm / .gitignore
Created July 9, 2012 08:07
haskell bruteforce
brute
brute.hi
brute.o
@lewurm
lewurm / hprintf.hs
Created August 25, 2012 13:15
printf in function composition
import Text.Printf
myPutStrLn = putStrLn . (++) "log: "
-- GHC infers `myPrintf :: String -> IO ()' which is not what I want.
myPrintf = logger . printf
where
-- note, this is just an example. should be replaceable with any function
-- with this typesignature
logger :: String -> IO ()
@lewurm
lewurm / .gitignore
Created September 17, 2012 15:44
Haskell: LLVM bindings versus Harpy
*.hi
*?main