From 7d60676897ee5b0f234144b3517f42faf4ea232d Mon Sep 17 00:00:00 2001 From: Chris Moore <0xCM00@gmail.com> Date: Sat, 13 Oct 2018 11:11:04 -0500 Subject: [PATCH 1/3] Made compatible with GHC 8.6.1 which primarily involved replacing Monad m with MonadFail m --- Main.hs | 5 +++-- PresentationExamples.hs | 19 +++++++++---------- Util.hs | 6 +++--- rhine-tutorial.cabal | 8 ++++---- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Main.hs b/Main.hs index b102bbf..a29c145 100644 --- a/Main.hs +++ b/Main.hs @@ -7,6 +7,7 @@ -- base import Control.Concurrent (threadDelay) +import Control.Monad.Fail import Data.Either (rights) import System.IO (hFlush, stdout) import Text.Read (readMaybe) @@ -17,7 +18,7 @@ import Control.Monad.Trans.MSF.Maybe (runMaybeT, MaybeT, exit) -- rhine import FRP.Rhine -import FRP.Rhine.SyncSF.Except +import FRP.Rhine.ClSF.Except import FRP.Rhine.Clock.Realtime.Millisecond import FRP.Rhine.Clock.Realtime.Stdin import FRP.Rhine.Clock.Select @@ -41,5 +42,5 @@ mainRhine = timeless (listToMaybeS "Congratulations! You've installed the tuto -- TODO In dunai 0.1.2 -listToMaybeS :: Monad m => [b] -> MSF (MaybeT m) a b +listToMaybeS :: MonadFail m => [b] -> MSF (MaybeT m) a b listToMaybeS = foldr iPost exit diff --git a/PresentationExamples.hs b/PresentationExamples.hs index efea104..6df30d0 100644 --- a/PresentationExamples.hs +++ b/PresentationExamples.hs @@ -6,11 +6,10 @@ -- dunai import Data.MonadicStreamFunction -import Data.VectorSpace.Specific() -- rhine import FRP.Rhine -import FRP.Rhine.SyncSF.Except +import FRP.Rhine.ClSF.Except import FRP.Rhine.Clock.Realtime.Millisecond --------------------------- @@ -31,13 +30,13 @@ main1 = reactimate type SumClock = Millisecond 100 -fillUp :: Monad m => SyncSF (ExceptT Double m) SumClock Double () +fillUp :: Monad m => ClSF (ExceptT Double m) SumClock Double () fillUp = proc x -> do s <- integral -< x _ <- throwOn' -< (s > 5, s) returnA -< () -helloWorld :: SyncExcept IO SumClock () () Empty + helloWorld = do try $ arr (const 1) >>> fillUp once_ $ putStrLn "Hello World!" @@ -49,20 +48,20 @@ main = flow $ safely helloWorld @@ waitClock data FastClock = FastClock instance Clock m FastClock where - type TimeDomainOf FastClock = () + type Time FastClock = () type Tag FastClock = () - startClock = undefined + initClock = undefined data SlowClock = SlowClock instance Clock m SlowClock where - type TimeDomainOf SlowClock = () + type Time SlowClock = () type Tag SlowClock = () - startClock = undefined + initClock = undefined -fastSignal :: SyncSF m FastClock () a +fastSignal :: ClSF m FastClock () a fastSignal = undefined -slowProcessor :: SyncSF m SlowClock b c +slowProcessor :: ClSF m SlowClock b c slowProcessor = undefined -- uncomment the following for a clock type error diff --git a/Util.hs b/Util.hs index 49264bd..256dccc 100644 --- a/Util.hs +++ b/Util.hs @@ -1,11 +1,11 @@ module Util where --- dunai +import Control.Monad.Fail-- dunai import Control.Monad.Trans.MSF.Except import Data.MonadicStreamFunction -- | Accumulates inputs and starts an MSF for each of them -pool :: Monad m => (a -> MSF m () b) -> MSF m [a] [b] +pool :: MonadFail m => (a -> MSF m () b) -> MSF m [a] [b] pool f = pool' f [] where pool' :: Monad m => (a -> MSF m () b) -> [MSF m () b] -> MSF m [a] [b] @@ -15,7 +15,7 @@ pool f = pool' f [] return (bs, pool' f msfs') -- | Remembers and indefinitely outputs the first input value. -keepFirst :: Monad m => MSF m a a +keepFirst :: MonadFail m => MSF m a a keepFirst = safely $ do a <- try throwS safe $ arr $ const a diff --git a/rhine-tutorial.cabal b/rhine-tutorial.cabal index becdab4..942072d 100644 --- a/rhine-tutorial.cabal +++ b/rhine-tutorial.cabal @@ -20,8 +20,8 @@ executable rhine-tutorial other-modules: Util -- other-extensions: build-depends: base >= 4.8 && < 5 - , dunai == 0.3.* - , rhine == 0.3.* + , dunai + , rhine , transformers == 0.5.* && < 0.6 -- hs-source-dirs: default-language: Haskell2010 @@ -30,8 +30,8 @@ executable presentation-examples main-is: PresentationExamples.hs -- other-extensions: build-depends: base >= 4.8 && < 5 - , dunai == 0.3.* - , rhine == 0.3.* + , dunai + , rhine , transformers == 0.5.* && < 0.6 -- hs-source-dirs: default-language: Haskell2010 From 4c542cc9a634c819a36724014a5b4a198226ac63 Mon Sep 17 00:00:00 2001 From: Chris Moore <0xCM00@gmail.com> Date: Sat, 13 Oct 2018 11:33:40 -0500 Subject: [PATCH 2/3] Targeted rhine/dunia dependencies to specific commit --- stack.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 stack.yaml diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..e6639e1 --- /dev/null +++ b/stack.yaml @@ -0,0 +1,13 @@ +resolver: nightly-2018-10-12 + +extra-deps: +- git: https://github.com/0xCM/rhine.git + commit: baaf91df2c35e4781ae5c1dd5a1858c041c80a6f + subdirs: + - rhine +- git: https://github.com/0xCM/dunai.git + commit: 4e64e5404f3d1d384d2430824cc497ccfa7e6825 +- git: https://github.com/expipiplus1/vector-sized.git + commit: f80e3ce774d255ee4ba25fcb12a81a76f600e0b0 +- finite-typelits-0.1.4.2@sha256:d243523297c0526d32e9b7de98e04b79a4227577ddb25d3fecd7981439de243c +- indexed-list-literals-0.2.1.2@sha256:0760e2a86605b5557af7180d4d50e317d75a5a92ca12aaabb6948ce97b7a94ac \ No newline at end of file From 74891886d5ea1ce8bb8127e4051fc42555fe5f52 Mon Sep 17 00:00:00 2001 From: Chris Moore <0xCM00@gmail.com> Date: Sat, 13 Oct 2018 15:24:09 -0500 Subject: [PATCH 3/3] Updated dunai dependencies --- stack.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stack.yaml b/stack.yaml index e6639e1..885d57e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,12 +1,12 @@ -resolver: nightly-2018-10-12 - +#resolver: nightly-2018-10-12 +resolver: lts-12.11 extra-deps: - git: https://github.com/0xCM/rhine.git - commit: baaf91df2c35e4781ae5c1dd5a1858c041c80a6f + commit: 772f913d8fda51b0a0c2ad8b303859fdb7d3863c subdirs: - rhine - git: https://github.com/0xCM/dunai.git - commit: 4e64e5404f3d1d384d2430824cc497ccfa7e6825 + commit: 5505a15b2009e13e233cca8328d520442d3045c6 - git: https://github.com/expipiplus1/vector-sized.git commit: f80e3ce774d255ee4ba25fcb12a81a76f600e0b0 - finite-typelits-0.1.4.2@sha256:d243523297c0526d32e9b7de98e04b79a4227577ddb25d3fecd7981439de243c