From 869b2a29c626a0cabeb427e7aedabca5318d5f8f Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Fri, 2 Nov 2018 15:45:21 +0000 Subject: [PATCH] Derive some additional Eq and Ord instances --- src/Lunapark/Types.purs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Lunapark/Types.purs b/src/Lunapark/Types.purs index 11732a1..cacf958 100644 --- a/src/Lunapark/Types.purs +++ b/src/Lunapark/Types.purs @@ -32,18 +32,30 @@ import Node.Encoding as NE import Node.Path (FilePath) newtype SessionId = SessionId String + derive instance newtypeSessionId ∷ Newtype SessionId _ +derive newtype instance eqSessionId ∷ Eq SessionId +derive newtype instance ordSessionId ∷ Ord SessionId newtype WindowHandle = WindowHandle String + derive instance newtypeWindowHandle ∷ Newtype WindowHandle _ +derive newtype instance eqWindowHandle ∷ Eq WindowHandle +derive newtype instance ordWindowHandle ∷ Ord WindowHandle currentWindow ∷ WindowHandle currentWindow = WindowHandle "current" data FrameId = ByElementId String | ByIndex Int | TopFrame +derive instance eqFrameId ∷ Eq FrameId +derive instance ordFrameId ∷ Ord FrameId + newtype Element = Element String -derive instance newtypeElementId ∷ Newtype Element _ + +derive instance newtypeElement ∷ Newtype Element _ +derive newtype instance eqElement ∷ Eq Element +derive newtype instance ordElement ∷ Ord Element decodeElement ∷ Json → Either String Element decodeElement = J.decodeJson >=> \obj →