I hereby claim:
- I am danielwaterworth on github.
- I am danielwaterworth (https://keybase.io/danielwaterworth) on keybase.
- I have a public key ASCSTZzPUhcQseR2L3kgkcaSb92oI9kRjIEXk49_P52Owwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
+ git diff-tree --no-commit-id --name-only -r prefabrication | |
+ git checkout master | |
+ bundle exec rspec spec/components/admin_confirmation_spec.rb | |
Randomized with seed 36167 | |
... | |
Finished in 0.67291 seconds (files took 2.66 seconds to load) | |
3 examples, 0 failures |
module main | |
data FormatString : List Char -> Type -> Type where | |
Empty : FormatString [] String | |
InsertNumber : FormatString s t -> FormatString ('%' :: 'd' :: s) (Int -> t) | |
InsertString : FormatString s t -> FormatString ('%' :: 's' :: s) (String -> t) | |
Other : (x /= '%' = True) -> FormatString s t -> FormatString (x :: s) t | |
printf' : List Char -> FormatString format ty -> ty | |
printf' s Empty = pack (reverse s) |
import sys, os | |
trace = False#True | |
debug = False#True | |
step = False#True | |
class Data(object): | |
pass | |
class Type(Data): |
How much of your codebase is only understood by one person?
Have you seen this question before? If you're a programmer then you're likely to have. It's a question that is strongly related the concept of a bus factor; the minimum number of people that understand any part of a system. This question annoys me though, because by asking it you are assuming that the system in question is so complicated and ill documented that at least parts of it can only be understood by the people that created it or those who that knowledge was shared with.
Why is this the norm? Why is it that we accept complexity? Edsger Dijkstra famously said "Simplicity is prerequisite for reliability" and I don't anyone who would disagree. When we accept complexity by not striving for simplicity, we accept unreliability and bugs.
{-# LANGUAGE FlexibleInstances, DeriveDataTypeable #-} | |
import Data.Char | |
import Data.Typeable | |
import Control.Monad | |
import Control.Exception | |
import Control.Monad.Trans | |
import System.IO |
{-# LANGUAGE GADTs #-} | |
module StateMachine where | |
-- A library for managing complexity of state machines by making them composable, feel free to contribute/steal | |
data StateMachine state where | |
Simple :: (state -> state -> Bool) -> StateMachine state | |
OrMachine :: StateMachine a -> StateMachine b -> (a -> b -> Bool) -> (b -> a -> Bool) -> StateMachine (Either a b) | |
AndMachine :: StateMachine a -> StateMachine b -> StateMachine (a, b) |
{-# LANGUAGE ExistentialQuantification #-} | |
{- | |
The idea is that each variable is an IORef that is either in a stable state | |
or is being transformed. If it is being transformed then the IORef contains a | |
MidChange value. The first argument of the constructor is the state before | |
the modification, the second argument is the state afterwards and the third | |
argument is an IORef that says whether the transaction has completed. | |
-} |