What I'm trying to do:  I want to use Node to fire up two child processes in a particular order at a particular time, console logging their stdout as they stream, occasionally switching between the two.   The output I want:  `Proc 1 log # 1` `Pro...
Note: while the code in this question deals with functional programming/monads, etc., I'm not asking about functional programming (nor do I think this question should have tags related to functional programming, etc.). Instead, I'm asking abo...
I know that Javascript's promises are technically neither functors nor monads in the sense of Haskell, because (among other things)   they include a bind operation that falls back to map when a pure function is passed in (and thus has an ambiguou...
I'm putting a security layer in front of a document-oriented and I needed a reasonably abstract way for the application to define what new documents and what updates to existing documents are legal for a particular user.  The particular issues ar...
[EDIT]  This is a follow-up question of How to implement a stack-safe chainRec operator for the continuation monad?     Given is chainRec's type  chainRec :: ChainRec m => ((a -> c, b -> c, a) -> m c, a) -> m b   Usually, chainRec...
In the examples for monads.maybe on npm we have:  function find(collection, predicate) {   for (var i = 0; i < collection.length; ++i) {     var item = collection[i]     if (predicate(item))  return Maybe.Just(item)   }   return Maybe.Nothing() }...
I have monadic data structure that look like this:  export abstract class Data<A> {   static initial<A>(): Data<A> {     return new Initial<A>()   }    static failed<A>(error?: any): Data<A> {     return new Failed...
In DrBoolean's Gitbook, there are several examples explaining monad, for Maybe:  Maybe.prototype.join = function() {   return this.isNothing() ? Maybe.of(null) : this.__value; }   And for IO:  IO.prototype.join = function() {   var thiz = this;...
I am interested to experiment with Haskell-like IO monads in my JavaScript function compositions.   Something like Folktale has Task seems similar to Haskell's IO in that it's lazy, and thus technically pure. It represents an action that can...
I construct monad transformers as variants of chain/of that take an additional argument - a type directory of the outer monad:    const None =   ({runOption: null, tag: "None", [Symbol.toStringTag]: "Option"});  const Some = x =>...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.