These are chat archives for broadinstitute/hail
case, we’d need a
def trios = this.trios
reason to use case classes from stack overflow:
Case classes can be seen as plain and immutable data-holding objects that should exclusively depend on their constructor arguments.
This functional concept allows us to
use a compact initialisation syntax
(Node(1, Leaf(2), None)))
decompose them using pattern matching
have equality comparisons implicitly defined
No, case classes do not enforce immutability, but don't expect good behavior from the providd equality and hashing if the fields are mutable. With both classes and case classes take vals by default , you prepend var. For more, see here:
new Pedigree(trios)in the apply. All tests still pass.
scala> Array(1) == Array(1) res0: Boolean = false scala> IndexedSeq(1) == IndexedSeq(1) res1: Boolean = true