5

Why some functions are not visible in Hoogle? Example: ppTopElement

ppTopElement :: Element -> String
        -- Defined in `Text.XML.Light.Output'

Is it a bug?

Rumca
  • 1,809
  • 12
  • 17
  • 1
    Your search doesn't have it, but [ppTopElement +xml](http://www.haskell.org/hoogle/?hoogle=ppTopElement+%2Bxml) does have it. – Daniel Wagner Feb 22 '14 at 19:33

2 Answers2

8

Workaround: go to FPcomplete instead.

haskell.org's Hoogle (http://www.haskell.org/hoogle/) is quite selective about what it searches, whereas FP Complete's hoogle at https://www.fpcomplete.com/hoogle searches more fully:

Search more widely than haskell.org's hoogle

https://www.fpcomplete.com/hoogle?q=ppTopElement&env=ghc-7.4.2-stable-13.09

Searched for: ppTopElement

ppTopElement :: Element -> String
xml Text.XML.Light.Output

Pretty printing renders XML documents faithfully, with the exception that whitespace may be added/removed in non-verbatim character data.

Search more flexibly than hayoo

Being a hoogle rather than a hayoo, you can search by type, partial type, partial name, misordered type etc. For instance, searching for Element -> String gives lots of functions, some showing, some pretty printing, some just doing the top element.

Aside: there's a lovely online IDE

BTW, Their online IDE is superb (click on the homepage https://www.fpcomplete.com/ and scroll down to Start a Project). It's slick, pretty, and you can add dependencies easily without tedious cabal install problems. I've been tempted to even use it at home where I have ghc installed!

AndrewC
  • 32,300
  • 7
  • 79
  • 115
  • 2
    I feel this starts to read like an ad, but I've been delighted with it since I started using it recently, and I'm not affiliated in any way other than having an account with them. – AndrewC Feb 22 '14 at 15:28
  • Well, initially I thought you were an FP Complete employee. :-) – Sibi Feb 22 '14 at 15:29
  • @Sibi It's slightly upsetting when I was rereading it to realise that when I'm enthusiastic it sounds like a sales pitch. (That's why I added the comment.) Perhaps I missed my calling as a salesman! (I'm a teacher.) – AndrewC Feb 22 '14 at 15:35
2

You may want to try Hayoo for that.

Hayoo will search all packages from Hackage, including all function and type definitions. Hoogle only searches on standard Haskell libraries.

Also Hayoo can be queried from Emacs in haskell-mode.

Sibi
  • 47,472
  • 16
  • 95
  • 163