Skip to content

Core lint error with defer-typed-holes

Another Core Lint error

{-# Options_GHC -dcore-lint -fdefer-typed-holes #-}

{-# Language ViewPatterns, PatternSynonyms, GeneralizedNewtypeDeriving, DeriveTraversable #-}

import Data.Bifunctor.Fix
import Data.Bifunctor.Tannen
import Test.QuickCheck
import Test.QuickCheck.Function
import Control.Applicative

newtype ZL a = ZL { getZL :: Fix (Tannen Maybe (,)) a }
  deriving (Eq, Ord, Read, Show, Functor, Applicative, Foldable, Traversable)

fromList :: [a] -> ZL a
fromList []     = Nil
fromList (x:xs) = x:::fromList xs

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

foo :: ZL a -> Maybe (a, ZL a)
foo (ZL (In (Tannen (Just (as, a))))) = Just (a, ZL as)

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

u (Fn f) as bs = let
  (xs, ys) = (ZipList as, ZipList bs)

  in getZipList (liftA2 f xs ys) == toList (liftA2 f (fromList as) (fromList bs))

unfortunately I don't have time to reduce it

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