Ensure only exported values are included in results

refs #1 

I think this will work, but it doesn't compile at the moment; it uses a couple of functions which are in the master branch of purescript, but not yet in any released version.