Skip to content

Instantly share code, notes, and snippets.

@ktvoelker
ktvoelker / Bar.hs
Last active August 29, 2015 14:23
Example cabal package with incomplete other-modules section
module Bar where
@ktvoelker
ktvoelker / 0.steps
Last active August 29, 2015 14:13
Notes on building fltkhs on OSX 10.10.1 using GHC 7.10.0.20141222
Steps taken while installing fltkhs on OSX 10.10.1:
1. "brew update" and "brew install fltk" (version: 1.3.3)
2. "git clone" (got rev 0466b69f5b3a144c6fc07f43259a20e8d3f90199)
3. "cabal sandbox init" (using GHC 7.10.0.20141222 and Cabal-1.22)
4. First build attempt: failed because c2hs wasn't available (see 1.err)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
module FS where
type Date = String
data FileKind = FILE | FOLDER
data Entry (k :: FileKind) where
{-# LANGUAGE TypeFamilies #-}
module Set where
class Set a where
type E a
empty :: a
insert :: E a -> a -> a
member :: E a -> a -> Bool
data Tree a = Empty | MkTree (Tree a) a (Tree a)
@ktvoelker
ktvoelker / README
Last active August 29, 2015 14:05
Vim bug
Run in the shell: vim -u NONE
Run in vim:
:edit one
:edit three
:source bug.vim
:3
:source bug.vim
@ktvoelker
ktvoelker / keybase.md
Created March 12, 2014 03:19
Keybase proof

Keybase proof

I hereby claim:

  • I am ktvoelker on github.
  • I am ktvoelker (https://keybase.io/ktvoelker) on keybase.
  • I have a public key whose fingerprint is 6D78 435F D99B A3C4 9B74 536A 8B50 7EDB 876F CAB6

To claim this, I am signing this object:

@ktvoelker
ktvoelker / gist:945452
Created April 27, 2011 23:19
Some record types
data Foo = Foo { a :: Int, b :: Int }
data Bar = Bar { x :: Foo, y :: Foo }
@ktvoelker
ktvoelker / gist:945370
Created April 27, 2011 22:23
Getting started with state-record
git clone git://github.com/ktvoelker/state-record.git
cd state-record
cabal install
data IdField a b = IdField { getField :: a -> b, putField :: b -> a -> a }
@ktvoelker
ktvoelker / gist:945324
Created April 27, 2011 22:00
A record declaration with state-record
record "" [d| data Foo = Foo { x :: Int, y :: Int } |]