partial rewrite of reader in applicative style