git.iko.soy/rowtype-yoga/purescript-lunapark
on main help sign in
Merge pull request #4 from garyb/instances
780f320Gary Burgess
src/Lunapark/Types.purs+13−1
@@ -32,18 +32,30 @@ import Node.Encoding as NE
32import Node.Path (FilePath)
32import Node.Path (FilePath)
33
33
34newtype SessionId = SessionId String
34newtype SessionId = SessionId String
35+
35derive instance newtypeSessionId ∷ Newtype SessionId _
36derive instance newtypeSessionId ∷ Newtype SessionId _
37+derive newtype instance eqSessionId ∷ Eq SessionId
38+derive newtype instance ordSessionId ∷ Ord SessionId
36
39
37newtype WindowHandle = WindowHandle String
40newtype WindowHandle = WindowHandle String
41+
38derive instance newtypeWindowHandle ∷ Newtype WindowHandle _
42derive instance newtypeWindowHandle ∷ Newtype WindowHandle _
43+derive newtype instance eqWindowHandle ∷ Eq WindowHandle
44+derive newtype instance ordWindowHandle ∷ Ord WindowHandle
39
45
40currentWindow ∷ WindowHandle
46currentWindow ∷ WindowHandle
41currentWindow = WindowHandle "current"
47currentWindow = WindowHandle "current"
42
48
43data FrameId = ByElementId String | ByIndex Int | TopFrame
49data FrameId = ByElementId String | ByIndex Int | TopFrame
44
50
51+derive instance eqFrameId ∷ Eq FrameId
52+derive instance ordFrameId ∷ Ord FrameId
53+
45newtype Element = Element String
54newtype Element = Element String
55+
46−derive instance newtypeElementId ∷ Newtype Element _
56+derive instance newtypeElement ∷ Newtype Element _
57+derive newtype instance eqElement ∷ Eq Element
58+derive newtype instance ordElement ∷ Ord Element
47
59
48decodeElement ∷ Json → Either String Element
60decodeElement ∷ Json → Either String Element
49decodeElement = J.decodeJson >=> \obj →
61decodeElement = J.decodeJson >=> \obj →