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
028968bc
Commit
028968bc
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Order generated code (public api before internal api)
parent
ac5ed142
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 @
028968bc
...
@@ -53,7 +53,8 @@ generateWaylandProcol protocolFile = do
...
@@ -53,7 +53,8 @@ generateWaylandProcol protocolFile = do
addDependentFile
protocolFile
addDependentFile
protocolFile
xml
<-
liftIO
(
BS
.
readFile
protocolFile
)
xml
<-
liftIO
(
BS
.
readFile
protocolFile
)
protocol
<-
parseProtocol
xml
protocol
<-
parseProtocol
xml
concat
<$>
mapM
interfaceDec
protocol
.
interfaces
(
public
,
internals
)
<-
unzip
<$>
mapM
interfaceDecs
protocol
.
interfaces
pure
$
mconcat
public
<>
mconcat
internals
tellQ
::
Q
a
->
WriterT
[
a
]
Q
()
tellQ
::
Q
a
->
WriterT
[
a
]
Q
()
...
@@ -66,16 +67,21 @@ tellQ action = tell =<< lift (singleton <$> action)
...
@@ -66,16 +67,21 @@ tellQ action = tell =<< lift (singleton <$> action)
tellQs
::
Q
[
a
]
->
WriterT
[
a
]
Q
()
tellQs
::
Q
[
a
]
->
WriterT
[
a
]
Q
()
tellQs
=
tell
<=<
lift
tellQs
=
tell
<=<
lift
interfaceDec
::
InterfaceSpec
->
Q
[
Dec
]
interfaceDecs
::
InterfaceSpec
->
Q
([
Dec
],
[
Dec
])
interfaceDec
interface
=
execWriterT
do
interfaceDecs
interface
=
do
tellQ
$
dataD
(
pure
[]
)
iName
[]
Nothing
[
normalC
iName
[]
]
[
derivingInterfaceClient
,
derivingInterfaceServer
]
public
<-
execWriterT
do
tellQ
$
instanceD
(
pure
[]
)
[
t
|
IsInterface $iT
|]
instanceDecs
pure
()
internals
<-
execWriterT
do
tellQ
$
dataD
(
pure
[]
)
iName
[]
Nothing
[
normalC
iName
[]
]
[
derivingInterfaceClient
,
derivingInterfaceServer
]
tellQ
$
instanceD
(
pure
[]
)
[
t
|
IsInterface $iT
|]
instanceDecs
when
(
length
interface
.
requests
>
0
)
do
when
(
length
interface
.
requests
>
0
)
do
tellQs
$
messageTypeDecs
rTypeName
(
requestContext
<$>
interface
.
requests
)
tellQs
$
messageTypeDecs
rTypeName
(
requestContext
<$>
interface
.
requests
)
when
(
length
interface
.
events
>
0
)
do
when
(
length
interface
.
events
>
0
)
do
tellQs
$
messageTypeDecs
eTypeName
(
eventContext
<$>
interface
.
events
)
tellQs
$
messageTypeDecs
eTypeName
(
eventContext
<$>
interface
.
events
)
pure
(
public
,
internals
)
where
where
iName
=
interfaceN
interface
iName
=
interfaceN
interface
...
...
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