Skip to content

Commit 09b7f10

Browse files
committed
deploy: 7aaa4b4
1 parent 16b300e commit 09b7f10

8 files changed

Lines changed: 243 additions & 144 deletions

File tree

api/errors.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

messages/GHC-39999/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ <h2 id="error-message">Error message</h2>
287287
| ^</code></pre>
288288
<h2 id="explanation">Explanation</h2>
289289
<p>Sometimes, when GHC encounters a type error, it suggests solving
290-
it from an unexpected end. In this case, when it encouters a literal
290+
it from an unexpected end. In this case, when it encounters a literal
291291
instead of a list, it does not just complain about it. Instead it suspects
292292
that maybe an author meant to overload numeric literals so that they can mean lists too.</p>
293293
<p>Every time you write a numeric literal in Haskell,

messages/GHC-39999/overloaded-number/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h2 id="error-message">Error message</h2>
99
| ^</code></pre>
1010
<h2 id="explanation">Explanation</h2>
1111
<p>Sometimes, when GHC encounters a type error, it suggests solving
12-
it from an unexpected end. In this case, when it encouters a literal
12+
it from an unexpected end. In this case, when it encounters a literal
1313
instead of a list, it does not just complain about it. Instead it suspects
1414
that maybe an author meant to overload numeric literals so that they can mean lists too.</p>
1515
<p>Every time you write a numeric literal in Haskell,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{-# LANGUAGE CApiFFI #-}
2+
3+
module CAPI where
4+
5+
import Foreign.C
6+
7+
foreign import capi "setenv"
8+
c_setenv :: CString -> CString -> CInt -> IO CInt
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module CAPI where
2+
3+
import Foreign.C
4+
5+
foreign import capi "setenv"
6+
c_setenv :: CString -> CString -> CInt -> IO CInt
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<p>In this example the user attempted to use <code>capi</code> calling convention for foreign imports without enabling the <code>CApiFFI</code> extension, which leads to this generic parsing error.</p>
2+
<pre><code>CAPI.hs:5:16: error: [GHC-58481]
3+
parse error on input ‘capi’
4+
|
5+
5 | foreign import capi &quot;setenv&quot;
6+
| ^^^^</code></pre>
7+
8+
<pre class="filename">CAPI.hs</pre>
9+
<div class="example-container">
10+
<div class="example">
11+
<div class="example-inner">
12+
<div class="example-title">Before</div>
13+
<!-- keep next line as is, i.e., on one line, or the code will not format properly -->
14+
<pre class="example-pre"><code class="language-haskell">module CAPI where
15+
16+
import Foreign.C
17+
18+
foreign import capi "setenv"
19+
c_setenv :: CString -> CString -> CInt -> IO CInt
20+
</code></pre>
21+
</div>
22+
</div>
23+
<div class="example">
24+
<div class="example-inner">
25+
<div class="example-title">After</div>
26+
<!-- keep next line as is, i.e., on one line, or the code will not format propertly -->
27+
<pre class="example-pre"><code class="language-haskell">{-# LANGUAGE CApiFFI #-}
28+
29+
module CAPI where
30+
31+
import Foreign.C
32+
33+
foreign import capi "setenv"
34+
c_setenv :: CString -> CString -> CInt -> IO CInt
35+
</code></pre>
36+
</div>
37+
</div>
38+
</div>
39+

messages/GHC-58481/index.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,52 @@ <h2 id="error-message">Error Message</h2>
281281
</div>
282282
</details>
283283

284+
<details open="open">
285+
<summary>Use of `capi` calling convention</summary>
286+
<div class="details-inner">
287+
<p>In this example the user attempted to use <code>capi</code> calling convention for foreign imports without enabling the <code>CApiFFI</code> extension, which leads to this generic parsing error.</p>
288+
<pre><code>CAPI.hs:5:16: error: [GHC-58481]
289+
parse error on input ‘capi’
290+
|
291+
5 | foreign import capi &quot;setenv&quot;
292+
| ^^^^</code></pre>
293+
294+
<pre class="filename">CAPI.hs</pre>
295+
<div class="example-container">
296+
<div class="example">
297+
<div class="example-inner">
298+
<div class="example-title">Before</div>
299+
<!-- keep next line as is, i.e., on one line, or the code will not format properly -->
300+
<pre class="example-pre"><code class="language-haskell">module CAPI where
301+
302+
import Foreign.C
303+
304+
foreign import capi "setenv"
305+
c_setenv :: CString -> CString -> CInt -> IO CInt
306+
</code></pre>
307+
</div>
308+
</div>
309+
<div class="example">
310+
<div class="example-inner">
311+
<div class="example-title">After</div>
312+
<!-- keep next line as is, i.e., on one line, or the code will not format propertly -->
313+
<pre class="example-pre"><code class="language-haskell">{-# LANGUAGE CApiFFI #-}
314+
315+
module CAPI where
316+
317+
import Foreign.C
318+
319+
foreign import capi "setenv"
320+
c_setenv :: CString -> CString -> CInt -> IO CInt
321+
</code></pre>
322+
</div>
323+
</div>
324+
</div>
325+
326+
327+
</div>
328+
</details>
329+
284330

285331

286332
</main>

0 commit comments

Comments
 (0)