[Haskell-cafe] Ported a Python script for use with Go to Haskell

Robert Vollmert rvollmert-lists at gmx.net
Sat Apr 5 10:21:14 UTC 2014


On Apr 5, 2014, at 8:32 , Matt Joiner <anacrolix at 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



More information about the Haskell-Cafe mailing list