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
https://mail.haskell.org/pipermail/haskell-cafe/2011-August/094533.html | |
Ivan Tomac ivan.tomac at gmail.com | |
Wed Aug 10 13:26:20 CEST 2011 | |
--------------------------------------------------------------------- | |
I've recently been playing with Sebastian Fischer's explicit sharing | |
monad library (found at http://sebfisch.github.com/explicit-sharing) | |
and after looking at the code noticed the implementation memoizes |
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
import Foundation | |
public protocol JSONEncodable { | |
var json: [String : AnyObject] { get } | |
var Name: String { get } | |
} | |
public protocol JSONDecodable { | |
init?(json: [String : AnyObject]) | |
} |
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
#include <stdio.h> | |
typedef struct { | |
char her; | |
long double hear[16]; | |
int hero; | |
float yo[17]; | |
} A; | |
#pragma pack(1) |
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
protocol Convertible { | |
func to<T>() -> T; | |
// var <T>to: T { get } // multiple instances of generic var is not allowed | |
} | |
extension String { | |
func to() -> String { | |
return self | |
} |
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
// clang -std=c99 -O3 cpy-vs-cat.c | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <mach/mach_time.h> | |
const int e6 = 1000000; | |
#define repeat for(int j = 0; j < e6; j++) | |
void flush() { fflush(stdout); } |
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
struct Completion<A> { | |
let f: (A -> Void) | |
init(f: A -> Void) { | |
self.f = f | |
} | |
func run(a: A) { | |
f(a) | |
} | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
syntax:glob | |
main | |
*.o | |
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
#import <stdio.h> | |
#import <highgui.h> | |
#import <cv.h> | |
IplImage *renderFaces(IplImage *, CvSeq *, double); | |
int main(int argc, char** argv) | |
{ | |
double scale = 5; // primary speed factor |