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
8fb772eb
Commit
8fb772eb
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Don't generate empty high-level api types
parent
4179fb23
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
-9
15 additions, 9 deletions
src/Quasar/Wayland/Protocol/TH.hs
with
15 additions
and
9 deletions
src/Quasar/Wayland/Protocol/TH.hs
+
15
−
9
View file @
8fb772eb
...
@@ -90,12 +90,15 @@ tellQs = tell <=< lift
...
@@ -90,12 +90,15 @@ 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
tellQ
requestRecordD
tellQ
eventRecordD
internals
<-
execWriterT
do
tellQ
$
dataD
(
pure
[]
)
iName
[]
Nothing
[]
[
derivingInterfaceClient
,
derivingInterfaceServer
]
tellQ
$
dataD
(
pure
[]
)
iName
[]
Nothing
[]
[
derivingInterfaceClient
,
derivingInterfaceServer
]
tellQ
$
instanceD
(
pure
[]
)
[
t
|
IsInterface $iT
|]
instanceDecs
tellQ
$
instanceD
(
pure
[]
)
[
t
|
IsInterface $iT
|]
instanceDecs
when
(
length
interface
.
requests
>
0
)
do
tellQ
requestRecordD
when
(
length
interface
.
events
>
0
)
do
tellQ
eventRecordD
internals
<-
execWriterT
do
when
(
length
interface
.
requests
>
0
)
do
when
(
length
interface
.
requests
>
0
)
do
tellQs
$
messageTypeDecs
rTypeName
requestContexts
tellQs
$
messageTypeDecs
rTypeName
requestContexts
...
@@ -108,8 +111,8 @@ interfaceDecs interface = do
...
@@ -108,8 +111,8 @@ interfaceDecs interface = do
iName
=
interfaceN
interface
iName
=
interfaceN
interface
iT
=
interfaceT
interface
iT
=
interfaceT
interface
instanceDecs
=
[
instanceDecs
=
[
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''Requests
)
iT
)
(
requestsT
interface
)),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''Requests
)
iT
)
(
orVoid
(
requestsT
interface
))
)
,
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''Events
)
iT
)
(
eventsT
interface
)),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''Events
)
iT
)
(
orVoid
(
eventsT
interface
))
)
,
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireRequest
)
iT
)
wireRequestT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireRequest
)
iT
)
wireRequestT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireEvent
)
iT
)
eT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''WireEvent
)
iT
)
eT
),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''InterfaceName
)
iT
)
(
litT
(
strTyLit
interface
.
name
))),
tySynInstD
(
tySynEqn
Nothing
(
appT
(
conT
''InterfaceName
)
iT
)
(
litT
(
strTyLit
interface
.
name
))),
...
@@ -182,14 +185,17 @@ interfaceT interface = conT (interfaceN interface)
...
@@ -182,14 +185,17 @@ interfaceT interface = conT (interfaceN interface)
requestsName
::
InterfaceSpec
->
Name
requestsName
::
InterfaceSpec
->
Name
requestsName
interface
=
mkName
$
"Requests_"
<>
interface
.
name
requestsName
interface
=
mkName
$
"Requests_"
<>
interface
.
name
requestsT
::
InterfaceSpec
->
Q
Type
requestsT
::
InterfaceSpec
->
Maybe
(
Q
Type
)
requestsT
interface
=
conT
(
requestsName
interface
)
requestsT
interface
=
if
(
length
interface
.
requests
)
>
0
then
Just
(
conT
(
requestsName
interface
)
)
else
Nothing
eventsName
::
InterfaceSpec
->
Name
eventsName
::
InterfaceSpec
->
Name
eventsName
interface
=
mkName
$
"Events_"
<>
interface
.
name
eventsName
interface
=
mkName
$
"Events_"
<>
interface
.
name
eventsT
::
InterfaceSpec
->
Q
Type
eventsT
::
InterfaceSpec
->
Maybe
(
Q
Type
)
eventsT
interface
=
conT
(
eventsName
interface
)
eventsT
interface
=
if
(
length
interface
.
events
)
>
0
then
Just
(
conT
(
eventsName
interface
))
else
Nothing
orVoid
::
Maybe
(
Q
Type
)
->
Q
Type
orVoid
=
fromMaybe
[
t
|
Void
|]
...
...
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