T14732.hs 892 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS_GHC -fdefer-type-errors -O #-}
-- Oddly this bug was only triggered with -fdefer-type-errors
-- The -O ensures that the RULE is processed

module T14732 where

import Prelude hiding (zip, zipWith)

zipWith :: (a -> b -> c)
        -> Bundle v a
        -> Bundle v b
        -> Bundle v c
zipWith = undefined

class GVector (v :: * -> *) a
instance GVector Vector a

data Bundle (v :: * -> *) a
data Vector a
class Unbox a

stream :: GVector v a => v a -> Bundle v a
{-# INLINE [1] stream #-}
stream = undefined

zip :: (Unbox a, Unbox b) => Vector a -> Vector b -> Vector (a, b)
{-# INLINE [1] zip #-}
zip = undefined
{-# RULES "stream/zip [Vector.Unboxed]" forall as bs .
  stream (zip as bs) = zipWith (,) (stream as)
                                   (stream bs)   #-}