-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Right now, we have a function (#) :: a -> (a -> b) -> b such that a # f = f a. It works, but there's been talk of using the (#) as a natural transformation instead (currently in the wakarusa repo). With this, we could define natural transformations such as:
instance Transformation Canvas IO DeviceContext where
(#) = sendHowever, this would not work for things that we currently use the blank-canvas (#) for, such as grd # addColorStop(0, "#8ED6FF") and (defFont [sansSerif]) { fontSize = 30 # pt }. I think the best way to mitigate such a change would be to use the (&) :: a -> (a -> b) -> b function that was introduced in GHC 7.10 in Data.Function (if one is using an older version of GHC, it's easy to redefine it: a & f = f a). There's also a bit of history in that (&) is also used in lens, so it's not a completely arbitrary choice of name.
@andygill, what are your thoughts?