question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New library/spec similair to Fantasy Land

See original GitHub issue

Hello all 😄

I’d like to share a library/specification that I’ve been working on. It’s called Jabz and is highly inspired by Fantasy Land—but with a number of differences that I think are beneficial.

Some of the differences are:

  • Foldable supports a short-circuiting fold that gives the same benefits as Haskell’s lazy foldr. This means that a number of functions for foldable can be made more performant. It also means that infinite data structures can meaningfully implement foldable.
  • I’ve made lift part of the Applicative spec which gives a very substantial performance improvement. Similar to the idea in #56.
  • I’ve tweaked the monad spec so that do-notation as is Fantasy Do can be implemented without exposing the nasty “multi mode”.
  • Some derived methods are part of the spec so that implementations can bring their own implementations. In some cases these can have much better performance.

I’ve written more about these ideas in a blog post here. The library can be found here.

I’d love to hear what you all think about it.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
paldepindcommented, Jan 8, 2017

@safareli

Why not create Issues/PRs to fix problems discussed in your article, instead of creating new spec?

Well, this started out as an experiment. It was a lot easier for me to just go ahead, experiment and implement all of my ideas rather than try to get Fantasy Land to adopt each of them one by one. You can consider the entire library as a proof of concept for proposals to Fantasy Land. That is also why I posted it here.

But do notice that a major incompatibility is that Jabz doesn’t use prefixed method names. I’m not sure if Fantasy Land is willing to backtrack on that decision.

Regarding the xkcd. I didn’t create Jabz to “develop one universal standard that covers everyone’s use cases”. I created it to get something that is suitable for my own use case.

1reaction
paldepindcommented, Mar 4, 2017

@kwijibo

Thank you for the feedback.

Weren’t you in favor of prefixed method names in fantasyland @paldepind?

Yes. Back then I was. Part of the reason was from my experience with creating the library Flyd. I didn’t want Flyd to have an object oriented API but to support FL I had to partly add one. And then users started using the methods directly—which I didn’t like. I thought that if the methods were prefixed users would realize that they were “internal” and not for end-user consumption.

Today I think that my opinion back then came from an irrational distaste for methods. But Fantasy Land relies fundamentally on methods. And when you have to add methods anyway why not do so in a way that is easy to use instead of cumbersome to use?

It is my impression that @SimonRichardson still prefers non-prefixed methods?

Maybe the issue should be rediscussed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's more fantastic than fantasy land? An Introduction to ...
Well, like Fantasy Land, Static Land is a specification for common algebraic structures. Fantasy Land assumes that you're creating structures ...
Read more >
fantasyland/fantasy-land: Specification for interoperability of ...
This project specifies interoperability of common algebraic structures: Setoid; Ord; Semigroupoid; Category; Semigroup; Monoid; Group; Filterable; Functor ...
Read more >
Libraries in Fantasy - Reddit
There's a faery library in Phantastes by George MacDonald. When you open a book, it draws you inside its world and you experience...
Read more >
My Favorite Libraries in Speculative Fiction
The library is a staple of science fiction and fantasy, ... Just like any place else, the Land of Ooo has a library...
Read more >
Recent Adventure & Fantasy Reads to Enthrall Middle Grade ...
A library. A key. Two people bound to each other through time and space, memory and dreams. At the center of their relationship...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found