One thing I’ve been trying to figure out is why view acts like this when using mapped in a…
Drew Tipson
1
Good question!
Mapped is just like map so we must always “close up” our type after running some f. This is how we satisfy the functor laws. So if we map(f) over an array, we get an array back. If we map(f) over a Maybe, we get a Maybe back and so on.
So if view shows us some property, but we get there view mapped, it must preserve the types.