These are chat archives for ramda/ramda

3rd
May 2017
Vadim Nekrasov
@barbiturat
May 03 2017 10:38
Hello!
The "Maybe" object is mentoined few times in the ramda documentation. But there is absolutely no information about it. Methods like "Maybe.Just" and "Maybe.Nothing" are used in the ramda's docs. Where could I find a documentation about "Maybe" object? May be it is a part of some specification?
@barbiturat
Vadim Nekrasov
@barbiturat
May 03 2017 10:41
It is not a spec. It is just a book
Tushar Mathur
@tusharmath
May 03 2017 10:42
are you comfortable with Functors ?
Vadim Nekrasov
@barbiturat
May 03 2017 10:42
I'm just starting to learn fp
Tushar Mathur
@tusharmath
May 03 2017 10:42
Then I think u should go thru that link
it will give a good understanding of what they are and how they are used in ramda
Vadim Nekrasov
@barbiturat
May 03 2017 10:46
Yes, I'm going to read that book. Bot now I'm just asking about some common SPECIFICATION of widely mentoined objects (like "Maybe"). Just to know what methods I can expect to see in that objects (to know API). "Mostly adequate guide" is just a book, but not the specification. Later we can find some another book with some other set of methods of Maybe.
Brian McKenna
@puffnfresh
May 03 2017 10:47
data Maybe a = Just a | Nothing
Vadim Nekrasov
@barbiturat
May 03 2017 10:47
Where is the spec?
Tushar Mathur
@tusharmath
May 03 2017 10:47
@barbiturat Check the docs
Specs are there
Vadim Nekrasov
@barbiturat
May 03 2017 10:47
Which docs?
Tushar Mathur
@tusharmath
May 03 2017 10:48
ramda :)
Vadim Nekrasov
@barbiturat
May 03 2017 10:48
There is no information about "Maybe"
Vadim Nekrasov
@barbiturat
May 03 2017 10:51
@puffnfresh Thank you very much! )
Now I know that reading the docs about ramda.js is not enough. Also necessary to read docs about ramda-fantasy )
Brian McKenna
@puffnfresh
May 03 2017 10:52
the docs assume you're familiar with Maybe
not a particular implementation of Maybe
ramda-fantasy is one library which provides Maybe, there's a few others too though
Vadim Nekrasov
@barbiturat
May 03 2017 10:55
It's assumed that an user have got an information about Maybe from WHERE? It is assumed that an user of ramda.js should have an experiense with ramda-fantasy?
Brian McKenna
@puffnfresh
May 03 2017 10:55
from somewhere I guess, there's a few different libraries which provide Maybe
I don't think ramda-fantasy specifically is assumed knowledge
Gabe Johnson
@gabejohnson
May 03 2017 12:52
@barbiturat https://sanctuary.js.org/ has some good docs about Maybe
Adam Recvlohe
@arecvlohe
May 03 2017 14:08
It’s a nice and simple API, not a whole lot going on
I mean a lot is going, but it’s simple
Matthew Willhite
@miwillhite
May 03 2017 14:10
@barbiturat Maybe is something you’ll find across languages, it isn’t restricted to the ramda ecosystem. Any specs you’d find would be specific to a particular implementation…but not representative of all implementations.
It just so happens that the ramda repl (provided by the docs) uses the ramda-fantasy Maybe, but you also have available the Sanctuary Maybe (look at the network tab when loading the repl) as well as many other tools.
Gabe Johnson
@gabejohnson
May 03 2017 14:13
There should be a link to ramda-fantasy in the docs for composeK
James Forbes
@JAForbes
May 03 2017 14:30
The ramda repl has sanctuary and fantasy-maybe?!
I didn't know sanctuary was in there! That's awesome!
Matthew Willhite
@miwillhite
May 03 2017 14:31
Ha yeah I didn’t either until I investigated…was curious about which Maybe was being used.
James Forbes
@JAForbes
May 03 2017 14:35
Thanks for pointing that out @miwillhite :)
I will likely use that every day now, its great when you learn something like that
Brad Compton (he/him)
@Bradcomp
May 03 2017 15:21
@JAForbes Last I checked Sandtuary and RF were broken in the REPL, but it looks like they are working now! That's wonderful!!!
James Forbes
@JAForbes
May 03 2017 15:23
:sparkles: :tada:
Brad Compton (he/him)
@Bradcomp
May 03 2017 15:28
@barbiturat Maybe is typically used in the Ramda Docs just as the token example of a Functor, Applicative, or Monad, not for anything specific to the Maybe type. Fantasy Land has the specification of those type classes among others. composeK for instance doesn't just work on Maybe, but on any structure that is a Monad
As a somewhat unfortunate side note though - the Ramda functions that dispatch to the Fantasyland methods (ap, map, chain, sequence, etc.) do so to an older version of the spec - so there are some incompatibilities between more modern libraries and the Ramda utility functions
I believe that the RF implementations all follow the same version of the spec that Ramda does, so there is compatibility there.
James Forbes
@JAForbes
May 03 2017 15:42
Maybe we should have added a version to the fl prefix
:D
Ryan Stegmann
@rstegg
May 03 2017 18:22
@JAForbes :+1:
Gabe Johnson
@gabejohnson
May 03 2017 18:24
@JAForbes open a issue :smile: