On Aug 31, 2007, at 16:01 , Sterling Clover wrote:

In particular for a function -- n, m, etc or x, y, etc? What about for f' defined in a let block of f? If I use x y at the top level I need to use another set below -- is that where x' y' are more appropriate, or x1, y1?

Usual style is x',y'.

For longer names, camelCase is the usual convention but some libraries which basically import everything from C via the FFI use C_style_names. Imported constants/macros which are uppercase with _ tend to be mapped to tHIS_KIND_OF_NAME (see for example the Win32 package).

One thing to watch out for is that monads tend to carry their own metaconventions: a generic monad is "m", a reader monad is "r", a state monad is "s", functors are "f".

For tuples I tend to pattern match with (a,b), and for lists I tend to use (h:r) for head and rest. Are there

The common convention for lists is e.g. (x:xs) (the latter is "x-es").

other, more universal standards for these sorts of things? Another related question is whether using these short sweet variable names makes sense, or whether I should try to use more descriptive ones.

I generally use something short but descriptive when writing something specific, and single-character generic names when writing something that's generic and/or polymorphic.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to