File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ module Web.HTML
5
5
6
6
import Effect (Effect )
7
7
import Web.HTML.Window (Window )
8
+ import Web.HTML.Common (PropName , AttrName , ClassName ) as Exports
8
9
import Web.HTML.History (History ) as Exports
9
10
import Web.HTML.HTMLAnchorElement (HTMLAnchorElement ) as Exports
10
11
import Web.HTML.HTMLAreaElement (HTMLAreaElement ) as Exports
Original file line number Diff line number Diff line change
1
+ module Web.HTML.Common where
2
+
3
+ import Prelude
4
+
5
+ import Data.Newtype (class Newtype )
6
+
7
+ -- | A wrapper for property names.
8
+ -- |
9
+ -- | The phantom type `value` describes the type of value which this property
10
+ -- | requires.
11
+ newtype PropName :: Type -> Type
12
+ newtype PropName value = PropName String
13
+
14
+ derive instance newtypePropName :: Newtype (PropName value ) _
15
+ derive newtype instance eqPropName :: Eq (PropName value )
16
+ derive newtype instance ordPropName :: Ord (PropName value )
17
+
18
+ -- | A wrapper for attribute names.
19
+ newtype AttrName = AttrName String
20
+
21
+ derive instance newtypeAttrName :: Newtype AttrName _
22
+ derive newtype instance eqAttrName :: Eq AttrName
23
+ derive newtype instance ordAttrName :: Ord AttrName
24
+
25
+ -- | A wrapper for strings which are used as CSS classes.
26
+ newtype ClassName = ClassName String
27
+
28
+ derive instance newtypeClassName :: Newtype ClassName _
29
+ derive newtype instance eqClassName :: Eq ClassName
30
+ derive newtype instance ordClassName :: Ord ClassName
You can’t perform that action at this time.
0 commit comments