]]>
users-guide: Standardize and repair all flag referencesPatrick Dougherty <patrick.doc@ameritech.net>Sun, 23 Jul 2017 16:55:37 +0000https://git.haskell.org/ghc.git/commitdiff/44b090be9a6d0165e2281542a7c713da1799e885https://git.haskell.org/ghc.git/commitdiff/44b090be9a6d0165e2281542a7c713da1799e885
users-guide: Standardize and repair all flag references
users-guide: Standardize and repair all flag references
This patch does three things:
1.) It simplifies the flag parsing code in `conf.py` to properly display
flag definitions created by `.. (ghc|rts)-flag::`. Additionally, all flag
references must include the associated arguments. Documentation has been
added to `editing-guide.rst` to explain this.
2.) It normalizes all flag definitions to a similar format. Notably, all
instances of `<>` have been replaced with `⟨⟩`. All references across the
users guide have been updated to match.
3.) It fixes a couple issues with the flag reference table's generation code,
which did not handle comma separated flags in the same cell and did not
properly reference flags with arguments.
Test Plan:
`SPHINXOPTS = -n` to activate "nitpicky" mode, which reports all broken
references. All remaining errors are references to flags without any
documentation.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13980
Differential Revision: https://phabricator.haskell.org/D3778

]]>
Show valid substitutions for typed holesMatthías Páll Gissurarson <mpg@mpg.is>Wed, 29 Mar 2017 21:30:28 +0000https://git.haskell.org/ghc.git/commitdiff/26c95f46e679fb73e1ec2bec2be0801c72fd1449https://git.haskell.org/ghc.git/commitdiff/26c95f46e679fb73e1ec2bec2be0801c72fd1449
Show valid substitutions for typed holes
Show valid substitutions for typed holes
The idea is to implement a mechanism similar to PureScript, where they
suggest which identifiers in scope would fit the given hole. In
PureScript, they use subsumption (which is what we would like here as
well). For subsumption, we would have to check each type in scope
whether the hole is a subtype of the given type, but that would require
`tcSubType` and constraint satisfiability checking. Currently,
`TcSimplify` uses a lot of functions from `TcErrors`, so that would
require more of a rewrite, I will hold on with that for now, and submit
the more simpler type equality version.
As an example, consider
```
ps :: String -> IO ()
ps = putStrLn
ps2 :: a -> IO ()
ps2 _ = putStrLn "hello, world"
main :: IO ()
main = _ "hello, world"
```
The results would be something like
```
• Found hole: _ :: [Char] -> IO ()
• In the expression: _
In a stmt of a 'do' block: _ "hello, world"
In the expression:
do _ "hello, world"
• Relevant bindings include
main :: IO () (bound at test.hs:13:1)
ps :: String -> IO () (bound at test.hs:7:1)
ps2 :: forall a. a -> IO () (bound at test.hs:10:1)
Valid substitutions include
putStrLn :: String
-> IO () (imported from ‘Prelude’ at
test.hs:1:1-14
(and originally defined in
‘System.IO’))
putStr :: String
-> IO () (imported from ‘Prelude’ at
test.hs:1:1-14
(and originally defined in ‘System.IO’))
```
We'd like here for ps2 to be suggested as well, but for that we require
subsumption.
Reviewers: austin, bgamari, dfeuer, mpickering
Reviewed By: dfeuer, mpickering
Subscribers: mpickering, Wizek, dfeuer, rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3361

]]>
Ensure mkUserGuidePart is compiled with current GHC versionBen Gamari <ben@smart-cactus.org>Sat, 7 Jan 2017 14:59:56 +0000https://git.haskell.org/ghc.git/commitdiff/fe75d2d4db44cee72d505bba24bd44c1a2a75613https://git.haskell.org/ghc.git/commitdiff/fe75d2d4db44cee72d505bba24bd44c1a2a75613
Ensure mkUserGuidePart is compiled with current GHC version
Ensure mkUserGuidePart is compiled with current GHC version