News for hackers. Stuff that matters.
Re:A simple image hosting site written in Haskell by Peaker on Monday October 10, 2011 @01:08AM (#3092347)
myfromJust has a too specific type, and really should just be inlined as:

  fromMaybe ""
checkInputFile encodes a no-result as a "no" string. This is a very un-Haskelly thing to do (Use a Maybe String, instead).

Use of C's if syntax is a bit weird, too. No need for these extra parens.

getRandomName weirdly uses getStdGen/newStdGen instead of just making a random generator directly.

basename is (incorrectly) duplicating standard library behavior.

saveFile uses fromJust, will crash at runtime.

There are no comments on this comment yet.