Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

how do i shot arrow???

Name: Anonymous 2007-02-03 12:27

*** ??? &&&

Nah, just kidding, I kinda get them.

liftA2 :: (Arrow a) => (b -> c -> d) -> a e b -> a e c -> a e d
liftA2 p f g = f &&& g >>> (arr . uncurry) p

split :: Eq a => a -> [a] -> [[a]]
split _ [] = []
split d l  =
  ((dropWhile (== d)) ^>> (liftA2 (:) (takeArrow d) (dropArrow d >>^ (split d)))) l
  where
  takeArrow d = arr . takeWhile $ (/= d)
  dropArrow d = arr . dropWhile $ (/= d)


I wonder if this is what they are supposed to be used for though ;)  And I realized that functions are actually arrows already after writing this :/

Name: Anonymous 2007-02-06 0:55

So tell me, what's the real point of having arrows? It seems to me like it's just an overcomplicated and over-syntax'd wrapper to make functions look like monads. Which is kinda something we already have a special syntax for, right?

Maybe I'm just not getting it. On the other hand, I haven't seen any arrow instances that weren't functions, either!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List