Monad's left unit law does not seem to hold for Lists in scala. Are scala Lists not monads then?

Viewed 242

Monads' "left unit law":

unit(x) flatMap f == f(x)

But:

(List(1) flatMap ((x: Int) => Some[Int](x))) == List(1) // true
((x: Int) => Some[Int](x))(1) == Some(1) // also true

So left unit law does not hold for lists in scala. Are lists not monads then?

2 Answers
Related