Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar-network
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-network
Commits
9f2c9a52
Commit
9f2c9a52
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Clarify internal variable name
parent
962db62b
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/Network/TH.hs
+7
-7
7 additions, 7 deletions
src/Quasar/Network/TH.hs
with
7 additions
and
7 deletions
src/Quasar/Network/TH.hs
+
7
−
7
View file @
9f2c9a52
...
...
@@ -123,7 +123,7 @@ makeProtocol api code = sequence [protocolDec, protocolInstanceDec, requestDec,
]
makeClient
::
Code
->
Q
[
Dec
]
makeClient
code
=
sequence
code
.
s
tubDecs
makeClient
code
=
sequence
code
.
clientS
tubDecs
makeServer
::
RpcApi
->
Code
->
Q
[
Dec
]
makeServer
api
@
RpcApi
{
functions
}
code
=
sequence
[
protocolImplDec
,
logicInstanceDec
]
...
...
@@ -191,19 +191,19 @@ makeServer api@RpcApi{functions} code = sequence [protocolImplDec, logicInstance
-- * Pluggable codegen interface
data
Code
=
Code
{
s
tubDecs
::
[
Q
Dec
],
clientS
tubDecs
::
[
Q
Dec
],
serverImplFields
::
[
Q
VarBangType
],
requests
::
[
Request
]
}
instance
Semigroup
Code
where
x
<>
y
=
Code
{
s
tubDecs
=
x
.
s
tubDecs
<>
y
.
s
tubDecs
,
clientS
tubDecs
=
x
.
clientS
tubDecs
<>
y
.
clientS
tubDecs
,
serverImplFields
=
x
.
serverImplFields
<>
y
.
serverImplFields
,
requests
=
x
.
requests
<>
y
.
requests
}
instance
Monoid
Code
where
mempty
=
Code
{
s
tubDecs
=
[]
,
clientS
tubDecs
=
[]
,
serverImplFields
=
[]
,
requests
=
[]
}
...
...
@@ -240,9 +240,9 @@ data RequestHandlerContext = RequestHandlerContext {
generateFunction
::
RpcApi
->
RpcFunction
->
Q
Code
generateFunction
api
fun
=
do
s
tubDecs
<-
clientFunctionStub
clientS
tubDecs
<-
clientFunctionStub
pure
Code
{
s
tubDecs
,
clientS
tubDecs
,
serverImplFields
=
if
isNothing
fun
.
fixedHandler
then
[
varDefaultBangType
implFieldName
implSig
]
...
...
@@ -354,7 +354,7 @@ generateFunction api fun = do
(
tupP
(
varP
<$>
channelNames
))
$
caseE
channelsE
[
match
(
listP
(
varP
<$>
channelNames
))
(
normalB
[
|
pure
$
(
tupE
(
varE
<$>
channelNames
))
|
])
[]
,
match
[
p
|
_
|]
(
normalB
[
|
fail
"Invalid number of channel created"
|
])
[]
match
wildP
(
normalB
[
|
fail
"Invalid number of channel created"
|
])
[]
]
go
::
[
Name
]
->
[
Name
]
->
[
Q
Stmt
]
go
[]
[]
=
[]
...
...
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