summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2019-06-22 18:25:58 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-27 10:43:10 -0400
commitc1f67887e3d85e6bfd09744fbea976e1f3e16c02 (patch)
treee60b0bcc741ab2e5d3a5d9e487867ec087fdff5f
parent07cffc49d031df71702be3bf9006e0ad006414e2 (diff)
downloadhaskell-c1f67887e3d85e6bfd09744fbea976e1f3e16c02.tar.gz
Improve doc for :type-at. (#14780)
-rw-r--r--docs/users_guide/ghci.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst
index 22643be228..9677f8a938 100644
--- a/docs/users_guide/ghci.rst
+++ b/docs/users_guide/ghci.rst
@@ -2937,7 +2937,7 @@ commonly used commands.
*X> :type +d length
length :: [a] -> Int
-.. ghci-cmd:: :type-at; ⟨module⟩ ⟨line⟩ ⟨col⟩ ⟨end-line⟩ ⟨end-col⟩ [⟨name⟩]
+.. ghci-cmd:: :type-at; ⟨path⟩ ⟨line⟩ ⟨col⟩ ⟨end-line⟩ ⟨end-col⟩ [⟨name⟩]
Reports the inferred type at the given span/position in the module, e.g.:
@@ -2949,6 +2949,13 @@ commonly used commands.
This command is useful when integrating GHCi with text editors and
IDEs for providing a show-type-under-point facility.
+ The first parameter (path) must be a file path and not a module name.
+ The type of this path is dependent on how the module was loaded into GHCi:
+ If the module was loaded by name, then the path name calculated by GHCi
+ as described in :ref:`ghci-modules-filenames` must be used.
+ If the module was loaded with an absolute or a relative path,
+ then the same path must be specified.
+
The last string parameter is useful for when the span is out of
date, i.e. the file changed and the code has moved. In which case
:ghci-cmd:`:type-at` falls back to a general :ghci-cmd:`:type` like lookup.