progs/lecture3.scala
changeset 335 7e00d2b13b04
parent 325 ca9c1cf929fa
child 343 c8fcc0e0a57f
--- a/progs/lecture3.scala	Thu Apr 23 14:49:54 2020 +0100
+++ b/progs/lecture3.scala	Wed Aug 12 00:56:20 2020 +0100
@@ -403,3 +403,16 @@
 
 
 
+
+
+
+
+//************
+// Either
+val either1 : Either[Exception,Int] = Right(1)
+val either2: Either[Exception, Int] = Right(2)
+
+for{
+  one <- either1
+  two <- either2
+} yield one + two