All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalaz.example.CaseInsensitiveUsage.scala Maven / Gradle / Ivy

package scalaz.example

import scalaz.{CaseInsensitive => CI}

object CaseInsensitiveUsage extends App {

  def maps() {
    val nums: Map[CI[String], Int] = Map(CI("ONE") -> 1, CI("Two") -> 2)
  
    assert(nums(CI("one")) == 1)
    assert(nums(CI("TWO")) == 2)
  }
  
  def sets() {
    val nums: Set[CI[String]] = Set(CI("ONE"), CI("Two"))
    
    assert(nums(CI("one")))
    assert(nums(CI("TWO")))
  }

  maps()
  sets()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy