[Haskell-cafe] Can it be proven there are no intermediate "useful" type classes between Applicative Functors & Monads?

David Barbour dmbarbour at gmail.com
Tue Jun 7 18:15:14 CEST 2011


On Mon, Jun 6, 2011 at 4:05 PM, Casey McCann <syntaxglitch at gmail.com> wrote:

> ArrowChoice and ArrowApply are conceptually distinct and I expect
> there are instances of the former that have no possible instance for
> the latter. Branching vs. Monad I am much less certain of.
>

For a real-time or embedded DSL, or hardware modeling, you could easily
desire 'Branching' and limited 'Loop' classes while rejecting the full power
of Monads.


> some type that's not obviously equivalent to one of these definitions:
>   branchMonad mb t f = do { b <- mb; if b then t else f }
>   branchApplicative = liftA3 (\b t f -> if b then t else f)
>

Earlier forms of my reactive demand programming model [1] - before I
switched to arrows - would qualify. The model has limited side-effects (e.g.
power a camera on only when someone is observing it) so we cannot use
branchApplicative. The reactivity requires continuously weaving the two
branches over time and recombining the results, which is distinct from
branchMonad.

[1] http://awelonblue.wordpress.com/2011/05/21/comparing-frp-to-rdp/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110607/d2180854/attachment.htm>


More information about the Haskell-Cafe mailing list