This file contains hidden or 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
interface Eq require | |
{type T; eq} | |
interface Eq provide | |
type T : Type | |
eq : (T, T) -> Bool | |
module EqInt : Eq where | |
type T = Int | |
eq = builtIn_eqInt |
This file contains hidden or 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
/* Say you want to read some stuff into a buffer. | |
* To do so in C, a (very) naive programmer would write something like: */ | |
void *read_buf_from_file(char *path) { | |
void *buf = malloc(512); | |
int fd = open(path, O_RDONLY); | |
read(fd, buf, 512); | |
return buf; | |
} |
This file contains hidden or 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
/* The Hammer code for read_buf_from_file would look like this: */ | |
void *read_buf_from_file(char *path) { | |
int ret = -1; | |
void *buf = malloc(512) <- | |
lambda(buf) { | |
if (ret < 0) free(buf); | |
}; | |
int fd = open(path, O_RDONLY) <- | |
lambda(fd) { |
This file contains hidden or 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
main : IO () | |
open : IO Handle | |
write : Handle -> String -> IO () | |
close : Handle -> IO () | |
main = do | |
fd <- open "log.txt" | |
write fd "Hello World!" | |
close fd |
This file contains hidden or 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
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010 | |
debug1: Reading configuration data /etc/ssh/ssh_config | |
debug1: Applying options for * | |
debug1: Connecting to localhost [::1] port 22. | |
debug1: Connection established. | |
debug1: identity file /home/test/.ssh/identity type -1 | |
debug1: identity file /home/test/.ssh/id_rsa type 1 | |
debug1: identity file /home/test/.ssh/id_dsa type -1 | |
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3 | |
debug1: match: OpenSSH_5.3 pat OpenSSH* |
This file contains hidden or 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
{-# LANGUAGE | |
OverloadedStrings, | |
FlexibleInstances #-} | |
module Main where | |
import Prelude | |
import System.IO |
This file contains hidden or 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
==8944== Memcheck, a memory error detector | |
==8944== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. | |
==8944== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info | |
==8944== Command: ./Generator | |
==8944== | |
; ModuleID = 'myModule' | |
==8944== Invalid write of size 8 | |
==8944== at 0xB3BB8C: ??? (in /home/karl/Haskell/Hammer/Generator) | |
==8944== Address 0x64ed560 is not stack'd, malloc'd or (recently) free'd | |
==8944== |
This file contains hidden or 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
#include <stdbool.h> | |
#include <stdio.h> | |
#include <llvm-c/Core.h> | |
#include <llvm-c/ExecutionEngine.h> | |
int main(int argc, char **argv) { | |
LLVMLinkInJIT(); | |
if (LLVMInitializeNativeTarget()) { | |
fprintf(stderr, "Failed to initialize native target.\n"); |
This file contains hidden or 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
import Data.Array | |
import Data.Graph | |
import Data.IORef | |
import System.Random | |
import Control.Monad | |
main = do | |
graphRef <- newIORef . | |
array (1, 1000) $ zip [1 .. 1000] (repeat []) | |
let f = do |
This file contains hidden or 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
execve("/usr/local/bin/perl", ["perl", "--version"], [/* 55 vars */]) = 0 | |
brk(0) = 0x132c000 | |
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c0e678000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/perl5/core_perl/CORE/tls/x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/usr/lib/perl5/core_perl/CORE/tls/x86_64", 0x7fff3d538980) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/perl5/core_perl/CORE/tls/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/usr/lib/perl5/core_perl/CORE/tls", 0x7fff3d538980) = -1 ENOENT (No such file or directory) | |
open("/usr/lib/perl5/core_perl/CORE/x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/usr/lib/perl5/core_perl/CORE/x86_64", 0x7fff3d538980) = -1 ENOENT (No such file or directory) |
OlderNewer