summaryrefslogtreecommitdiff
path: root/src/Gtk/Tune.icl
diff options
context:
space:
mode:
Diffstat (limited to 'src/Gtk/Tune.icl')
-rw-r--r--src/Gtk/Tune.icl27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/Gtk/Tune.icl b/src/Gtk/Tune.icl
index c5846af..a6d9b0e 100644
--- a/src/Gtk/Tune.icl
+++ b/src/Gtk/Tune.icl
@@ -1,5 +1,7 @@
implementation module Gtk.Tune
+import StdEnv
+
import Control.Applicative
import Control.Monad
import Control.Monad.Identity
@@ -7,16 +9,25 @@ import Control.Monad.State
import Gtk
+instance tune elem (oa,ob) | tune elem oa & tune elem ob
+where
+ tune (a,b) elem = tune a elem >>= tune b
+
+instance tune elem (oa,ob,oc) | tune elem oa & tune elem ob & tune elem oc
+where
+ tune (a,b,c) elem = tune a elem >>= tune b >>= tune c
+
+instance tune elem (oa,ob,oc,od) | tune elem oa & tune elem ob & tune elem oc & tune elem od
+where
+ tune (a,b,c,d) elem = tune a elem >>= tune b >>= tune c >>= tune d
+
+(<<@) infixl 2 :: !(GtkM elem) !option -> GtkM elem | tune elem option
+(<<@) elemf option = elemf >>= tune option
+
instance tune w GtkMargins | gtkWidget w
where
- tune widgetf margins =
- widgetf >>= \widget ->
- setMargins margins widget >>|
- pure widget
+ tune margins widget = setMargins margins widget
instance tune w GtkCSSClass | gtkWidget w
where
- tune widgetf cls =
- widgetf >>= \widget ->
- addCSSClass cls widget >>|
- pure widget
+ tune cls widget = addCSSClass cls widget