module Pandora.Core.Morphism (fix, (&), (!), (%)) where

infixl 1 &
infixr 2 !
infixr 9 %

fix :: (a -> a) -> a
fix :: (a -> a) -> a
fix a -> a
f = let x :: a
x = a -> a
f a
x in a
x

{-# INLINE (&) #-}
(&) :: a -> (a -> b) -> b
a
x & :: a -> (a -> b) -> b
& a -> b
f = a -> b
f a
x

{-# INLINE (!) #-}
(!) :: a -> b -> a
a
x ! :: a -> b -> a
! b
_ = a
x

{-# INLINE (%) #-}
(%) :: (a -> b -> c) -> b -> a -> c
% :: (a -> b -> c) -> b -> a -> c
(%) a -> b -> c
f b
x a
y = a -> b -> c
f a
y b
x