mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
add <*> to Applicative for Transaction
This commit is contained in:
@@ -24,6 +24,10 @@ instance Functor Transaction where
|
|||||||
|
|
||||||
instance Applicative Transaction where
|
instance Applicative Transaction where
|
||||||
pure x = Transaction $ \c_db c_revision c_exn -> return x
|
pure x = Transaction $ \c_db c_revision c_exn -> return x
|
||||||
|
f <*> g = do
|
||||||
|
f <- f
|
||||||
|
g <- g
|
||||||
|
return (f g)
|
||||||
|
|
||||||
instance Monad Transaction where
|
instance Monad Transaction where
|
||||||
(Transaction f) >>= g = Transaction $ \c_db c_revision c_exn -> do
|
(Transaction f) >>= g = Transaction $ \c_db c_revision c_exn -> do
|
||||||
|
|||||||
Reference in New Issue
Block a user