started implementing wadler/hughes document algebra