Hoogle

hoogle-5.0.13: Haskell API Search

Safe Haskell | None
Language | Haskell2010

Hoogle

Description

High level Hoogle API

Synopsis

- data Database
- withDatabase :: NFData a => FilePath -> (Database -> IO a) -> IO a
- searchDatabase :: Database -> String -> [Target]
- defaultDatabaseLocation :: IO FilePath
- data Target = Target {
  - targetURL :: URL
  - targetPackage :: Maybe (String, URL)
  - targetModule :: Maybe (String, URL)
  - targetType :: String
  - targetItem :: String
  - targetDocs :: String
  }
- type URL = String
- hoogle :: [String] -> IO ()
- targetInfo :: Target -> String
- targetResultDisplay :: Bool -> Target -> String

# Documentation

data Database #

Database containing Hoogle search data.

withDatabase :: NFData a => FilePath -> (Database -> IO a) -> IO a #

Load a database from a file.

searchDatabase :: Database -> String -> [Target] #

Search a database, given a query string, produces a list of results.

defaultDatabaseLocation :: IO FilePath #

The default location of a database

data Target #

A location of documentation.

Constructors

Target |
Fields targetURL :: URL URL where this thing is located targetPackage :: Maybe (String, URL) Name and URL of the package it is in (Nothing if it is a package) targetModule :: Maybe (String, URL) Name and URL of the module it is in (Nothing if it is a package or module) targetType :: String One of package, module or empty string targetItem :: String HTML span of the item, using 0 for the name and 1 onwards for arguments targetDocs :: String HTML documentation to show, a sequence of block level elements

Instances

Eq Target # |
Methods (==) :: Target -> Target -> Bool # (/=) :: Target -> Target -> Bool #
Ord Target # |
Methods compare :: Target -> Target -> Ordering # (<) :: Target -> Target -> Bool # (<=) :: Target -> Target -> Bool # (>) :: Target -> Target -> Bool # (>=) :: Target -> Target -> Bool # max :: Target -> Target -> Target # min :: Target -> Target -> Target #
Show Target # |
Methods showsPrec :: Int -> Target -> ShowS # show :: Target -> String # showList :: [Target] -> ShowS #
ToJSON Target # |
Methods toJSON :: Target -> Value # toEncoding :: Target -> Encoding # toJSONList :: [Target] -> Value # toEncodingList :: [Target] -> Encoding #
NFData Target # |
Methods rnf :: Target -> () #

type URL = String #

A URL, complete with a `https:` prefix.

hoogle :: [String] -> IO () #

Run a command line Hoogle operation.

targetInfo :: Target -> String #

Returns the details printed out when hoogle --info is called

targetResultDisplay :: Bool -> Target -> String #

Returns the Target formatted as an item to display in the results | Bool argument decides whether links are shown