Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qbar
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
Container Registry
Model registry
Operate
Environments
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
jktr
qbar
Commits
b38ea6a3
Commit
b38ea6a3
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Move instances closer to their class
parent
9d6d2214
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/QBar/Core.hs
+7
-6
7 additions, 6 deletions
src/QBar/Core.hs
with
7 additions
and
6 deletions
src/QBar/Core.hs
+
7
−
6
View file @
b38ea6a3
...
...
@@ -58,9 +58,14 @@ type PullBlock = Block PullMode
-- |Cached block. Always 'yield's the latest update, so it should only be pulled when the bar is rendered.
type
CachedBlock
=
Block
CachedMode
class
IsBlock
a
where
class
Is
Cachable
Block
a
where
toCachedBlock
::
a
->
CachedBlock
instance
IsCachableBlock
PushBlock
where
toCachedBlock
=
cachePushBlock
instance
IsCachableBlock
CachedBlock
where
toCachedBlock
=
id
class
IsBlockMode
a
where
exitBlock
::
Block
a
instance
IsBlockMode
PushMode
where
...
...
@@ -78,10 +83,6 @@ data Bar = Bar {
newBlockChan
::
TChan
CachedBlock
}
instance
IsBlock
PushBlock
where
toCachedBlock
=
cachePushBlock
instance
IsBlock
CachedBlock
where
toCachedBlock
=
id
data
BarUpdateChannel
=
BarUpdateChannel
(
IO
()
)
type
BarUpdateEvent
=
Event
.
Event
...
...
@@ -256,7 +257,7 @@ startPersistentBlockScript path = catchP startScriptProcess handleError
updateBlock
$
mkBlockOutput
.
pangoText
$
line
lift
updateBar
addBlock
::
IsBlock
a
=>
a
->
BarIO
()
addBlock
::
Is
Cachable
Block
a
=>
a
->
BarIO
()
addBlock
block
=
do
newBlockChan'
<-
newBlockChan
<$>
askBar
liftIO
$
atomically
$
writeTChan
newBlockChan'
$
toCachedBlock
block
...
...
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