Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- type family Output object action
- class Action object action where
- data a := b = a := b
- type family MethodOutput object method
- (%) :: b -> (b -> c) -> c
- (...) :: (t1 -> t) -> (t2 -> t1) -> t2 -> t
- (*>) :: Functor f => f a -> (a -> b) -> f b
- (*<) :: Functor f => f (a -> b) -> a -> f b
- (*.) :: (Action a action, Functor f) => f a -> action -> f (Output a action)
- (>*) :: Functor f => b1 -> f (b1 -> b) -> f b
- (<*) :: Functor f => (a -> b) -> f a -> f b
- (.*) :: (Action object a, Functor f) => object -> f a -> f (Output object a)
- (*>*) :: Applicative f => f a -> f (a -> b) -> f b
- (*<*) :: Applicative f => f (a -> b) -> f a -> f b
- (*.*) :: (Action a1 a, Applicative f) => f a1 -> f a -> f (Output a1 a)
Documentation
type family Output object action Source
type Output Simple (Method m) = MethodOutput Simple (Method m) | |
type Output Simple ((:=) (Method m) input) = MethodOutput Simple ((:=) (Method m) input) | |
type Output (Foo x0) (Method m0) = MethodOutput (Foo x0) (Method m0) | |
type Output (Foo x0) ((:=) (Method m0) input0) = MethodOutput (Foo x0) ((:=) (Method m0) input0) | |
type Output (Map k v) action = OutputMap (Map k v) action | |
type Output (b -> c) (a -> b') = a -> c |
class Action object action where Source
Action Simple Simple_ | |
(~) * anything Int => Action Simple ((:=) Simple_ anything) | |
Action (Foo x) Blub_ | |
Action (Foo x) Baz_ | |
Action (Foo x) Bar_ | |
(~) * value0 x0 => Action (Foo x) ((:=) Blub_ value) | |
(~) * value0 Char => Action (Foo x) ((:=) Baz_ value) | |
(~) * value0 Int => Action (Foo x) ((:=) Bar_ value) | |
((~) * k k', (~) * (OutputMap (Map k v) k') v, Ord k) => Action (Map k v) k' | |
Action (Map k v) Size_ | |
((~) * k k', (~) * (OutputMap (Map k v) [k']) [v], Ord k) => Action (Map k v) [k'] | |
((~) * k k', (~) * (OutputMap (Map k v) (Maybe k')) (Maybe v), Ord k) => Action (Map k v) (Maybe k') | |
((~) * k k', (~) * v v', (~) * (OutputMap (Map k v) [(:=) k' v']) (Map k v), Ord k) => Action (Map k v) [(:=) k' v'] | |
(~) * b b' => Action (b -> c) (a -> b') | |
((~) * k k', (~) * v v', (~) * (OutputMap (Map k v) ((:=) k' v')) (Map k v), Ord k) => Action (Map k v) ((:=) k' v') |
a := b infixl 9 |
(~) * anything Int => Action Simple ((:=) Simple_ anything) | |
(~) * value0 x0 => Action (Foo x) ((:=) Blub_ value) | |
(~) * value0 Char => Action (Foo x) ((:=) Baz_ value) | |
(~) * value0 Int => Action (Foo x) ((:=) Bar_ value) | |
(Eq a, Eq b) => Eq ((:=) a b) | |
(Read a, Read b) => Read ((:=) a b) | |
(Show a, Show b) => Show ((:=) a b) | |
((~) * k k', (~) * v v', (~) * (OutputMap (Map k v) [(:=) k' v']) (Map k v), Ord k) => Action (Map k v) [(:=) k' v'] | |
((~) * k k', (~) * v v', (~) * (OutputMap (Map k v) ((:=) k' v')) (Map k v), Ord k) => Action (Map k v) ((:=) k' v') | |
type MethodOutput Simple ((:=) Simple_ anything) = Simple | |
type Output Simple ((:=) (Method m) input) = MethodOutput Simple ((:=) (Method m) input) | |
type MethodOutput (Foo x0) ((:=) Blub_ value) = Foo x0 | |
type MethodOutput (Foo x0) ((:=) Baz_ value) = Foo x0 | |
type MethodOutput (Foo x0) ((:=) Bar_ value) = Foo x0 | |
type Output (Foo x0) ((:=) (Method m0) input0) = MethodOutput (Foo x0) ((:=) (Method m0) input0) |
type family MethodOutput object method Source
type MethodOutput Simple Simple_ = Int | |
type MethodOutput Simple ((:=) Simple_ anything) = Simple | |
type MethodOutput (Foo x0) Blub_ = x0 | |
type MethodOutput (Foo x0) Baz_ = Char | |
type MethodOutput (Foo x0) Bar_ = Int | |
type MethodOutput (Foo x0) ((:=) Blub_ value) = Foo x0 | |
type MethodOutput (Foo x0) ((:=) Baz_ value) = Foo x0 | |
type MethodOutput (Foo x0) ((:=) Bar_ value) = Foo x0 | |
type MethodOutput (Map k v) Size_ = Int |
(*>) :: Functor f => f a -> (a -> b) -> f b infixl 4 Source
Explanation of all these operators.
They are basically an assortment of Functor
and
Applicative
functions. I.e.,
'[1,2,3] *> (+1)' === map (+1) [1,2,3]'
The asterisk *
indicates where the Functor
, Applicative
is.
And the greather than (smaller than) indicates in which direction
the argument is going. So you could also have
'[(+1),(+2),(+3)] *< 1 === map ($ 1) [(+1),(+2),(+3)]'.
If there are asterisks on both sides the Functor
has to be Applicative
(*>*) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 Source
(*<*) :: Applicative f => f (a -> b) -> f a -> f b infixr 4 Source
(*.*) :: (Action a1 a, Applicative f) => f a1 -> f a -> f (Output a1 a) infixl 4 Source