Clean up type declarations, use fst and <$>.