Name: Anonymous 2007-02-03 12:27
*** ??? &&&
Nah, just kidding, I kinda get them.
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 :/
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 :/