Skip to content

Commit

Permalink
Change Stdin clock to text
Browse files Browse the repository at this point in the history
  • Loading branch information
turion committed Dec 31, 2023
1 parent 1193573 commit fd45f32
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions rhine/rhine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ library
, time >= 1.8
, free >= 5.1
, containers >= 0.5
, text ^>= 2.0
, deepseq >= 1.4
, random >= 1.1
, MonadRandom >= 0.5
Expand Down
8 changes: 6 additions & 2 deletions rhine/src/FRP/Rhine/Clock/Realtime/Stdin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import Data.Time.Clock
-- transformers
import Control.Monad.IO.Class

-- text
import qualified Data.Text as Text
import qualified Data.Text.IO as Text

-- rhine
import FRP.Rhine.Clock
import FRP.Rhine.Clock.Proxy
Expand All @@ -27,13 +31,13 @@ data StdinClock = StdinClock

instance (MonadIO m) => Clock m StdinClock where
type Time StdinClock = UTCTime
type Tag StdinClock = String
type Tag StdinClock = Text.Text

initClock _ = do
initialTime <- liftIO getCurrentTime
return
( constM $ liftIO $ do
line <- getLine
line <- Text.getLine
time <- getCurrentTime
return (time, line)
, initialTime
Expand Down
1 change: 1 addition & 0 deletions stack.8.10.7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extra-deps:
- linear-1.22
- monad-schedule-0.1.2.1@sha256:95d6b9c6fd36f585e4a52938ebd1762c2e2caa8bb3c11ce86985dd11a2caae1a,1776
- time-domain-0.1.0.2@sha256:33f0a6efe6eb03e729f3dc828cd673b0bb511a0e50ac0b621c5acebd82f6d329,1007
- text-2.0.2@sha256:71b5fa8c64d3c1fd0a08f993463220867b08290a2256e94b0952bf0e8f5a45cc,9905

nix:
packages:
Expand Down
1 change: 1 addition & 0 deletions stack.9.0.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extra-deps:
- simple-affine-space-0.2.1@sha256:bc9b1f5ae236b2898cd6f20da2d4589fd662fac2e2057f29b01330f65c030434,2046
- monad-schedule-0.1.2.1@sha256:95d6b9c6fd36f585e4a52938ebd1762c2e2caa8bb3c11ce86985dd11a2caae1a,1776
- time-domain-0.1.0.2@sha256:33f0a6efe6eb03e729f3dc828cd673b0bb511a0e50ac0b621c5acebd82f6d329,1007
- text-2.0.2@sha256:71b5fa8c64d3c1fd0a08f993463220867b08290a2256e94b0952bf0e8f5a45cc,9905

nix:
packages:
Expand Down
1 change: 1 addition & 0 deletions stack.9.2.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ extra-deps:
- dunai-0.11.0@sha256:fc82a2ac6e2f7efcc2cd7f01412544ebe10d25143febdb0c3ebfb090220f4660,6372
- simple-affine-space-0.2.1@sha256:bc9b1f5ae236b2898cd6f20da2d4589fd662fac2e2057f29b01330f65c030434,2046
- time-domain-0.1.0.2@sha256:33f0a6efe6eb03e729f3dc828cd673b0bb511a0e50ac0b621c5acebd82f6d329,1007
- text-2.0.2@sha256:71b5fa8c64d3c1fd0a08f993463220867b08290a2256e94b0952bf0e8f5a45cc,9905

nix:
packages:
Expand Down

0 comments on commit fd45f32

Please sign in to comment.