1
1
mirror of https://github.com/google/ormolu.git synced 2025-01-08 16:19:40 +03:00
ormolu/data/examples/declaration/signature/specialize/specialize-instance.hs
2019-06-23 20:16:53 +02:00

12 lines
368 B
Haskell

data Foo a = Foo a
data VT v m r = VT v m r
instance (Eq a) => Eq (Foo a) where
{-# SPECIALIZE instance Eq (Foo [(Int, Bar)]) #-}
(==) (Foo a) (Foo b) = (==) a b
instance (Num r, V.Vector v r, Factored m r) => Num (VT v m r) where
{-# SPECIALIZE instance (
Factored m Int => Num (VT U.Vector m Int)) #-}
VT x + VT y = VT $ V.zipWith (+) x y