Thanks very much. I'll look into fmap and <$>.
On Apr 5, 2014, at 8:32 , Matt Joiner <anacrolix@gmail.com> wrote:
> It's been 3 years since my last attempt to use Haskell. I've ported a script from Python, I wonder if anyone might point out areas that I'm not doing things idiomatically for Haskell? I'm hoping to start using Haskell more in place of Go and Python.
Hardly an expert here, but a couple of remarks:
- try using ‘span’ (Prelude) for splitting the argument list
- clobbering the environment by prepending to an association list makes me wonder if that’s really what happens when the variable is already defined
- 'fmap rstrip (readProcess …)’ or ‘rstrip <$> readProcess …’ instead of ‘readProcess … >>= return . rstrip’
It does look like Haskell to my eyes.
Cheers
Rob