Skip to content

Commit

Permalink
Merge pull request slamdata#4 from garyb/instances
Browse files Browse the repository at this point in the history
Derive some additional Eq and Ord instances
  • Loading branch information
garyb authored Nov 2, 2018
2 parents a02833a + 869b2a2 commit 780f320
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Lunapark/Types.purs
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,30 @@ import Node.Encoding as NE
import Node.Path (FilePath)

newtype SessionId = SessionId String

derive instance newtypeSessionIdNewtype SessionId _
derive newtype instance eqSessionIdEq SessionId
derive newtype instance ordSessionIdOrd SessionId

newtype WindowHandle = WindowHandle String

derive instance newtypeWindowHandleNewtype WindowHandle _
derive newtype instance eqWindowHandleEq WindowHandle
derive newtype instance ordWindowHandleOrd WindowHandle

currentWindow WindowHandle
currentWindow = WindowHandle "current"

data FrameId = ByElementId String | ByIndex Int | TopFrame

derive instance eqFrameIdEq FrameId
derive instance ordFrameIdOrd FrameId

newtype Element = Element String
derive instance newtypeElementIdNewtype Element _

derive instance newtypeElementNewtype Element _
derive newtype instance eqElementEq Element
derive newtype instance ordElementOrd Element

decodeElement Json Either String Element
decodeElement = J.decodeJson >=> \obj →
Expand Down

0 comments on commit 780f320

Please sign in to comment.