What kind of morphism is `filter` in category theory?
问题 In category theory, is the filter operation considered a morphism? If yes, what kind of morphism is it? Example (in Scala) val myNums: Seq[Int] = Seq(-1, 3, -4, 2) myNums.filter(_ > 0) // Seq[Int] = List(3, 2) // result = subset, same type myNums.filter(_ > -99) // Seq[Int] = List(-1, 3, -4, 2) // result = identical than original myNums.filter(_ > 99) // Seq[Int] = List() // result = empty, same type 回答1: To answer are question like this, I'd like to first understand what is the essence of