Ticket #2776 (new bug)

Opened 5 years ago

Last modified 9 months ago

Document -pgmL (Use cmd as the literate pre-processor)

Reported by: Syzygies Owned by:
Priority: lowest Milestone: 7.6.2
Component: Documentation Version: 6.10.1
Keywords: pgmL literate Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The GHC option -pgmL (Use cmd as the literate pre-processor) is undocumented, and behaves differently than -pgmF (Use cmd as the pre-processor).

While one can count on the first three arguments to a -pgmF command giving file names, with optional arguments coming later, the last three arguments to a -pgmL command give the file names. An undocumented "-h" argument always comes before these file arguments, throwing off any command designed according to the documentation for -pgmF. Moreover, an optional argument provided using -opL comes before any of these arguments.

The undocumented "-h" reminds me of the passage in Real World Haskell, how only one reasonable program could have type "(a, b) -> a", because there isn't enough information to do anything clever. Here, GHC wants the -pgmL command to emit standard Haskell, but for all it knows, the literate program is in Swahili. GHC isn't really in a good position to be offering advice via options on this conversion, because it has no idea what conversion is taking place. So the "-h" is inexplicable.

Also, the example command in GHC manual section 5.10.4. doesn't use argument $1, and probably wants to use $1 rather than $2 for the echo, if in fact it is possible to create circumstance where $1 and $2 differ.

Attachments

dedent.hs Download (0.7 KB) - added by Syzygies 5 years ago.
Example pre-processor that conforms to observed ghc behavior
dedent.lhs Download (1.3 KB) - added by Syzygies 5 years ago.
Literate version of example pre-processor, requires dedent.hs once to bootstrap
test.sh Download (23 bytes) - added by Syzygies 5 years ago.
Test pre-processor to examine arguments passed by ghc

Change History

Changed 5 years ago by Syzygies

Example pre-processor that conforms to observed ghc behavior

Changed 5 years ago by Syzygies

Literate version of example pre-processor, requires dedent.hs once to bootstrap

Changed 5 years ago by Syzygies

Test pre-processor to examine arguments passed by ghc

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12 branch

Changed 3 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 3 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 2 years ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 2 years ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 21 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 16 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1

Changed 9 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2
Note: See TracTickets for help on using tickets.