Re: Proposal: Chainable do sugar

2019-01-18 Thread Isiah Meadows
I feel JS should first have a concept of what a monad (or functor) is
before it adds sugar for it. This just feels too early.
On Fri, Jan 18, 2019 at 07:48 Paul Gray  wrote:

> I believe generators only work for certain monads, as explained here:
> https://stackoverflow.com/a/32192145
>
> On Fri, Jan 18, 2019, 7:42 AM Paul Gray  wrote:
>
>>
>> I would say "Monad" is a very precise term with lawful implications.I
>> left it out since there is no requirement for the value to actually be a
>> monad (Only that it has a chain and map method, hence 'chainable').
>>
>> Not sure if it's worth being that precise, though.
>>
>>
>> "flatMap" is also another option, instead of "chain" (especially since
>> arrays now have flatMap)
>>
>>
>>
>> On Fri, Jan 18, 2019, 5:52 AM David Teller  wrote:
>>
>>> Fwiw, generators can already be used as syntactic sugar for monads.
>>>
>>> Cheers,
>>>  David
>>>
>>> THIS MESSAGE AND ITS IP ADDRESS HAVE BEEN LOGGED. PLEASE DO NOT MOVE
>>> FROM YOUR COMPUTER. YOU WILL SHORTLY RECEIVE A VISIT FROM THE IMPERATIVE
>>> BRIGADE.
>>>
>>> On 18/01/2019 06:32, Michael Luder-Rosefield wrote:
>>> > It's OK, you can say the m-word here. Monad. See? Nothing bad wi--
>>> >
>>> > -TRANSMISSION LOST
>>> >
>>> ___
>>> es-discuss mailing list
>>> es-discuss@mozilla.org
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Chainable do sugar

2019-01-18 Thread Paul Gray
I believe generators only work for certain monads, as explained here:
https://stackoverflow.com/a/32192145

On Fri, Jan 18, 2019, 7:42 AM Paul Gray  wrote:

>
> I would say "Monad" is a very precise term with lawful implications.I left
> it out since there is no requirement for the value to actually be a monad
> (Only that it has a chain and map method, hence 'chainable').
>
> Not sure if it's worth being that precise, though.
>
>
> "flatMap" is also another option, instead of "chain" (especially since
> arrays now have flatMap)
>
>
>
> On Fri, Jan 18, 2019, 5:52 AM David Teller  wrote:
>
>> Fwiw, generators can already be used as syntactic sugar for monads.
>>
>> Cheers,
>>  David
>>
>> THIS MESSAGE AND ITS IP ADDRESS HAVE BEEN LOGGED. PLEASE DO NOT MOVE
>> FROM YOUR COMPUTER. YOU WILL SHORTLY RECEIVE A VISIT FROM THE IMPERATIVE
>> BRIGADE.
>>
>> On 18/01/2019 06:32, Michael Luder-Rosefield wrote:
>> > It's OK, you can say the m-word here. Monad. See? Nothing bad wi--
>> >
>> > -TRANSMISSION LOST
>> >
>> ___
>> es-discuss mailing list
>> es-discuss@mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Chainable do sugar

2019-01-18 Thread Paul Gray
I would say "Monad" is a very precise term with lawful implications.I left
it out since there is no requirement for the value to actually be a monad
(Only that it has a chain and map method, hence 'chainable').

Not sure if it's worth being that precise, though.


"flatMap" is also another option, instead of "chain" (especially since
arrays now have flatMap)


On Fri, Jan 18, 2019, 5:52 AM David Teller  wrote:

> Fwiw, generators can already be used as syntactic sugar for monads.
>
> Cheers,
>  David
>
> THIS MESSAGE AND ITS IP ADDRESS HAVE BEEN LOGGED. PLEASE DO NOT MOVE
> FROM YOUR COMPUTER. YOU WILL SHORTLY RECEIVE A VISIT FROM THE IMPERATIVE
> BRIGADE.
>
> On 18/01/2019 06:32, Michael Luder-Rosefield wrote:
> > It's OK, you can say the m-word here. Monad. See? Nothing bad wi--
> >
> > -TRANSMISSION LOST
> >
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Chainable do sugar

2019-01-18 Thread David Teller
Fwiw, generators can already be used as syntactic sugar for monads.

Cheers,
 David

THIS MESSAGE AND ITS IP ADDRESS HAVE BEEN LOGGED. PLEASE DO NOT MOVE
FROM YOUR COMPUTER. YOU WILL SHORTLY RECEIVE A VISIT FROM THE IMPERATIVE
BRIGADE.

On 18/01/2019 06:32, Michael Luder-Rosefield wrote:
> It's OK, you can say the m-word here. Monad. See? Nothing bad wi--
> 
> -TRANSMISSION LOST
> 
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Proposal: Chainable do sugar

2019-01-17 Thread Michael Luder-Rosefield
It's OK, you can say the m-word here. Monad. See? Nothing bad wi--

-TRANSMISSION LOST

On Fri, 18 Jan 2019 at 11:03 Paul Gray  wrote:

> Hello friends!
>
> I’d love to discuss the potential for syntax sugar around a popular fp
> pattern, *chainables*!
>
> I’ve written up a document here
>  with the
> details.
>
> I’ve also written a small Babel plugin that implements this. Here’s a
> codesandbox  with it loaded up.
>
> Thanks for your time!
>
> - Paul Gray
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Proposal: Chainable do sugar

2019-01-17 Thread Paul Gray
Hello friends!

I’d love to discuss the potential for syntax sugar around a popular fp
pattern, *chainables*!

I’ve written up a document here
 with the
details.

I’ve also written a small Babel plugin that implements this. Here’s a
codesandbox  with it loaded up.

Thanks for your time!

- Paul Gray
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss