joeyh

code reuse

joeyh at

Propellor consists of 5000 lines of code now. Fully half of that code was originally written for git-annex, a much different program.

I just finished adding a `period` combinator. Now I can specify "Docker.garbageCollected `period` Daily", which is easy enough. But I can also specify "foo `period` Divisible 2 (Monthly (Just 15))" to only check a property on the 15th of every other month. Or if I want something more readable, I can replace the data structures with a string that it can parse: foo `periodParse` "on day 15 of months divisible by 2"

I was able to build that in 15 minutes(!) because months days ago, I spent two days building a scheduling library, which the git-annex assistant uses to schedule fscks.

I have never experienced this high a level of code reuse before. Around 1/3rd of my Haskell code seems to be reusable libraries, while less than 1% of my code in other languages is.

(Now I just need to some day split all those hundreds of libraries out onto Hackage..)

Claes Wallin (韋嘉誠), Greg Grossmeier, Danc, Yutaka Niibe likes this.