[GHC] #12366: Use TypeOperators for pattern synonyms?
GHC
ghc-devs at haskell.org
Tue Jul 5 18:14:10 UTC 2016
#12366: Use TypeOperators for pattern synonyms?
-------------------------------------+-------------------------------------
Reporter: dubiousjim | Owner:
Type: feature | Status: new
request |
Priority: low | Milestone:
Component: Compiler | Version: 8.0.1
(Parser) |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
With the language setting `-XTypeOperators`, I can use ''varsym''
expressions, like `<|`, as type constructors. I would expect that we would
then also be able to use them as pattern synonyms; but we can't. This is a
request for that to become possible.
{{{#!hs
{-# LANGUAGE TypeOperators, PatternSynonyms #-}
module Main where
pattern (<|) x xs = Just (x, xs)
main = case Just (1, [2,3]) of { Nothing -> putStrLn "Nothing"; y <| ys ->
print y }
}}}
gives a parse error.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12366>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list