module System.Shana.Utils where
import Control.Arrow ((>>>), (<<<))
import Control.Category (Category)
import System.Shana.Type
import Prelude hiding ((), (>), (<), (^))
(.) :: a -> (a -> b) -> b
a . f = f a
infixl 9 .
(>) :: (Category cat) => cat a b -> cat b c -> cat a c
(>) = (>>>)
infixl 8 >
(<) :: (Category cat) => cat b c -> cat a b -> cat a c
(<) = (<<<)
infixr 8 <
(^) :: (Functor f) => f a -> (a -> b) -> f b
(^) = flip fmap
infixl 8 ^
() :: (a -> b) -> a -> b
f x = f x
infixr 0
(<|>) :: (a -> IO [b]) -> (b -> IO [c]) -> (a -> IO [c])
f <|> g = runShana Shana f > Shana g
infixl 5 <|>
shana :: Shana String b -> IO [b]
shana x = runShana x ""