@@ -14,8 +14,8 @@ module Plum.View
1414 , rgb
1515 , rgba
1616 , UI
17− , UIWith(..)
18− , UIViewWith
17+ , GenericUI(..)
18+ , GenericUIView
1919 , column
2020 , row
2121 , stack
@@ -45,37 +45,37 @@ import Maquette as Maquette
4545import Record as Record
4646import Record.Unsafe.Union as Record
4747
48−type UIViewWith children msg = { nerves :: Array (Nerve msg), meat :: Array Meat, children :: children }
48+type GenericUIView children msg = { nerves :: Array (Nerve msg), meat :: Array Meat, children :: children }
4949
50−type UIView msg = UIViewWith (Array (View msg)) msg
50+type UIView msg = GenericUIView (Array (View msg)) msg
5151
52−data UIWith children msg a = UI (UIViewWith children msg) a
52+data GenericUI children msg a = UI (GenericUIView children msg) a
5353
54−instance (Semigroup children, Semigroup a) => Semigroup (UIWith children msg a) where
54+instance (Semigroup children, Semigroup a) => Semigroup (GenericUI children msg a) where
5555 append (UI v a) (UI v' a') = UI (v <> v') (a <> a')
5656
57−instance (Monoid children, Monoid a) => Monoid (UIWith children msg a) where
57+instance (Monoid children, Monoid a) => Monoid (GenericUI children msg a) where
5858 mempty = UI mempty mempty
5959
60−type UI msg a = UIWith (Array (View msg)) msg a
60+type UI msg a = GenericUI (Array (View msg)) msg a
6161
62−instance Functor (UIWith children msg) where
62+instance Functor (GenericUI children msg) where
6363 map f (UI v a) = UI v $ f a
6464
65−instance Monoid children => Apply (UIWith children msg) where
65+instance Monoid children => Apply (GenericUI children msg) where
6666 apply (UI views f) (UI views' a) = UI (views <> views') (f a)
6767
68−instance Monoid children => Applicative (UIWith children msg) where
68+instance Monoid children => Applicative (GenericUI children msg) where
6969 pure = UI mempty
7070
71−instance Monoid children => Bind (UIWith children msg) where
71+instance Monoid children => Bind (GenericUI children msg) where
7272 bind (UI views a) f =
7373 let
7474 UI views' b = f a
7575 in
7676 UI (views <> views') b
7777
78−instance Monoid children => Monad (UIWith children msg)
78+instance Monoid children => Monad (GenericUI children msg)
7979
8080column :: forall msg a. UI msg a -> UI msg a
8181column (UI { nerves, meat, children } a) =
@@ -89,7 +89,7 @@ stack :: forall msg a. UI msg a -> UI msg a
8989stack (UI { nerves, meat, children } a) =
9090 UI (mempty :: UIView msg) { children = [ { meat, nerves, bones: Stack children } ] } a
9191
92−text :: forall msg. String -> UIWith Unit msg Unit -> UI msg Unit
92+text :: forall msg. String -> GenericUI Unit msg Unit -> UI msg Unit
9393text s (UI { nerves, meat } a) = UI (mempty :: UIView msg) { children = [ { meat, nerves, bones: Text s } ] } a
9494
9595link :: forall msg a. String -> UI msg a -> UI msg a
@@ -152,7 +152,7 @@ downloadAs url { filename } (UI { nerves, meat, children } a) = UI
152152 }
153153 a
154154
155−image :: forall msg a. String -> { description :: String } -> UIWith Unit msg a -> UI msg a
155+image :: forall msg a. String -> { description :: String } -> GenericUI Unit msg a -> UI msg a
156156image url description (UI { nerves, meat } a) =
157157 UI (mempty :: UIView msg) { children = [ { meat, nerves, bones: Image url description } ] } a
158158
@@ -168,13 +168,13 @@ data Alignment = Start | Center | End
168168
169169data Direction = X | Y
170170
171−meat :: forall ch msg a. Monoid ch => Monoid a => Meat -> UIWith ch msg a
172−meat m = UI (mempty :: UIViewWith ch msg) { meat = [ m ] } mempty
171+meat :: forall ch msg a. Monoid ch => Monoid a => Meat -> GenericUI ch msg a
172+meat m = UI (mempty :: GenericUIView ch msg) { meat = [ m ] } mempty
173173
174−spacing :: forall ch msg a. Monoid ch => Monoid a => { x :: Int, y :: Int } -> UIWith ch msg a
174+spacing :: forall ch msg a. Monoid ch => Monoid a => { x :: Int, y :: Int } -> GenericUI ch msg a
175175spacing { x, y } = meat $ Spacing x y
176176
177−explain :: forall ch msg a. Monoid ch => Monoid a => UIWith ch msg a
177+explain :: forall ch msg a. Monoid ch => Monoid a => GenericUI ch msg a
178178explain = meat Explain
179179
180180data Meat