Skip to content

Core lint error with PatternSynonyms and undefined

I've submitted quite a few Core Lint errors lately, I don't have access to GHC HEAD so ignore this ticket if this has already been resolved

{-# Options_GHC -dcore-lint #-}

{-# Language ViewPatterns, PatternSynonyms #-}

import Data.Bifunctor.Fix
import Data.Bifunctor.Tannen

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 

works fine without -dcore-lint but fails with it.

Works fine if undefined -> (a, as) is replaced with let x = x in x -> (a, as).

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information