This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Algebraic data type (ADT) | |
2. Recursive types | |
3. Parametric Polymorphism in ADT | |
4. Function and Curring | |
5. All about making things lazy | |
6. Typeclasses to add features on our data structure | |
7. Extending with syntax and operators | |
8. Optimization and analysis of implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object OddNumScala2 { | |
sealed trait Num | |
object Num { | |
case object Zero extends Num | |
case class Succ[N <: Num](num: N) extends Num | |
} | |
@implicitNotFound("Odd number type not satisfied.") | |
trait OddNum[N <: Num] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object DummyFile: | |
case class File( `type`:File.Type, content:String) | |
object File: | |
enum Type: | |
case TEXT, PRESENTATION, AUDIO, VIDEO, UNKNOWN | |
end File | |
end DummyFile |
OlderNewer