ekmett / profunctors

Haskell 98 Profunctors
http://hackage.haskell.org/package/profunctors
Other
70 stars 43 forks source link

Generalised {Co,}Star #73

Closed rjmk closed 3 years ago

rjmk commented 5 years ago

An alternative definition of Star would be newtype Star p f a b = Star { runStar :: a `p` f b }. The old definition is recovered by Star (->).

Are there downsides to doing this? Perhaps one is that Star is meant to reference something from the Cat Theory literature? But perhaps the generalized type could still exist under some other name?

ekmett commented 3 years ago

Right now something isomorphic to this can be reached by using Procompose with Star f and p.

I'm somewhat leery of changing something as foundational as Star, and it doesn't get any instances over the Procompose version as far as I can tell.

Adding a Prostar and Procostar might be viable.