Skip to content

Instantly share code, notes, and snippets.

💭
Mostly unresponsive these days

Daniel Peebles copumpkin

💭
Mostly unresponsive these days
Block or report user

Report or block copumpkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:93840
#include <iostream>
void f(int &imachangeu) {
imachangeu = 7;
}
int main() {
int x = 5;
std::cout << x << std::endl;
View gist:100203
// Something like this, anyway ;)
// by pumpkin
struct class_info_t {
struct class_info_t *metaclass; // maybe not exactly a class_info_t, maybe an info_table_t
struct class_info_t *superclass; // as above
void *cache;
void *vtable;
struct info_table_t *info;
}
View gist:100370
/*
kernelcache.idc, by pumpkin with contributions from roxfan
Copyright (C) 2008 pumpkin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@copumpkin
copumpkin / gist:149443
Created Jul 18, 2009
Lots of iPhone protocols. Consider this BSD-licensed. I'd also appreciate if you made changes through the gist interface so I can see what you've done, but no pressure :)
View gist:149443
# Very alpha still, but getting there...
# Yeah, I like it this way
require 'pp'
require 'set'
require 'zlib'
require 'base64'
require 'socket'
require 'openssl'
require 'stringio'
View gist:166118
{-# LANGUAGE ExistentialQuantification, TypeOperators #-}
module Fold where
import Control.Applicative
import Control.Functor.Contra
import Data.Array.Vector
import qualified Data.Foldable as Foldable
data Fold b c = forall a. Fold (a -> b -> a) a (a -> c)
View gist:166119
{-# LANGUAGE EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, TypeFamilies, MultiParamTypeClasses, ScopedTypeVariables, TypeOperators, ImplicitParams, RankNTypes, GADTs, GeneralizedNewtypeDeriving, NoImplicitPrelude, TypeSynonymInstances, TypeOperators #-}
module Main where
-- ZOMG failgebra by copumpkin (not intended to be useful, but just as a straggly experiment to see what's possible)
-- TODO: using2 could take a function mapping from common types to wrapper types and maybe reduce ugliness
import Prelude hiding (id, (+), (-), (*), (/), Integral, fromInteger, Real)
import qualified Prelude as P
import Data.Number.CReal
View gist:167980
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Enumerable where
import Data.Int
import Data.Word
import Data.Ratio
import Unsafe.Coerce
import Data.List
@copumpkin
copumpkin / Prime.agda
Last active Sep 9, 2019
There are infinite primes
View Prime.agda
module Prime where
open import Coinduction
open import Data.Empty
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Divisibility
open import Data.Fin hiding (pred; _+_; _<_; _≤_; compare)
open import Data.Fin.Props hiding (_≟_)
@copumpkin
copumpkin / Search.agda
Last active Sep 29, 2015
Simple seemingly impossible Agda
View Search.agda
module Search where
open import Coinduction
open import Function
open import Data.Empty
open import Data.Nat
open import Data.Product
open import Relation.Nullary
-- Thanks to Ed Kmett for helping me clarify what I was getting at here,
View Split.agda
module Split where
open import Data.Bool
open import Data.Nat
open import Data.Nat.Properties
open import Data.List hiding ([_])
open import Data.Product
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
You can’t perform that action at this time.