Difference between revisions of "Hoogle/Tutorial"

From HaskellWiki
Jump to navigation Jump to search
m
 
Line 11: Line 11:
 
== The results in order ==
 
== The results in order ==
   
The API search tries to find as many results as it can. For name searchs, an exact substring of the name must match (so ap would match map). For type searches, anything that will unify is returned. In addition, arguments can be reordered - i.e. <code>[a] -> (a -> b) -> [b]</code> will still match <code>map</code>.
+
The API search tries to find as many results as it can. For name searches, an exact substring of the name must match (so 'ap' would match 'map'). For type searches, anything that will unify is returned. In addition, arguments can be reordered - i.e. <code>[a] -> (a -> b) -> [b]</code> will still match <code>map</code>.
   
 
Because lots of results may be returned, they are sorted in order of usefulness. Those which are closer to the asked for information are given higher priority, those which are further are given lower priority.
 
Because lots of results may be returned, they are sorted in order of usefulness. Those which are closer to the asked for information are given higher priority, those which are further are given lower priority.

Latest revision as of 15:54, 15 February 2007

Your first search

The Haskell API Search can search for either names, or types. For example, to find the standard map :: (a -> b) -> [a] -> [b] function you could search for:

map
(a -> b) -> [a] -> [b]
(a -> a) -> [a] -> [a]
(Int -> Bool) -> [Int] -> [Bool]
[a] -> (a -> b) -> [b]

The results in order

The API search tries to find as many results as it can. For name searches, an exact substring of the name must match (so 'ap' would match 'map'). For type searches, anything that will unify is returned. In addition, arguments can be reordered - i.e. [a] -> (a -> b) -> [b] will still match map.

Because lots of results may be returned, they are sorted in order of usefulness. Those which are closer to the asked for information are given higher priority, those which are further are given lower priority.

Further Information

After you have found the function, you can click on it to view details. The information comes from GHC's documentation.