Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d3a202

Browse files
committedMay 28, 2020
[#50] Change Alternative instance
Resolves #50
1 parent 49ad9a0 commit 9d3a202

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎trial/src/Trial.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ instance Applicative (Trial e) where
282282
both 'Fiasco's.
283283
284284
>>> fiasco "No info" <|> pure 42
285-
Result (fromList []) 42
285+
Result (fromList ["No info"]) 42
286286
>>> pure 42 <|> result "Something" 10
287287
Result (fromList []) 42
288288
>>> fiasco "No info" <|> fiasco "Some info"
@@ -297,7 +297,7 @@ instance Alternative (Trial e) where
297297

298298
(<|>) :: Trial e a -> Trial e a -> Trial e a
299299
r@Result{} <|> _ = r
300-
_ <|> r@Result{} = r
300+
f@Fiasco{} <|> r@Result{} = f <> r
301301
(Fiasco e1) <|> (Fiasco e2) = Fiasco (e1 <> e2)
302302
{-# INLINE (<|>) #-}
303303

0 commit comments

Comments
 (0)
Please sign in to comment.