Monad

Monad

  • Monadic Type
  • Operations
    • Unit — Type converter to Monadic Type
    • Bind — Can be chained together to give another Monads

Example

  • Monadic Type: Optional<T>
  • Operations:
    • Unit: Optional.ofNullable(x): converts x to Optional
    • Bind: flatMap(T -> Optional<U>) returns another Optional

If flatMap monadic, Is map also monadic?