diff --git a/src/Control/Monad/Logic/Trans.purs b/src/Control/Monad/Logic/Trans.purs index 692943d..0c635b7 100644 --- a/src/Control/Monad/Logic/Trans.purs +++ b/src/Control/Monad/Logic/Trans.purs @@ -3,6 +3,7 @@ module Control.Monad.Logic.Trans (SFKT(..), FK, SK, unSFKT, runSFKT, runSFKTOnce import Prelude (class Applicative, class Apply, class Bind, class Functor, class Monad, bind, pure, ($), (<<<), (>>=), const, Unit, unit) import Control.Monad.Logic.Class +import Control.Lazy (class Lazy) import Control.MonadPlus (class MonadPlus, class Alternative, class Alt, class Plus, (<|>), empty) import Control.Monad.Reader.Class (class MonadReader, local, class MonadAsk, ask) import Control.Monad.State.Class (class MonadState, state) @@ -73,3 +74,6 @@ instance MonadReader r m => MonadReader r (SFKT m) where instance MonadState s m => MonadState s (SFKT m) where state f = lift $ state f + +instance Lazy (SFKT m a) where + defer f = SFKT (\sk fk -> unSFKT (f unit) sk fk)