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
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
-- | A wayland interface
class
(
Binary
(
TRequest
a
),
Binary
(
TEvent
a
))
=>
IsInterface
a
where
type
TRequest
a
type
TEvent
a
class
(
Binary
(
TRequest
i
),
Binary
(
TEvent
i
))
=>
IsInterface
i
where
type
TRequest
i
type
TEvent
i
interfaceName
::
String
class
IsInterface
a
=>
IsObject
(
s
::
Side
)
a
where
type
Up
s
a
type
Down
s
a
class
IsInterface
i
=>
IsObject
(
s
::
Side
)
i
where
type
Up
s
i
type
Down
s
i
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
type
Up
'Client
a
=
TRequest
a
type
Down
'Client
a
=
TEvent
a
instance
IsInterface
i
=>
IsObject
'Client
i
where
type
Up
'Client
i
=
TRequest
i
type
Down
'Client
i
=
TEvent
i
instance
IsInterface
a
=>
IsObject
'Server
a
where
type
Up
'Server
a
=
TEvent
a
type
Down
'Server
a
=
TRequest
a
instance
IsInterface
i
=>
IsObject
'Server
i
where
type
Up
'Server
i
=
TEvent
i
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
objectInterfaceName
_
=
interfaceName
@
a
objectInterfaceName
_
=
interfaceName
@
i
class
IsSomeObject
a
where
objectId
::
a
->
ObjectId
objectInterfaceName
::
a
->
String
class
IsSomeObject
i
where
objectId
::
i
->
ObjectId
objectInterfaceName
::
i
->
String
-- | Wayland object quantification wrapper
data
SomeObject
=
forall
a
.
IsSomeObject
a
=>
SomeObject
a
data
SomeObject
=
forall
i
.
IsSomeObject
i
=>
SomeObject
i
instance
IsSomeObject
SomeObject
where
objectId
(
SomeObject
object
)
=
objectId
object
objectInterfaceName
(
SomeObject
object
)
=
objectInterfaceName
object
class
IsMessage
a
where
messageName
::
a
->
String
class
IsMessage
i
where
messageName
::
i
->
String
instance
IsMessage
Void
where
messageName
=
absurd
...
...
@@ -187,11 +187,11 @@ data Event = Event ObjectId Opcode (Either BSL.ByteString (Word32, BSL.ByteStrin
deriving
stock
Show
type
ClientCallback
m
a
=
Callback
'Client
m
a
type
ServerCallback
m
a
=
Callback
'Server
m
a
type
ClientCallback
m
i
=
Callback
'Client
m
i
type
ServerCallback
m
i
=
Callback
'Server
m
i
data
Callback
s
m
a
=
Callback
{
messageCallback
::
Object
s
m
a
->
Down
s
a
->
StateT
(
ProtocolState
s
m
)
m
()
data
Callback
s
m
i
=
Callback
{
messageCallback
::
Object
s
m
i
->
Down
s
i
->
StateT
(
ProtocolState
s
m
)
m
()
}
-- * Exceptions
...
...
@@ -258,7 +258,7 @@ feedInput bytes = protocolStep do
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
undefined
message
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