concept Option type in category functional programming

appears as: n Option type, Option type, The Option type
Grokking Functional Programming MEAP V11

This is an excerpt from Manning's book Grokking Functional Programming MEAP V11.

  • name should be a non-empty String,
  • This is not a functional way! Pure functions always indicate all of the possible return values. The signature of parseShow needs to indicate that for some Strings, there is no correct TvShow.

    Functional Programming in C#: How to write better C# code

    This is an excerpt from Manning's book Functional Programming in C#: How to write better C# code.

    Partial functions are problematic because it’s not clear what the function should do when given an input for which it can’t compute a result? The Option type offers a perfect solution to model such cases: if the function is defined for the given input, it returns a Some wrapping the result; otherwise, it returns None.

    Listing 8.9. A property-based test proving that right identity holds for the Option type
    sitemap

    Unable to load book!

    The book could not be loaded.

    (try again in a couple of minutes)

    manning.com homepage
    test yourself with a liveTest