summaryrefslogtreecommitdiff
path: root/compiler/basicTypes
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2012-01-08 16:33:51 -0800
committerIavor S. Diatchki <iavor.diatchki@gmail.com>2012-01-08 16:33:51 -0800
commit85926ae6c63a62e4f23423f220588875c8f1ab45 (patch)
tree355214cdf8344e0264da05516347930394128282 /compiler/basicTypes
parentf784eb7585901e2297d504dcf777ebc58d60aaa5 (diff)
downloadhaskell-85926ae6c63a62e4f23423f220588875c8f1ab45.tar.gz
Change -XTypeOperators to treat all type-operators as type-constructors.
Previously, only type operators starting with ":" were type constructors, and writing "+" in a type resulted in a type variable. Now, type variables are always ordinary identifiers, and all operators are treated as constructors. One can still write type variables in infix form though, for example, "a `fun` b" is a type expression with 3 type variables: "a", "fun", and "b". Writing (+) in an import/export list always refers to the value (+) and not the type. To refer to the type one can write either "type (+)", or provide an explicit suobrdinate list (e.g., "(+)()"). For clarity, one can also combine the two, for example "type (+)(A,B,C)" is also accepted and means the same thing as "(+)(A,B,C)" (i.e., export the type (+), with the constructors A,B,and C).
Diffstat (limited to 'compiler/basicTypes')
-rw-r--r--compiler/basicTypes/OccName.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/basicTypes/OccName.lhs b/compiler/basicTypes/OccName.lhs
index ff1f71dc5c..e160d4ece9 100644
--- a/compiler/basicTypes/OccName.lhs
+++ b/compiler/basicTypes/OccName.lhs
@@ -492,7 +492,7 @@ isDataSymOcc _ = False
-- it is a data constructor or variable or whatever)
isSymOcc :: OccName -> Bool
isSymOcc (OccName DataName s) = isLexConSym s
-isSymOcc (OccName TcClsName s) = isLexConSym s
+isSymOcc (OccName TcClsName s) = isLexConSym s || isLexVarSym s
isSymOcc (OccName VarName s) = isLexSym s
isSymOcc (OccName TvName s) = isLexSym s
-- Pretty inefficient!