[Haskell-cafe] Call for GUI examples - Functional Reactive Programming

Henning Thielemann lemming at henning-thielemann.de
Sun Jul 10 14:23:38 CEST 2011


On Sun, 10 Jul 2011, Felipe Almeida Lessa wrote:

> On Sat, Jul 9, 2011 at 7:58 AM, Henning Thielemann
> <lemming at henning-thielemann.de> wrote:
>> My stream processors are not Arrows, because 'first' cannot be implemented.
>> However, 'arr' and '.' can be implemented.
> ...
>> Since I have no Arrow instance I even have to write my own combinators that
>> are counterparts to (&&&) and friends.
>
> If you have arr, (.) and (&&&), then you have first as well:
>
>  f **** g = (arr fst >>> f) &&& (arr snd >>> g)
>
>  first' f = f **** arr id
>
> Am I missing something here? =)

I have only something like (&&&), but not precisely (&&&).

I have for instance

parallel :: (Monoid b) => T a b -> T a b -> T a b

The arrow (T a b) emits a value of type 'b' for every incoming event of 
type 'a', but may also emit a 'b' without any input trigger. 
Monoid.mappend is used to merge the events if both input arrows generate 
an output at the same time.



More information about the Haskell-Cafe mailing list