Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar-wayland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar-wayland
Commits
d0b316fe
Commit
d0b316fe
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Use type variable `i` for the interface type
parent
7d1e4826
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Quasar/Wayland/Core.hs
+26
-26
26 additions, 26 deletions
src/Quasar/Wayland/Core.hs
with
26 additions
and
26 deletions
src/Quasar/Wayland/Core.hs
+
26
−
26
View file @
d0b316fe
...
@@ -97,46 +97,46 @@ instance WireFormat "fd" where
...
@@ -97,46 +97,46 @@ instance WireFormat "fd" where
-- | A wayland interface
-- | A wayland interface
class
(
Binary
(
TRequest
a
),
Binary
(
TEvent
a
))
=>
IsInterface
a
where
class
(
Binary
(
TRequest
i
),
Binary
(
TEvent
i
))
=>
IsInterface
i
where
type
TRequest
a
type
TRequest
i
type
TEvent
a
type
TEvent
i
interfaceName
::
String
interfaceName
::
String
class
IsInterface
a
=>
IsObject
(
s
::
Side
)
a
where
class
IsInterface
i
=>
IsObject
(
s
::
Side
)
i
where
type
Up
s
a
type
Up
s
i
type
Down
s
a
type
Down
s
i
data
Side
=
Client
|
Server
data
Side
=
Client
|
Server
data
Object
s
m
a
=
IsInterface
a
=>
Object
ObjectId
(
Callback
s
m
a
)
data
Object
s
m
i
=
IsInterface
i
=>
Object
ObjectId
(
Callback
s
m
i
)
instance
IsInterface
a
=>
IsObject
'Client
a
where
instance
IsInterface
i
=>
IsObject
'Client
i
where
type
Up
'Client
a
=
TRequest
a
type
Up
'Client
i
=
TRequest
i
type
Down
'Client
a
=
TEvent
a
type
Down
'Client
i
=
TEvent
i
instance
IsInterface
a
=>
IsObject
'Server
a
where
instance
IsInterface
i
=>
IsObject
'Server
i
where
type
Up
'Server
a
=
TEvent
a
type
Up
'Server
i
=
TEvent
i
type
Down
'Server
a
=
TRequest
a
type
Down
'Server
i
=
TRequest
i
instance
forall
s
m
a
.
IsInterface
a
=>
IsSomeObject
(
Object
s
m
a
)
where
instance
forall
s
m
i
.
IsInterface
i
=>
IsSomeObject
(
Object
s
m
i
)
where
objectId
(
Object
oId
_
)
=
oId
objectId
(
Object
oId
_
)
=
oId
objectInterfaceName
_
=
interfaceName
@
a
objectInterfaceName
_
=
interfaceName
@
i
class
IsSomeObject
a
where
class
IsSomeObject
i
where
objectId
::
a
->
ObjectId
objectId
::
i
->
ObjectId
objectInterfaceName
::
a
->
String
objectInterfaceName
::
i
->
String
-- | Wayland object quantification wrapper
-- | Wayland object quantification wrapper
data
SomeObject
=
forall
a
.
IsSomeObject
a
=>
SomeObject
a
data
SomeObject
=
forall
i
.
IsSomeObject
i
=>
SomeObject
i
instance
IsSomeObject
SomeObject
where
instance
IsSomeObject
SomeObject
where
objectId
(
SomeObject
object
)
=
objectId
object
objectId
(
SomeObject
object
)
=
objectId
object
objectInterfaceName
(
SomeObject
object
)
=
objectInterfaceName
object
objectInterfaceName
(
SomeObject
object
)
=
objectInterfaceName
object
class
IsMessage
a
where
class
IsMessage
i
where
messageName
::
a
->
String
messageName
::
i
->
String
instance
IsMessage
Void
where
instance
IsMessage
Void
where
messageName
=
absurd
messageName
=
absurd
...
@@ -187,11 +187,11 @@ data Event = Event ObjectId Opcode (Either BSL.ByteString (Word32, BSL.ByteStrin
...
@@ -187,11 +187,11 @@ data Event = Event ObjectId Opcode (Either BSL.ByteString (Word32, BSL.ByteStrin
deriving
stock
Show
deriving
stock
Show
type
ClientCallback
m
a
=
Callback
'Client
m
a
type
ClientCallback
m
i
=
Callback
'Client
m
i
type
ServerCallback
m
a
=
Callback
'Server
m
a
type
ServerCallback
m
i
=
Callback
'Server
m
i
data
Callback
s
m
a
=
Callback
{
data
Callback
s
m
i
=
Callback
{
messageCallback
::
Object
s
m
a
->
Down
s
a
->
StateT
(
ProtocolState
s
m
)
m
()
messageCallback
::
Object
s
m
i
->
Down
s
i
->
StateT
(
ProtocolState
s
m
)
m
()
}
}
-- * Exceptions
-- * Exceptions
...
@@ -258,7 +258,7 @@ feedInput bytes = protocolStep do
...
@@ -258,7 +258,7 @@ feedInput bytes = protocolStep do
inboxDecoder
=
pushChunk
st
.
inboxDecoder
bytes
inboxDecoder
=
pushChunk
st
.
inboxDecoder
bytes
}
}
sendMessage
::
MonadCatch
m
=>
Object
s
m
a
->
Up
s
a
->
ProtocolStep
s
m
()
sendMessage
::
MonadCatch
m
=>
Object
s
m
i
->
Up
s
i
->
ProtocolStep
s
m
()
sendMessage
object
message
=
protocolStep
do
sendMessage
object
message
=
protocolStep
do
undefined
message
undefined
message
runCallbacks
runCallbacks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment