module Object.Types where
import Prelude hiding ((.))
import Control.Applicative
import Control.Monad
type family Output object action
class Action object action where
(.) :: object -> action -> Output object action
data a := b = a := b deriving (Show,Read,Eq)
type family MethodOutput object method
(%) = flip ($)
a ... b = \x -> a (b x)
a *> b = fmap (%b) a
a *< b = fmap ($ b) a
a *. b = fmap (.b) a
a >* b = fmap (a%) b
a <* b = fmap (a$) b
a .* b = fmap (a.) b
a *>* b = (%) <$> (a) <*> b
a *<* b = ($) <$> a <*> b
a *.* b = (.) <$> a <*> b
infixl 8 .
infixl 9 :=
infixl 0 %
infixl 4 *.
infixl 4 .*
infixl 4 *.*
infixl 4 *>
infixl 4 >*
infixl 4 *>*
infixr 4 *<
infixr 4 <*
infixr 4 *<*