make it typecheck
Fixed optimistic problems.
Remove unneeded provides.
Typed version of writer.
Merge pull request #1 from samth/master

Add types.