We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1526f9 commit 4af69dcCopy full SHA for 4af69dc
src/Maybe.elm
@@ -50,6 +50,11 @@ value. This comes in handy when paired with functions like
50
51
withDefault "unknown" (Dict.get "Tom" Dict.empty) -- "unknown"
52
53
+**Note:** This can be overused! Many cases are better handled by a `case`
54
+expression. And if you end up using `withDefault` a lot, it can be a good sign
55
+that a [custom type][ct] will clean your code up quite a bit!
56
+
57
+[ct]: https://guide.elm-lang.org/types/custom_types.html
58
-}
59
withDefault : a -> Maybe a -> a
60
withDefault default maybe =
0 commit comments