Hacker News new | past | comments | ask | show | jobs | submit login

The nice thing with Haskell is that it can be extremely compact. The problem with Haskell is that it can be extremely compact.



map (format "The %s thing with Haskell is that it can be extremely compact") ["nice thing", "problem"]

(disclaimer: that probably isn't actual Haskell syntax.)


    mapM_ (printf "The %s thing with Haskell is that it can be extremely compact\n")
          ["nice thing", "problem"]
This works. :)

Alternatively, you could do this:

    forM_ ["nice thing", "problem"] $
          printf "The %s thing with Haskell is that it can be extremely compact\n"


map (("The "++).(++" with Haskell is that it can be extremely compact")) ["nice thing", "problem"]




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: