[GHC] #13671: Core lint error with PatternSynonyms and undefined

GHC ghc-devs at haskell.org
Tue May 9 16:35:33 UTC 2017


#13671: Core lint error with PatternSynonyms and undefined
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:  worksforme        |             Keywords:
                                     |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 I don't know precisely which `Data.Bifunctor.Fix` etc you mean, but I
 tried this
 {{{
 {-# Options_GHC -dcore-lint #-}
 {-# Language ViewPatterns, PatternSynonyms #-}

 module T13671 where


 newtype ZipList a = ZL { getZipList :: Fix (Tannen Maybe (,)) a }

 pattern Nil :: ZipList a
 pattern Nil = ZL (In (Tannen Nothing))

 infixr 5 :::
 pattern (:::) :: a -> ZipList a -> ZipList a
 pattern a:::as <- ZL (In (Tannen (undefined -> (a, as))))
   where a:::as = undefined

 newtype Tannen f p a b = Tannen { runTannen :: f (p a b) }
 newtype Fix p a = In { out :: p (Fix p a) a }
 }}}
 That compiles fine with `-dcore-lint`.  So I'll close.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13671#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list