-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Difficulty: Advanced, requires familiarity with the concept of algebraic laws and testing them
Traversable currently doesn't have any laws (only inherits those from Covariant). Figure out which laws should ZIO Prelude's Traversable abide. Then write those tests down in Traversable.laws. Add tests for the missing instances in TraversableSpec (tests for some basic instances, like Option or List are already present).
As an inspiration, have a look Cats or ScalaZ or Haskell Travers/able and their laws:
https://github.com/typelevel/cats/blob/master/laws/src/main/scala/cats/laws/TraverseLaws.scala#L9
https://github.com/scalaz/scalaz/blob/master/core/src/main/scala/scalaz/Traverse.scala#L162
https://hackage.haskell.org/package/base-4.14.0.0/docs/Data-Traversable.html#t:Traversable