
#9732: Pattern synonyms and unboxed values -------------------------------------+------------------------------------- Reporter: monoidal | Owner: cactus Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time crash | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by cactus): The problem with `pattern P = 0#` is that the wrapper it yields is `$WP = 0#` which is a top-level binding at an unboxed type. If `P` had any arguments, then `$WP` would be a function instead of a variable, and so it would be valid. So we could say that unboxed pattern synonyms are only allowed if they are either unidirectional or have arguments. But doesn't that sound a bit arbitrary? Side question: is it even possible to change the definition of `P` to have an argument but still be unboxed? Something like `pattern P x = (# 0#, x #)` doesn't work, because unboxed tuples are not allowed in patterns. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9732#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler