progs/lecture3.scala
changeset 335 7e00d2b13b04
parent 325 ca9c1cf929fa
child 343 c8fcc0e0a57f
equal deleted inserted replaced
334:841727e27252 335:7e00d2b13b04
   401 
   401 
   402 
   402 
   403 
   403 
   404 
   404 
   405 
   405 
       
   406 
       
   407 
       
   408 
       
   409 
       
   410 //************
       
   411 // Either
       
   412 val either1 : Either[Exception,Int] = Right(1)
       
   413 val either2: Either[Exception, Int] = Right(2)
       
   414 
       
   415 for{
       
   416   one <- either1
       
   417   two <- either2
       
   418 } yield one + two