From a3c56b3c2e64cd40c258f7e24d05e9ec50b71098 Mon Sep 17 00:00:00 2001 From: "Scott R. Parish" Date: Tue, 23 Feb 2010 07:13:29 -0600 Subject: [PATCH] simplify findOne --- Database/MongoDB.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Database/MongoDB.hs b/Database/MongoDB.hs index d181c5d..575e60d 100644 --- a/Database/MongoDB.hs +++ b/Database/MongoDB.hs @@ -504,9 +504,7 @@ find c col sel = query c col [] 0 0 sel [] -- | Query, but only return the first result, if any. findOne :: Connection -> FullCollection -> Selector -> IO (Maybe BsonDoc) -findOne c col sel = do - cur <- query c col [] 0 (-1) sel [] - nextDoc cur +findOne c col sel = query c col [] 0 (-1) sel [] >>= nextDoc -- | Perform a query and return the result as a lazy list. Be sure to -- understand the comments about using the lazy list given for