module Control.Arrow.ArrowIO
( ArrowIO(..)
, ArrowIOIf(..)
)
where
import Control.Arrow
class Arrow a => ArrowIO a where
arrIO :: (b -> IO c) -> a b c
arrIO0 :: IO c -> a b c
arrIO0 IO c
f = (b -> IO c) -> a b c
forall b c. (b -> IO c) -> a b c
forall (a :: * -> * -> *) b c. ArrowIO a => (b -> IO c) -> a b c
arrIO (IO c -> b -> IO c
forall a b. a -> b -> a
const IO c
f)
{-# INLINE arrIO0 #-}
arrIO2 :: (b1 -> b2 -> IO c) -> a (b1, b2) c
arrIO2 b1 -> b2 -> IO c
f = ((b1, b2) -> IO c) -> a (b1, b2) c
forall b c. (b -> IO c) -> a b c
forall (a :: * -> * -> *) b c. ArrowIO a => (b -> IO c) -> a b c
arrIO (\ ~(b1
x1, b2
x2) -> b1 -> b2 -> IO c
f b1
x1 b2
x2)
{-# INLINE arrIO2 #-}
arrIO3 :: (b1 -> b2 -> b3 -> IO c) -> a (b1, (b2, b3)) c
arrIO3 b1 -> b2 -> b3 -> IO c
f = ((b1, (b2, b3)) -> IO c) -> a (b1, (b2, b3)) c
forall b c. (b -> IO c) -> a b c
forall (a :: * -> * -> *) b c. ArrowIO a => (b -> IO c) -> a b c
arrIO (\ ~(b1
x1, ~(b2
x2, b3
x3)) -> b1 -> b2 -> b3 -> IO c
f b1
x1 b2
x2 b3
x3)
{-# INLINE arrIO3 #-}
arrIO4 :: (b1 -> b2 -> b3 -> b4 -> IO c) -> a (b1, (b2, (b3, b4))) c
arrIO4 b1 -> b2 -> b3 -> b4 -> IO c
f = ((b1, (b2, (b3, b4))) -> IO c) -> a (b1, (b2, (b3, b4))) c
forall b c. (b -> IO c) -> a b c
forall (a :: * -> * -> *) b c. ArrowIO a => (b -> IO c) -> a b c
arrIO (\ ~(b1
x1, ~(b2
x2, ~(b3
x3, b4
x4))) -> b1 -> b2 -> b3 -> b4 -> IO c
f b1
x1 b2
x2 b3
x3 b4
x4)
{-# INLINE arrIO4 #-}
class (Arrow a, ArrowIO a) => ArrowIOIf a where
isIOA :: (b -> IO Bool) -> a b b