Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it build with ghc-9.8 #279

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/build-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
os:
- ubuntu-latest
cabal:
- 3.8.1.0
- latest
ghc:
- 8.0.2
- 8.2.2
Expand All @@ -37,12 +37,8 @@ jobs:
- 8.10.7
- 9.2.8
- 9.4.7
- 9.6.3
include:
- ghc: 9.8.1
os: ubuntu-latest
cabal: 3.8.1.0
allow-failure: true
- 9.6.4
- 9.8.1
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
14 changes: 7 additions & 7 deletions samples/DrumMachine.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Control.Monad
import Data.IORef
import Data.Functor
import Data.Functor hiding (unzip)

import Paths
import System.FilePath
Expand Down Expand Up @@ -42,7 +42,7 @@ setup w = void $ do
let status = grid [[UI.string "BPM:" , element elBpm]
,[UI.string "Beat:", element elTick]]
getBody w #+ [UI.div #. "wrap" #+ (status : map element elInstruments)]

timer <- UI.timer # set UI.interval (bpm2ms defaultBpm)
eBeat <- accumE (0::Int) $
(\beat -> (beat + 1) `mod` (beats * bars)) <$ UI.tick timer
Expand All @@ -51,12 +51,12 @@ setup w = void $ do
element elTick # set text (show $ beat + 1)
-- play corresponding sounds
sequence_ $ map (!! beat) kit

-- allow user to set BPM
on UI.keydown elBpm $ \keycode -> when (keycode == 13) $ void $ do
bpm <- read <$> get value elBpm
return timer # set UI.interval (bpm2ms bpm)

-- start the timer
UI.start timer

Expand All @@ -82,13 +82,13 @@ mkInstrument name = do
checked <- get UI.checked box
when checked $ do
runFunction $ ffi "%1.pause()" elAudio
runFunction $ ffi "%1.currentTime = 0" elAudio
runFunction $ ffi "%1.currentTime = 0" elAudio
runFunction $ ffi "%1.play()" elAudio
beats = map play . concat $ elCheckboxes
elGroups = [UI.span #. "bar" #+ map element bar | bar <- elCheckboxes]

elInstrument <- UI.div #. "instrument"
#+ (element elAudio : UI.string name : elGroups)

return (beats, elInstrument)

4 changes: 2 additions & 2 deletions threepenny-gui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Library
,data-default >= 0.5.0 && < 0.8
,deepseq >= 1.3.0 && < 1.6
,exceptions >= 0.6 && < 0.11
,filepath >= 1.3.0 && < 1.5.0
,filepath >= 1.3.0 && < 1.6.0
,file-embed >= 0.0.10 && < 0.1
,hashable >= 1.2.0 && < 1.5
,safe == 0.3.*
Expand All @@ -131,7 +131,7 @@ Library
,text >= 0.11 && < 2.2
,transformers >= 0.3.0 && < 0.7
,unordered-containers == 0.2.*
,websockets (>= 0.8 && < 0.12.5) || (> 0.12.5.0 && < 0.13)
,websockets (>= 0.8 && < 0.12.5) || (> 0.12.5.0 && < 0.14)
,websockets-snap >= 0.8 && < 0.11
,vault == 0.3.*
,vector >= 0.10 && < 0.14
Expand Down
Loading