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>
Are there any code examples left?
New code examples in category Scala
-
Scala 2022-02-22 13:40:10 scala length of string
-
Scala 2022-02-15 01:00:25 scala get file from url as string
-
Scala 2022-01-31 13:41:22 comments in scala
-
Scala 2022-01-30 20:36:46 scala set contains all
-
Scala 2022-01-30 17:46:32 scala get the first element of a seq
-
Scala 2021-11-22 08:48:22 scala predicate
-
Scala 2021-11-19 20:09:21 scalar matrix
-
Scala 2021-11-16 07:19:22 scala read input
-
Scala 2021-11-15 06:42:25 scala jrtpath
-
Scala 2021-11-10 10:13:04 scala iterator foreach