Why there is no `creed.of` method?
See original GitHub issueThe FL Applicative spec includes the of
method but it does not seem to be available on creed
:
> creed.of(1)
TypeError: creed.of is not a function
Any reason not to have it?
It could be mentioned that of
is actually more basic than Applicative and is part of the Pointed Functor Spec, see also https://github.com/MostlyAdequate/mostly-adequate-guide-it/blob/master/ch9.md#pointy-functor-factory.
It seems that creed.fulfill
is doing what of
is meant to do,
which is somewhat non-standard name and is longer to write.
Also, when it is not called of
, the question arises whether it conforms
to the Pointed Functor spec, which I understand it does.
If creed.fulfill
is indeed intended to satisfy the Pointed Functor spec (together with map
),
maybe also alias it as of
and add tests for the spec?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Legitamacy and Function of Creeds - The Reformed Reader
There is a great downplaying of doctrine. Methods, social change, experience and gifts are all considered more important.
Read more >Shema! - The Creed of Jesus | 21st Century Reformation
It is the creed of God given by Jesus which is to be relied on unconditionally. Words found in the Bible itself are...
Read more >Arian creeds - Wikipedia
Arian creeds are the creeds of Arian Christians, developed mostly in the fourth century when Arianism was one of the main varieties of...
Read more >The Usefulness of Creeds - Bible Research
Creeds are invaluable instruments of Christian education and discipline and in no way do they diminish the authority of Scripture. The decline in...
Read more >7 Reasons the Apostles' Creed is Needed in the Church
It boldly confesses the grandeur of authentic Christianity in a series of ... The church needs the creeds not only to teach the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
tl;dr I’m open to simplifying/streamlining the API for a 2.0 release
@dmitriz Creed was intended to help bridge between A+ / ES and FL. It was created at a time when native promises had significant performance problems, async/await wasn’t easy to use everywhere, and FL was still fairly new.
So, many of the 1.x API decisions were made under quite different circumstances than exist today. It’s easier to see some of the API inconsistencies with hindsight. I’m sure there’s plenty of room for improvement, and I do appreciate your fresh perspective on it.
The API is intended to be used primarily as named exports, and creed.Promise is exported mostly just in case someone might ever need it. Perhaps not the best reason, but again, hindsight.
of
being on Promise was mostly for FL compat.As @bergus mentioned, creed’s Promise was intended as a drop in replacement for A+/ES. The
shim()
function will forcibly install creed’s Promise as global Promise. There were (and still are, imho) advantages to that:then
) with their own promises, but are forced to interact with other implementations by only usingthen
. Thus, if your app uses explicit promise via creed, it is beneficial that other promises created via global Promise are also creed promises.All of that said, I’d certainly be open to simplifying/streamlining the API for a 2.0 release.
Correction: Creed’s async stack traces are awesome!