[Haskell-cafe] Alternative name for return

J. Stutterheim j.stutterheim at me.com
Tue Aug 6 11:01:06 CEST 2013


Hi Adam,

Thank you for an interesting thought; an invisible name might actually be on of the better solutions, although you are right in that your suggestion is a bit too open for my current project.

Actually, I believe that naming is very important. My goal is to have the "average programmer" (i.e. someone without a post-bachelor degree) look at the code and get an intuitive feel of what is going on. So in reply to Jerzy, I do want to encourage the discussion in the "Noble Domain of Philosophy" and I also want to repeat that I am not proposing to change Haskell or Haskell libraries (I am working with another language altogether), so don't fear ;)


- Jurriën

On 6 Aug 2013, at 10:46, Adam Gundry <adam.gundry at strath.ac.uk> wrote:

> Hi,
> 
> On 06/08/13 06:14, J. Stutterheim wrote:
>> Suppose we now have the opportunity to change the name of the
>> `return` function in Monad, what would be a "better"  name for it?
>> (for some definition of better)
> 
> Rather than proposing a different name, I'm going to challenge the
> premise of your question. Perhaps it would be better if `return` had no
> name at all. Consider the following:
> 
>    return f `ap` s `ap` t
> 
>    f <$> s <*> t
> 
>    do { sv <- s
>       ; tv <- t
>       ; return (f sv tv) }
> 
> These are all different ways of spelling
> 
>    f s t
> 
> plus the necessary applicative or monadic bureaucracy. But why couldn't
> we write just the plain application, and let the type system deal with
> the plumbing of effects?
> 
> I realise that this may be too open a research area for your project...
> 
> 
>> N.B. I am _not_ proposing that we actually change the name of
>> `return`. I do currently have the opportunity to pick names for
>> common functions in a non-Haskell related project, so I was wondering
>> if there perhaps is a better name for `return`.
> 
> I don't think the choice of name matters. I do think it should be short.
> Preferably invisible.
> 
> Adam

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130806/ea7dcfcd/attachment.pgp>


More information about the Haskell-Cafe mailing list