Implement the "fail" method for Ok
commit0f70d15005125eb0c2bfbf2ef9f4ce57e7cf5643
authorLeon P Smith <leon@melding-monads.com>
dateSun 6 May 2012, 17:47 (14 years ago)
parent4b11d1c
src/Database/PostgreSQL/Simple/Ok.hs+1−5
@@ -73,12 +73,8 @@ instance Monad Ok where
7373
7474 Errors es >>= _ = Errors es
7575 Ok a >>= f = f a
76− -- TODO: add a definition for "fail", akin to
7776
78− -- fail str = Errors [SomeException (error str)]
79−
80− -- but *correct*, as this will throw an exception if you try to
81− -- examine the exception.
77+ fail str = Errors [SomeException (ErrorCall str)]
8278
8379-- | a way to reify a list of exceptions into a single exception
8480