DEV Community

Discussion on: I can't understand the twiceOptional function from Data61 fp course.

Collapse
 
jvanbruegge profile image
Jan van Brügge
  1. You are wrong about the partial application, it is like this (note the parenthesis):
twiceOptional (+) (Full 1) (Full 2) = (applyOptional . mapOptional (+)) (Full 1) (Full 2)
  1. Because when bindOptional encounters an Empty it does not evaluate further and just returns Empty