From 4b2670bf4394a5a3c559d2c46a3a66df4f7e8319 Mon Sep 17 00:00:00 2001 From: ncaq Date: Tue, 31 Jul 2018 17:20:29 +0900 Subject: [PATCH] added: instance Monad to Value I see #94. I think to can easy create monad instance. --- src/Database/Esqueleto/Internal/Language.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index f343838..b8d98d5 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -634,6 +634,10 @@ instance Applicative Value where (<*>) (Value f) (Value a) = Value (f a) pure = Value +instance Monad Value where + (>>=) x f = valueJoin $ fmap f x + where valueJoin (Value v) = v + -- | A list of single values. There's a limited set of functions -- able to work with this data type (such as 'subList_select', -- 'valList', 'in_' and 'exists').