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
aedd4f0a
Commit
aedd4f0a
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Document and clean up code generator
parent
74c92172
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/Protocol/TH.hs
+15
-8
15 additions, 8 deletions
src/Quasar/Wayland/Protocol/TH.hs
with
15 additions
and
8 deletions
src/Quasar/Wayland/Protocol/TH.hs
+
15
−
8
View file @
aedd4f0a
...
@@ -103,20 +103,34 @@ tellQs = tell <=< lift
...
@@ -103,20 +103,34 @@ tellQs = tell <=< lift
interfaceDecs
::
InterfaceSpec
->
Q
([
Dec
],
[
Dec
])
interfaceDecs
::
InterfaceSpec
->
Q
([
Dec
],
[
Dec
])
interfaceDecs
interface
=
do
interfaceDecs
interface
=
do
public
<-
execWriterT
do
public
<-
execWriterT
do
-- Main interface type
let
iCtorDec
=
(
normalC
iName
[]
,
Nothing
,
[]
)
let
iCtorDec
=
(
normalC
iName
[]
,
Nothing
,
[]
)
tellQ
$
dataD_doc
(
pure
[]
)
iName
[]
Nothing
[
iCtorDec
]
[]
(
toDoc
interface
.
description
)
tellQ
$
dataD_doc
(
pure
[]
)
iName
[]
Nothing
[
iCtorDec
]
[]
(
toDoc
interface
.
description
)
tellQ
$
instanceD
(
pure
[]
)
[
t
|
IsInterface $iT
|]
instanceDecs
-- IsInterface instance
tellQ
$
instanceD
(
pure
[]
)
[
t
|
IsInterface $iT
|]
[
tySynInstD
(
tySynEqn
Nothing
[
t
|
$(conT ''Requests) $sT $iT
|]
(
orUnit
(
requestsT
interface
sT
))),
tySynInstD
(
tySynEqn
Nothing
[
t
|
$(conT ''Events) $sT $iT
|]
(
orUnit
(
eventsT
interface
sT
))),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireRequest
)
iT
)
wireRequestT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireEvent
)
iT
)
eT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''InterfaceName
)
iT
)
(
litT
(
strTyLit
interface
.
name
)))
]
-- | IsInterfaceSide instance
tellQs
interfaceSideInstanceDs
tellQs
interfaceSideInstanceDs
-- | Requests record
when
(
length
interface
.
requests
>
0
)
do
when
(
length
interface
.
requests
>
0
)
do
tellQ
requestRecordD
tellQ
requestRecordD
-- | Events record
when
(
length
interface
.
events
>
0
)
do
when
(
length
interface
.
events
>
0
)
do
tellQ
eventRecordD
tellQ
eventRecordD
internals
<-
execWriterT
do
internals
<-
execWriterT
do
-- | Request wire type
when
(
length
interface
.
requests
>
0
)
do
when
(
length
interface
.
requests
>
0
)
do
tellQs
$
messageTypeDecs
rTypeName
requestContexts
tellQs
$
messageTypeDecs
rTypeName
requestContexts
-- | Event wire type
when
(
length
interface
.
events
>
0
)
do
when
(
length
interface
.
events
>
0
)
do
tellQs
$
messageTypeDecs
eTypeName
eventContexts
tellQs
$
messageTypeDecs
eTypeName
eventContexts
...
@@ -126,13 +140,6 @@ interfaceDecs interface = do
...
@@ -126,13 +140,6 @@ interfaceDecs interface = do
iName
=
interfaceN
interface
iName
=
interfaceN
interface
iT
=
interfaceT
interface
iT
=
interfaceT
interface
sT
=
sideTVar
sT
=
sideTVar
instanceDecs
=
[
tySynInstD
(
tySynEqn
Nothing
[
t
|
$(conT ''Requests) $sT $iT
|]
(
orUnit
(
requestsT
interface
sT
))),
tySynInstD
(
tySynEqn
Nothing
[
t
|
$(conT ''Events) $sT $iT
|]
(
orUnit
(
eventsT
interface
sT
))),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireRequest
)
iT
)
wireRequestT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireEvent
)
iT
)
eT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''InterfaceName
)
iT
)
(
litT
(
strTyLit
interface
.
name
)))
]
wireRequestT
::
Q
Type
wireRequestT
::
Q
Type
wireRequestT
=
if
length
interface
.
requests
>
0
then
conT
rTypeName
else
[
t
|
Void
|]
wireRequestT
=
if
length
interface
.
requests
>
0
then
conT
rTypeName
else
[
t
|
Void
|]
rTypeName
::
Name
rTypeName
::
Name
...
...
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