toraritte
toraritte

Reputation: 8243

How to find a Haskell function based on its type signature?

For example, I haven't used Haskell in a while, and forgot the name of the const function, but remembered that its type signature is a -> b -> a.

Upvotes: 5

Views: 504

Answers (1)

toraritte
toraritte

Reputation: 8243

Use Hoogle or Stackage. (See also related Stackoverflow answer.)

As far as I know, Stackage uses Hoogle underneath, but one may find its representation easier to read.

Just type any type signature that would be acceptable by Haskell, and browse the results.

Upvotes: 11

Related Questions