|
|
|
|
|
by kmill
2419 days ago
|
|
a1369209993 was answering my "I don't think [natural transformations from the identity functor] always exist" with "no, they don't." The natural transformation would be a function "a -> Const q a" for all a. There can't be a way to do this for all q that is somehow natural in q, since this would have to construct a value of q to put into the Const constructor. Worse, (even though vanilla Haskell doesn't allow it), q might be the empty type, so there might be no functions "a -> Const q a" whatsoever. I think the point of the example is that keeping q polymorphic is a simulation of the empty type. Allowing empty types, I'm happy with the example. However, this is technically a natural transformation in Haskell: f :: a -> Const q a
f x = Const undefined x
since every type contains bottom (undefined). |
|