diff --git a/src/Control/Monad/Unify/Trans.purs b/src/Control/Monad/Unify/Trans.purs index de23008..780184b 100644 --- a/src/Control/Monad/Unify/Trans.purs +++ b/src/Control/Monad/Unify/Trans.purs @@ -32,24 +32,12 @@ newtype UnifyT k f m a = MkUnifyT (StateT (UnificationState k f) m a) derive instance Newtype (UnifyT k f m a) _ derive instance Functor m => Functor (UnifyT k f m) - -instance Monad m => Apply (UnifyT k f m) where - apply m1 m2 = MkUnifyT $ apply (un MkUnifyT m1) (un MkUnifyT m2) - -instance Monad m => Applicative (UnifyT k f m) where - pure a = MkUnifyT $ pure a - -instance Monad m => Bind (UnifyT k f m) where - bind m f = MkUnifyT $ (un MkUnifyT m) >>= (un MkUnifyT <<< f) - +derive newtype instance Monad m => Apply (UnifyT k f m) +derive newtype instance Monad m => Applicative (UnifyT k f m) +derive newtype instance Monad m => Bind (UnifyT k f m) instance Monad m => Monad (UnifyT k f m) - -instance (Monad m, Alt m) => Alt (UnifyT k f m) where - alt = over2 MkUnifyT alt - -instance (Monad m, Plus m) => Plus (UnifyT k f m) where - empty = MkUnifyT empty - +derive newtype instance (Monad m, Alt m) => Alt (UnifyT k f m) +derive newtype instance (Monad m, Plus m) => Plus (UnifyT k f m) instance (Monad m, Alternative m) => Alternative (UnifyT k f m) instance (MonadPlus m) => MonadPlus (UnifyT k f m)