Skip to content

Commit 5920208

Browse files
Fix haddock example
1 parent 79b87ab commit 5920208

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Valida/Combinators.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -584,16 +584,16 @@ optionally (Validator v) = Validator $ maybe (Success Nothing) (fmap Just . v)
584584
585585
Yields 'Success' when input is 'Nothing', and wrapped around the default value.
586586
587-
@vald \`withDefault\` deflt = 'Data.Maybe.fromMaybe' deflt <$> 'optionally' vald@
587+
@vald \`withDefault\` deflt = 'Data.Maybe.fromMaybe' deflt '<$>' 'optionally' vald@
588588
589589
==== __Examples__
590590
591591
>>> runValidator (failureIf even "Even" `withDefault` 0) (Just 5)
592-
Success (Just 5)
592+
Success 5
593593
>>> runValidator (failureIf even "Even" `withDefault` 0) (Just 6)
594594
Failure ("Even" :| [])
595595
>>> runValidator (failureIf even "Even" `withDefault` 0) Nothing
596-
Success Nothing
596+
Success 0
597597
-}
598598
withDefault :: Validator e inp a -> a -> Validator e (Maybe inp) a
599599
withDefault (Validator v) deflt = Validator $ maybe (Success deflt) v

0 commit comments

Comments
 (0)