added: instance Monad to Value
I see #94. I think to can easy create monad instance.
This commit is contained in:
parent
08c9b4cdf9
commit
4b2670bf43
@ -634,6 +634,10 @@ instance Applicative Value where
|
|||||||
(<*>) (Value f) (Value a) = Value (f a)
|
(<*>) (Value f) (Value a) = Value (f a)
|
||||||
pure = Value
|
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
|
-- | A list of single values. There's a limited set of functions
|
||||||
-- able to work with this data type (such as 'subList_select',
|
-- able to work with this data type (such as 'subList_select',
|
||||||
-- 'valList', 'in_' and 'exists').
|
-- 'valList', 'in_' and 'exists').
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user