PapenfussLab / bioshake

Bioinformatics pipelines with Haskell and Shake
ISC License
55 stars 7 forks source link

Docs confusion - bifunctor/profunctor #2

Open locallycompact opened 7 years ago

locallycompact commented 7 years ago

Hi, I was confused at this line:

"The constructor :->, which is used to concatenate successive stages into a pipeline, is isomorphic to (,)."

That would make it a bifunctor, whereas I would expect a pipeline arrow such as this to be an actual Arrow and hence a profunctor, i.e contravariant in the first argument. Should this not be the case? Am I misunderstanding something? Might it be possible to make it explicitly an Arrow to gain access to the Arrow and ArrowChoice combinators?

jbedo commented 7 years ago

The confusion here is that the abstraction is at a higher level than typical. The value of a :-> b is a place holder, the type and its associated typeclass instances are what determines the pipeline, and in fact the pipeline is totally erased during compile time. So it isn't a functor of any kind in the Haskell sense as the value is never used.