Closed ghost closed 11 years ago
Hrmm. the issue i'd have would be ensuring the correct semantics with regards to (<|>) and I don't think its possible to do so.
Right now all of the free constructions we export are truly free.
However, the fact that there are two competing semantics for (<|>) indicate to me that I probably cannot construct something that is truly free with regards to that action.
I'm somewhat loathe to introduce a non-free construction in this package.
I understand there is a general problem of having different semantics for (<|>)
/mplus
, but I would think this stops being a problem when runFList
takes a function forall a. [g a] -> g a
to specify it.
The semantics provided by the user can't violate the Alternative
laws, because associativity and identity are enforced by my module. Meanwhile, the signature of the user-supplied semantics seems free enough to me to allow any desired semantics, so both Left Catch and Left Distribution should be possible.
What problem am I missing here?
When trying to make a simple schema EDSL, I inadvertently recreated the
Control.Applicative.Free
part of this library. When someone directed me to this library, I was able to streamline mine, adding the equivalents oflift
andrunAp
.However, I went a bit further in my module:
FList
is a freeApplicative
functor,Monad
, andAlternative
functor. The interface barely changes, only requiring the result ofrunFList
to be monadic as well.runFList
also takes an additional sum function, so that the user can supply their own semantics for<|>
.Is there a chance the
free
library will be extended, so I can use that instead of my attempt to have freeAlternative
functors (plusMonad
)?