On Tue, Sep 7, 2010 at 2:15 AM, Bas van Dijk <[email protected]> wrote:
> They do allow some
now finishing my sentence...
The parameterization of α and β in Readable and Writable do allow some
nice instances like:
instance Readable (TMVar α) STM (Maybe α) where
read = TMVar.tryTakeTMVar
instance Writable (TMVar α) α STM Bool where
write = TMVar.tryPutTMVar
instance Writable (Chan α) (End α) IO () where
write t = Chan.unGetChan t ∘ unEnd
-- | Writing @End x@ to a 'Chan' or 'TChan' writes @x@ to the end of the channel
-- instead of to the front. Also see 'unGetChan' and 'unGetTChan'.
newtype End α = End {unEnd ∷ α}
Regards,
Bas
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell