
Hello all, I like some of the naming conventions in haskell quite a lot, like calling a list of something "xs", or function which takes a function as a parameter "..By" as in sortBy or groupBy. If I have a function, say "compute" whose last parameter is some value ... and I create another function, which applies "compute" to a list of values, how would I call this function? I was tempted to use "all", but my original function already returns a list, so this would be misleading. Also note that the mapped version, does some additional things (remove duplicates), otherwise a new function would hardly be justified. -- Martin

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jun 6, 2010, at 14:22 , Martin Drautzburg wrote:
If I have a function, say "compute" whose last parameter is some value ... and I create another function, which applies "compute" to a list of values, how would I call this function?
The few cases of this in the standard Haskell libraries suggest "mapCompute". - -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) iEYEARECAAYFAkwNSsIACgkQIn7hlCsL25XxQACfaUr8Jt31qDTGkvCeNhfs1L+q ir4AninhHrsxscmnsUl8cchh0DKRMN1m =dnbt -----END PGP SIGNATURE-----

On Jun 6, 2010, at 11:22 AM, Martin Drautzburg wrote:
If I have a function, say "compute" whose last parameter is some value ... and I create another function, which applies "compute" to a list of values, how would I call this function?
computeF is my natural inclination. F is for Functor.

If the function is changing the size of the list (e.g. by removing duplicates) a name implying 'mapping' might be misleading. Maybe something like /process/ or /normalize/

Martin Drautzburg
If I have a function, say "compute" whose last parameter is some value ... and I create another function, which applies "compute" to a list of values, how would I call this function?
If I understand you correctly, and it's not simply "map . compute" (which I'd leave just like that), I would name the function that works on the full data set (i.e. list) 'compute' and a sub-function working on a single element 'compute1'. -k -- If I haven't seen further, it is by standing in the footprints of giants
participants (5)
-
Alexander Solla
-
Brandon S. Allbery KF8NH
-
Ketil Malde
-
Martin Drautzburg
-
Stephen Tetley