unexpected parsing error, "in" is treated as reserved word in type class constraints
I'm amidst writing a nice ffi binding to BLAS for ghc 7.6 and newer, and I hit an bizarre parser error when i had the follwoing type for a function transpose
transposeMatrix :: (in ~ (Transpose out) , out ~ (Transpose in) ) => Matrix in elem -> Matrix out elem
transposeMatrix (RowMajorMatrix x y stride arr)= (ColMajorMatrix x y stride arr)
transposeMatrix (ColMajorMatrix x y stride arr) =(RowMajorMatrix x y stride arr)
src/Numerical/OpenBLAS/MatrixTypes.hs:83:21:
parse error on input ‛in’
Failed, modules loaded: none.
i hit this error in GHC head I built this week AND with ghc 7.6
i'm pretty sure "in" shouldn't be a reserved word in types! If i rename "in" to "inor" the parser error goes away.
if this is valid behavior, it'd be hepful to get a more precise parser error like "encountered reserved word "in", expected a variable"
attaching the full module for your pleasure
thanks!
Trac metadata
Trac field | Value |
---|---|
Version | 7.7 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Parser) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |