ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

collect functions that produce/consume a type #279

Open jwaldmann opened 5 years ago

jwaldmann commented 5 years ago

proposal, see https://mail.haskell.org/pipermail/haskell-cafe/2018-November/130191.html

ndmitchell commented 5 years ago

Yes, this is something I'd like. I envisage something like _ -> T to be produces T, and T -> _ to be consumes T.

jwaldmann commented 5 years ago

The consumer can be _ -> ... -> T -> ... -> _, i.e., there is some nested left context t1 -> (t2 -> ...) that contains a consumer T -> .... But we would get this by currying automatically (hoogle already does this)?

Then one could think of (T, _) -> _, in general, the type T we want is some deep argument of nested type constructors. Generalized, it's about covariant vs. contravariant argument positions ... that's the distinction we are already making for -> ?

I'd be happy with any variant that works.