[Haskell-cafe] naming convention for maybes?

Henning Thielemann lemming at henning-thielemann.de
Fri Apr 22 19:57:47 CEST 2011


On Fri, 22 Apr 2011, Evgeny Tarasov wrote:

> I do it in a similar way, not just for maybes:
>
> paramMay <- getHTTPPostParam "Param"
> paramStr <- maybe (throwError "No Param parameter") return paramMay
> let paramE = parseParam paramStr
> param <- case paramE of
> Left e -> throwError $ "Error while parsing Param: " ++ show e
> Right p -> return p
>
> It'd be great, if there was a "centralised" naming convention guide.

Of course, naming will always be a matter of taste. For instance I would 
not write maybe_something, because I prefer camel case, that is, 
maybeSomething. On the other hand, I already wrote some Wiki articles that 
you may read as suggestions for certain naming conventions:
   http://www.haskell.org/haskellwiki/Qualified_names
   http://www.haskell.org/haskellwiki/Pairs_of_identifiers
  and other articles in Category:Style. You may add an article for 
suggestions of how to name lists, maybes, eithers etc.



More information about the Haskell-Cafe mailing list