Skip to main content
added 5 characters in body
Source Link
Robert Harvey
  • 200.7k
  • 55
  • 470
  • 683

The real beauty of an Option type, though, is that it is isomorphic to a collection that can only hold from zero to one elements. Dealing with collections is one of the most important parts of programming, and thus every language in the world has powerful collections libraries. And you can apply all of the work that has gone into collections also to Options types.

The real beauty of an Option type, though, is that it is isomorphic to a collection that can only hold from zero to one elements. Dealing with collections is one of the most important parts of programming, and thus every language in the world has powerful collections libraries. And you can apply all of the work that has gone into collections also to Options.

The real beauty of an Option type, though, is that it is isomorphic to a collection that can only hold from zero to one elements. Dealing with collections is one of the most important parts of programming, and thus every language in the world has powerful collections libraries. And you can apply all of the work that has gone into collections also to Option types.

Rollback to Revision 4
Source Link
Jörg W Mittag
  • 104.7k
  • 24
  • 226
  • 327

It turns out that Option is actually even more than "just" a collection. It is a monad. Languages like F#C#, Scala, and Haskell have built in syntax sugar for working with monads, and they have powerful libraries for working with monads. I will not go into details about what it means to be a monad, but e.g. one of the advantages is that there are some specific mathematical laws and properties associated with monads, and one can exploit those properties.

It turns out that Option is actually even more than "just" a collection. It is a monad. Languages like F#, Scala, and Haskell have built in syntax sugar for working with monads, and they have powerful libraries for working with monads. I will not go into details about what it means to be a monad, but e.g. one of the advantages is that there are some specific mathematical laws and properties associated with monads, and one can exploit those properties.

It turns out that Option is actually even more than "just" a collection. It is a monad. Languages like C#, Scala, and Haskell have built in syntax sugar for working with monads, and they have powerful libraries for working with monads. I will not go into details about what it means to be a monad, but e.g. one of the advantages is that there are some specific mathematical laws and properties associated with monads, and one can exploit those properties.

I guess you meant F# rather than C#?
Source Link
scrwtp
  • 4.5k
  • 1
  • 26
  • 29

It turns out that Option is actually even more than "just" a collection. It is a monad. Languages like C#F#, Scala, and Haskell have built in syntax sugar for working with monads, and they have powerful libraries for working with monads. I will not go into details about what it means to be a monad, but e.g. one of the advantages is that there are some specific mathematical laws and properties associated with monads, and one can exploit those properties.

It turns out that Option is actually even more than "just" a collection. It is a monad. Languages like C#, Scala, and Haskell have built in syntax sugar for working with monads, and they have powerful libraries for working with monads. I will not go into details about what it means to be a monad, but e.g. one of the advantages is that there are some specific mathematical laws and properties associated with monads, and one can exploit those properties.

It turns out that Option is actually even more than "just" a collection. It is a monad. Languages like F#, Scala, and Haskell have built in syntax sugar for working with monads, and they have powerful libraries for working with monads. I will not go into details about what it means to be a monad, but e.g. one of the advantages is that there are some specific mathematical laws and properties associated with monads, and one can exploit those properties.

added 14 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
added 280 characters in body
Source Link
Jörg W Mittag
  • 104.7k
  • 24
  • 226
  • 327
Loading
added 2958 characters in body
Source Link
Jörg W Mittag
  • 104.7k
  • 24
  • 226
  • 327
Loading
Source Link
Jörg W Mittag
  • 104.7k
  • 24
  • 226
  • 327
Loading