Ticket #1108 (closed defect: fixed)
Add Eq instances for all of Graphics.UI.Gtk.Gdk.Enums
| Reported by: | guest | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | general (Gtk+, Glib) | Version: | 0.9.12 |
| Keywords: | Cc: | jleedev@… |
Description
None of the enumerations in Gdk.Enums are instances of Eq, which makes it cumbersome to check for certain events. For example, I wanted to keep track of the fullscreen state of a window with the following code:
ref <- newIORef False
onWindowState win $ \WindowState { eventWindowState = state } -> do
writeIORef ref (WindowStateFullscreen `elem` state)
return True
However, writing the code this way requires an Eq instance; workarounds require either manually defining one or using pattern matching, which is cumbersome because state is a list of WindowState values.
It would be trivial to add deriving (Eq) to these enumerations (and also Read/Show, for debugging purposes).
Change History
Note: See
TracTickets for help on using
tickets.