Merge pull request #98 from ncaq/add-monad-value

added: instance Monad to Value
This commit is contained in:
Chris Allen 2018-07-31 12:22:50 -05:00 committed by GitHub
commit d2fdaaff36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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').