func = if x
  then if y -- y is important
    then foo
    else bar
  else Nothing