Tsuyoshi Ito <[email protected]> wrote: > How can I use combinators like repeat, which takes a plain function as > an argument, in the arrow notation in a more readable way? Or am I > trying to do an impossible thing?
To answer your question: Arrow notation has no support for what you
want, so if you stick with it you will have to write the inner proc
explicitly.
However: The code may look much nicer, if you use applicative style for
the outer computation using Applicative, Category and Profunctor [1]:
test2 :: MyArr [Double] String
test2 = repeat 100 rmap . liftA3 (,,) id y z
where
y = arr func1
z = job1
rmap i = lmap (\(xs, y, z) -> xs !! i + y + z) (job3 (i * 2))
If you prefer, you can use arrow notation for the inner computation.
[1]: http://hackage.haskell.org/package/profunctors
Greets,
Ertugrul
--
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
signature.asc
Description: PGP signature
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
