File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -584,16 +584,16 @@ optionally (Validator v) = Validator $ maybe (Success Nothing) (fmap Just . v)
584584
585585Yields '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)
594594Failure ("Even" :| [])
595595>>> runValidator (failureIf even "Even" `withDefault` 0) Nothing
596- Success Nothing
596+ Success 0
597597-}
598598withDefault :: Validator e inp a -> a -> Validator e (Maybe inp ) a
599599withDefault (Validator v) deflt = Validator $ maybe (Success deflt) v
You can’t perform that action at this time.
0 commit comments