I hereby claim:
- I am LambdaP on github.
- I am lambdap (https://keybase.io/lambdap) on keybase.
- I have a public key whose fingerprint is D0E6 C2AD D440 D0C3 151A 4116 E80A AB81 AA86 0901
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
{-# LANGUAGE FlexibleContexts #-} | |
import Control.Monad.ST | |
import Data.Array.ST | |
quickSort :: (Ord a) => [a] -> [a] | |
quickSort l = runST $ | |
do | |
arr <- newListArray (0, length l - 1) l | |
bounds <- getBounds arr | |
step bounds arr |
/* | |
* Black Key sieve implementation | |
* | |
* This is a C99 implementation of the Black Key Sieve algorithm, | |
* as described by Larry Deering in [1]. It relies on the fact that all | |
* primes above 5 will be equal to {1, 7, 11, 13, 17, 19, 23, 29} modulo | |
* 30, allowing us to care only about the numbers satisfying this property, | |
* and to pack the information on 30 integers in a single byte. | |
* | |
* This code is released in the public domain. |
{-# LANGUAGE UndecidableInstances, FlexibleInstances #-} | |
import Prelude hiding (return, join, (=<<)) | |
-- A Monad can be defined either with (>>=) + return, or with | |
-- fmap + join + return | |
class Return r where | |
return :: a -> r a |
> import Prelude hiding (pred) | |
We can write the Peano integers as a Haskell type: | |
>-- data Nat = Zero | Succ { pred :: Nat } | |
And alright, in ghci, we have what we expect | |
>-- λ :t Zero | |
>-- Zero :: Nat |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
module Parse(parseFile | |
,Sys(..) | |
,Argument(..) | |
,Space(..) | |
) where | |
import Text.ParserCombinators.Parsec | |
import Data.List(intercalate) |
#include <stdio.h> | |
int main (void) | |
{ | |
const int c = 0; // NO MAGIC NUMMER GOOD PHRAKTICE | |
int *p = (int *) &c; // WAIT WAHT U DOIN | |
(*p)++; // NO STAHP | |
printf("%d\n", c); // 1 FFFFFFFFUUUUUUUUUUUUUUUUUUUUU | |
return 0; // FKUC DIS IM GOIN HOME |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#define WHILE(x) sizeof(x) | |
#define TRUE int | |
#define FALSE t | |
#define TIMES(x,y) (x+y) | |
#define PLUS(x) (x *) | |
#define EXIT(i) (i = 0) |
#include <stdio.h> | |
int f(int, int); | |
int g(int); | |
int func(int, int); | |
int f(a,b) | |
{ | |
int a, b; | |
#define ESCAPE_CHAR 242 | |
#define START_CHAR 0x7E | |
#define END_CHAR 0x0D | |
void usb_putc(uint8_t c); | |
uint8_t usb_getc(); | |
void usb_escaped_putc(uint8_t c) | |
{ | |
switch(c) { |