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 ExplicitForAll, RankNTypes #-} | |
> import Control.Monad.Cont | |
An Eilenberg-Moore algebra for a monad t (a t-algebra) is one of these: | |
> type Algebra t x = t x -> x | |
satisfying these laws (page 3): |
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
// | |
// On MacOSX compile with: | |
// g++ -framework OpenGL -framework GLUT -o example example.cpp | |
// | |
#include <stdlib.h> | |
#include <GLUT/glut.h> | |
GLuint program; |
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 <stdio.h> | |
// | |
// Nearly minimal CUDA example. | |
// Compile with: | |
// | |
// nvcc -o example example.cu | |
// | |
#define N 1000 |
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 <stdio.h> | |
#define N 1000 | |
__global__ | |
void add(int *a, int *b) { | |
int i = blockIdx.x; | |
if (i<N) { | |
b[i] = 2*a[i]; | |
} |
NewerOlder