Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SCALA

Category Theory laws in scala

scala> :pastesealed trait Breakfast {}case object Eggs extends Breakfast {}case object Oatmeal extends Breakfast {}case object Toast extends Breakfast {}case object Coffee extends Breakfast {}val favoriteBreakfast: Person => Breakfast = {  case John => Eggs  case Mary => Coffee  case Sam  => Coffee}// Exiting paste mode, now interpreting.favoriteBreakfast: Person => Breakfast = <function1>
Source by eed3si9n.com #
 
PREVIOUS NEXT
Tagged: #Category #Theory #laws #scala
ADD COMMENT
Topic
Name
2+3 =