[Haskell-cafe] Where does ~> come from?

Cale Gibbard cgibbard at gmail.com
Sun Feb 17 01:21:14 EST 2008


On 17/02/2008, Steve Lihn <stevelihn at gmail.com> wrote:
> While I am reading TypeCompose module, I am having trouble finding
> where ~> comes from? (And its son ~~> and grandson ~~~>, etc.)  This
> is my immediate question. Help is appreciated.

(~>) is typically an infix type variable. If it were a constructor, it
would have to start with a colon. So it doesn't have a definition as
such, you can think of it as any type constructor with at least two
type parameters.

I think that would explain why you were having such trouble searching for it!

Generally, though, if you want to know where something is defined, you
can use ghci's :info command, and it should tell you the file and line
in which it's defined, as well as its type (if it's a value) and its
fixity (if it's an infix operator).

You can then load up whatever documentation or source code is
available for that module.  Of course, in this case, it would report
(correctly) that (~>) is not in scope.

Usually, packages on Hackage have whatever documentation is available
linked directly from their pages on Hackage.

hope this helps!
 - Cale


More information about the Haskell-Cafe mailing list