Hi! This is regarding `mapN` which internally uses...
# arrow
g
Hi! This is regarding
mapN
which internally uses
product
. The below test passes:
Copy code
@Test
    fun `Left * Right`() {
        val product = Either.applicative<String>().run {
            mapN(
                    "left".left(),
                    "right".right()
            ) {}
        }.fix()
        product.fold({ assertEquals("left", it) }, {})
    }
But this one Fails, as it returns “left2”: 🛑
Copy code
@Test
    fun `Left * Right * Left`() {
        val product = Either.applicative<String>().run {
            mapN(
                    "left1".left(),
                    "right".right(),
                    "left2".left()
            ) {}
        }.fix()
        product.fold({ assertEquals("left1", it) }, {})
    }
My expectation is to get the first
left
instance, but it behaves to be returning the last
left
instance. Is this behavior expected? If Yes, is there any other way I can get first
left
instance? Thanks