module TypeMachine.Functions.Infix (
(<#|>),
(<:#|>),
(<#|:>),
(<|#>),
(<:|#>),
(<|#:>),
(<#&>),
(<:#&>),
(<#&:>),
(<&#>),
(<:&#>),
(<&#:>),
) where
import Language.Haskell.TH (Name)
import TypeMachine.Functions
import TypeMachine.TM
import TypeMachine.Type
(<#|>) :: Type -> Type -> TM Type
<#|> :: Type -> Type -> TM Type
(<#|>) = Type -> Type -> TM Type
intersection
{-# INLINE (<#|>) #-}
(<:#|>) :: Name -> Type -> TM Type
Name
a <:#|> :: Name -> Type -> TM Type
<:#|> Type
b = Name -> TM Type
toType Name
a TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
a' -> Type
a' Type -> Type -> TM Type
<#|> Type
b
(<#|:>) :: Type -> Name -> TM Type
Type
a <#|:> :: Type -> Name -> TM Type
<#|:> Name
b = Name -> TM Type
toType Name
b TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
b' -> Type
a Type -> Type -> TM Type
<#|> Type
b'
(<|#>) :: Type -> Type -> TM Type
<|#> :: Type -> Type -> TM Type
(<|#>) = Type -> Type -> TM Type
intersection'
{-# INLINE (<|#>) #-}
(<:|#>) :: Name -> Type -> TM Type
Name
a <:|#> :: Name -> Type -> TM Type
<:|#> Type
b = Name -> TM Type
toType Name
a TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
a' -> Type
a' Type -> Type -> TM Type
<|#> Type
b
(<|#:>) :: Type -> Name -> TM Type
Type
a <|#:> :: Type -> Name -> TM Type
<|#:> Name
b = Name -> TM Type
toType Name
b TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
b' -> Type
a Type -> Type -> TM Type
<|#> Type
b'
(<#&>) :: Type -> Type -> TM Type
<#&> :: Type -> Type -> TM Type
(<#&>) = Type -> Type -> TM Type
union
{-# INLINE (<#&>) #-}
(<:#&>) :: Name -> Type -> TM Type
Name
a <:#&> :: Name -> Type -> TM Type
<:#&> Type
b = Name -> TM Type
toType Name
a TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
a' -> Type
a' Type -> Type -> TM Type
<#&> Type
b
(<#&:>) :: Type -> Name -> TM Type
Type
a <#&:> :: Type -> Name -> TM Type
<#&:> Name
b = Name -> TM Type
toType Name
b TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
b' -> Type
a Type -> Type -> TM Type
<#&> Type
b'
(<&#>) :: Type -> Type -> TM Type
<&#> :: Type -> Type -> TM Type
(<&#>) = Type -> Type -> TM Type
union'
{-# INLINE (<&#>) #-}
(<:&#>) :: Name -> Type -> TM Type
Name
a <:&#> :: Name -> Type -> TM Type
<:&#> Type
b = Name -> TM Type
toType Name
a TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
a' -> Type
a' Type -> Type -> TM Type
<&#> Type
b
(<&#:>) :: Type -> Name -> TM Type
Type
a <&#:> :: Type -> Name -> TM Type
<&#:> Name
b = Name -> TM Type
toType Name
b TM Type -> (Type -> TM Type) -> TM Type
forall a b.
WriterT [TypeMachineLog] Q a
-> (a -> WriterT [TypeMachineLog] Q b)
-> WriterT [TypeMachineLog] Q b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Type
b' -> Type
a Type -> Type -> TM Type
<&#> Type
b'