Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Nesting #3

refset opened this Issue · 5 comments

2 participants


From my email to Dominic:

For me the next priority would then be to ensure that the API is sane for nested
posets, where the set elements are posets themselves.

Hmm, sounds complicated, but I guess I can think of examples of posets
that overlap,
like, you have js files and modules that relate one way, and then the
expressions in the file
can be a poset too... but that is a bit abstract, is there a simpler example?

Your example really isn't that abstract. If a database engine could store posets nicely then your example is no longer a fs use-case and starts to sound very practical for managing code (and navigating around with a ZUI!)

Another similar example would be to manage pure FP modularity within a system. Instead of hard coding functions together (which is effectively an inline hash), the poset dictates the dependencies between its elements and makes swapping API-compatible functions in/out much easier. This approach would then scale to systems of systems of systems...

A final and more tangible but s example could be where you want to built an application for curating a module ecosystem. The modules would be in a poset, tags would be in another poset and curations in a third. To manage the interrelations between these posets you might as well use an "overlay" poset such that the other three are nested as mere elements (modules < tags < curations, modules < curations). This meta relationship describes how the nested posets share sets - e.g. you can curate a module or a tag


More fs-related examples:

  • network shares
  • .ISOs, .ZIPs etc

I don't quite understand what you are talking about here. Well, I can't visualize it, I mean.

It sounds like "dependency injection".

Hmm, I think I understand the module curation one. you might say, moduleX > moduleY, but moduleZ doesn't compare - because it's for a different problem. Different people would have created all these different curations,

what sort of operations would you do on nested posets?


Yes! That "FP modularity" thing is most definitely "dependency injection" - hadn't read about that before. It's using posets to dictate the entire progam structure.

Interestingly, I just watched this Mark Miller lecture that Crockford prompted me to look up at the end of his own "monads vs gonads" lecture. It covers highly related concepts but from a distributed security point of view with SES and 'use strict'. I think you'd like it. Except both he and Crockford are talking in terms of promises rather than lazy streams!

Operations on nested posets could be:

  • "execute()" :D
  • "expand" a subposet (so that its elements now appear in place of it, within the poset above) & "collapse" (...the opposite)
  • all of the traversal operations could take a parameter to traverse into to N levels of subposets (and if n is 0 then keep going!)
  • probably a bunch more once things become asynchronous (though I suspect I'll actually have to get around to doing a few PRs before that will happen ;))

A promise is much like a lazy stream that only fires once.

Hmm, I think the uses for nested posets will be a lot more clear (for me) once we have experience working with poset apis in multiple contexts.


This is where my vaguely pragmatic thoughts are at, roughly:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.