First draft haskell implementation, mostly stubs, with some blanks.