Ticket #5911: 0001-Give-TChan-an-Eq-instance.patch

File 0001-Give-TChan-an-Eq-instance.patch, 980 bytes (added by joeyadams, 2 years ago)

Give TChan an Eq instance.

  • Control/Concurrent/STM/TChan.hs

    From 49730cf0354850d43357b231bc07f14534ad01a2 Mon Sep 17 00:00:00 2001
    From: Joey Adams <joeyadams3.14159@gmail.com>
    Date: Fri, 2 Mar 2012 21:05:28 -0500
    Subject: [PATCH 1/4] Give TChan an Eq instance.
    
    TVar, TMVar, TArray, and Chan all have Eq instances.
    Why doesn't TChan have one, too?
    ---
     Control/Concurrent/STM/TChan.hs |    3 ++-
     1 files changed, 2 insertions(+), 1 deletions(-)
    
    diff --git a/Control/Concurrent/STM/TChan.hs b/Control/Concurrent/STM/TChan.hs
    index dbc2eca..33a36c8 100644
    a b import GHC.Conc 
    4343import Data.Typeable (Typeable) 
    4444 
    4545-- | 'TChan' is an abstract type representing an unbounded FIFO channel. 
    46 data TChan a = TChan (TVar (TVarList a)) (TVar (TVarList a)) deriving Typeable 
     46data TChan a = TChan (TVar (TVarList a)) (TVar (TVarList a)) 
     47    deriving (Eq, Typeable) 
    4748 
    4849type TVarList a = TVar (TList a) 
    4950data TList a = TNil | TCons a (TVarList a)