Skip to content

Instantly share code, notes, and snippets.

View konn's full-sized avatar
🏠
Working from home

Hiromi Ishii konn

🏠
Working from home
View GitHub Profile
ZFC.idr:60:7:Incomplete term $ {a = (c ** (b : A) -> (underscore ** ({__pi_arg46} : member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} b c) -> (underscore ** (\ z : A => (b ** (underscore ** member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} z b))) b)))} {b = A} (getWitness {a = A} {P = \ c : A => (b : A) -> (underscore ** ({__pi_arg46} : member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} b c) -> (underscore ** (\ z : A => (b ** (underscore ** member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} z b))) b))}) (Separation {univ = A} {{c}} ($ {a = (c ** (z : A) -> ({__pi_arg44} : (b ** (underscore ** member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} z b))) -> member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} z c)} {b = A} (getWitness {a = A} {P = \ c : A => (z : A) -> ({__pi_arg44} : (b ** (underscore ** member {univ = A} {{@@instanceZFC.ZF#Set univ {univ = A} {{c}}}} z b))) -> member {univ = A} {{@@instanceZFC.ZF#Set univ {univ
@konn
konn / cookie-clicker-clicker.js
Created September 20, 2013 16:53
Cookie Clicker Clicker: Cookie Clicker をひたすらリモートでクリックするためのもの。要・Phantom JS、Casper JS。
{-# LANGUAGE EmptyDataDecls, GADTs, TypeOperators #-}
module Rules where
import Prelude hiding (pred)
data Term a where
Var :: String -> Term a
App :: Term (a -> b) -> Term a -> Term b
instance Show (Term a) where
showsPrec _ (Var s) = showString s
@konn
konn / Monadish.hs
Last active December 20, 2015 23:09
trying to re-implement [mmorph](http://hackage.haskell.org/package/mmorph) library using PolyKinds, which fails due to Constraints.
{-# LANGUAGE ConstraintKinds, DataKinds, FlexibleContexts, FlexibleInstances #-}
{-# LANGUAGE GADTs, MultiParamTypeClasses, PolyKinds, RankNTypes #-}
{-# LANGUAGE TypeFamilies, TypeOperators, UndecidableInstances #-}
module Monadish where
import Control.Monad.Trans
import Control.Monad.Trans.Maybe
class Category cat where
identity :: cat a a
(@@) :: cat b c -> cat a b -> cat a c
module DummyMonad where
data DM a = DM
instance Functor DM where
fmap _ DM = DM
instance Monad DM where
return _ = DM
DM >>= _ = DM
@konn
konn / dragon.hs
Created April 25, 2013 15:06
Twindragon
{-# LANGUAGE FlexibleContexts, MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction, TupleSections #-}
module Main where
import Data.Complex
import Data.List
import Diagrams.Animation
import Diagrams.Backend.Cairo.CmdLine
import Diagrams.Prelude
main :: IO ()
@konn
konn / Proof.hs
Last active December 15, 2015 04:58
Equational reasoning in Haskell (w/ or w/o singleton types)
plusCommutative :: SNat n -> SNat m -> Eql (n :+: m) (m :+: n)
plusCommutative SZ SZ = Eql
plusCommutative SZ (SS m) =
case plusZR (SS m) of
Eql -> Eql
plusCommutative (SS n) m =
case plusCommutative n m of
Eql -> case sAndPlusOne (m %+ n) of
Eql -> case plusAssociative m n sOne of
Eql -> case sAndPlusOne n of
cabal update && cabal install ghc-mod && cd ~/Library/Haskell/ghc-7.4.1/lib/ghc-mod-1.12.3/share/ && make EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs && cp *.el *.elc ~/.emacs.d/elisp/
@konn
konn / koch.hs
Last active December 12, 2015 04:08
diagrams-demos
{-# LANGUAGE NoMonomorphismRestriction #-}
module Main where
import Diagrams.Backend.Cairo.CmdLine
import Diagrams.Prelude
import Diagrams.TwoD
main :: IO ()
main = defaultMain $ pad 1.1 $ frame $
koch 4 # triangulate # lw 1 # lc black
module CellularAutomaton where
import Control.Arrow
import Control.DeepSeq
import Data.Char
import Data.Maybe
import Numeric
data OneDAutomaton s = ODA { left :: [s]
, right :: [s]
}