git.iko.soy/rowtype-yoga/purescript-lunapark
on main help sign in
Derive some additional Eq and Ord instances
commit869b2a29c626a0cabeb427e7aedabca5318d5f8f authorGary Burgess <gary.burgess@gmail.com> dateFri 2 Nov 2018, 15:45 (8 years ago) parenta02833a
1 file changed+13−1
src/Lunapark/Types.purs+13−1
src/Lunapark/Types.purs+13−1
@@ -32,18 +32,30 @@ import Node.Encoding as NE
3232import Node.Path (FilePath)
3333
3434newtype SessionId = SessionId String
35+
3536derive instance newtypeSessionId ∷ Newtype SessionId _
37+derive newtype instance eqSessionId ∷ Eq SessionId
38+derive newtype instance ordSessionId ∷ Ord SessionId
3639
3740newtype WindowHandle = WindowHandle String
41+
3842derive instance newtypeWindowHandle ∷ Newtype WindowHandle _
43+derive newtype instance eqWindowHandle ∷ Eq WindowHandle
44+derive newtype instance ordWindowHandle ∷ Ord WindowHandle
3945
4046currentWindow ∷ WindowHandle
4147currentWindow = WindowHandle "current"
4248
4349data FrameId = ByElementId String | ByIndex Int | TopFrame
4450
51+derive instance eqFrameId ∷ Eq FrameId
52+derive instance ordFrameId ∷ Ord FrameId
53+
4554newtype Element = Element String
46−derive instance newtypeElementId ∷ Newtype Element _
55+
56+derive instance newtypeElement ∷ Newtype Element _
57+derive newtype instance eqElement ∷ Eq Element
58+derive newtype instance ordElement ∷ Ord Element
4759
4860decodeElement ∷ Json → Either String Element
4961decodeElement = J.decodeJson >=> \obj →