One common monadic structure is the Option (or Maybe in Haskell and other languages) type. This can be seen as an encapsulation type. Consider a function which may fail to produce a meaningful value for certain inputs. For example, fnmain(){// Parses a string into an integer. from_str::<int>("4");// A valid input. from_str::<int>("Potato");// Definitely invalid. }