Ticket #3916 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

incorrect kind inference in template haskell

Reported by: nicolas.frisby Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 6.12.1
Keywords: kinds Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Incorrect result at runtime Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

It looks like a foldl needs to be changed to a foldr somewhere in the code that translates results from GHC's kind inference to the Template Haskell Kind data type.

Given this data declaration:

data F f a = F (f a a a a) 

the kind ascribed to f, as provided in the Info data structure resultant of reifying F, is

(((* -> *) -> *) -> *) -> *

Attachments

TH.hs Download (0.5 KB) - added by nicolas.frisby 3 years ago.
The splice for printing the TH kinds
Bug.hs Download (109 bytes) - added by nicolas.frisby 3 years ago.
Demonstration of the bug
th-kind-workaround-0.0.0.20100311.tar.gz Download (1.1 KB) - added by nicolas.frisby 3 years ago.
package for working-around the problem

Change History

Changed 3 years ago by nicolas.frisby

The splice for printing the TH kinds

Changed 3 years ago by nicolas.frisby

Demonstration of the bug

Changed 3 years ago by nicolas.frisby

package for working-around the problem

Changed 3 years ago by simonpj

  • status changed from new to closed
  • resolution set to fixed

Thanks for a fine report! Fixed by the same patch that fixed #3920.

Simon

Note: See TracTickets for help on using tickets.