Given a List , I would like to filter out any elements that are equal to Unit - () .
Is there a better filtering method than through this code?
scala> List( () ).filter( x => x != () ) <console>:8: warning: comparing values of types Unit and Unit using `!=' will always yield false List( () ).filter( x => x != () ) ^ res10: List[Unit] = List()
source share