Dear Brandon,
 thanks for that - the echo :browse solution is ideal because I can easily write a short Haskell program
to filter out the type declarations from the output.
In fact it becomes easy to extract other kinds of declarations as well.

Here the offside rule really is my friend.

I'll post a fully worked solution once I build it.

Thanks, Andrew

On 4 May 2017, at 17:22, Brandon Allbery <allbery.b@gmail.com> wrote:

From source you'd be looking at using haskell-src-exts. Alternately:

- echo :browse | ghci foo.hs

- compile it, dump the .hi file (ghc --show-iface foo.hi) likely with postprocessing to only show the types

On Thu, May 4, 2017 at 3:30 AM, Andrew Butterfield <Andrew.Butterfield@scss.tcd.ie> wrote:
Dear Haskellers,
 any quick and easy way to extract all the type declarations from a Haskell source file?
(for easy reference)

Regards,

Andrew Butterfield
School of Computer Science & Statistics
Trinity College
Dublin 2, Ireland

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.



--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Andrew Butterfield
School of Computer Science & Statistics
Trinity College
Dublin 2, Ireland