From 1bfaed79925e65846bf7b8c1953f26c0198ee29a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 15 May 2018 18:03:30 +0200 Subject: Use Float-math --- trivmix.cabal | 2 +- trivmix.nix | 2 +- trivmix/Trivmix.hs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trivmix.cabal b/trivmix.cabal index 41ba03f..37218b6 100644 --- a/trivmix.cabal +++ b/trivmix.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: trivmix -version: 3.2.0 +version: 3.2.1 -- synopsis: -- description: license: PublicDomain diff --git a/trivmix.nix b/trivmix.nix index 8d0ea14..310e687 100644 --- a/trivmix.nix +++ b/trivmix.nix @@ -5,7 +5,7 @@ }: mkDerivation { pname = "trivmix"; - version = "3.2.0"; + version = "3.2.1"; src = ./.; isLibrary = true; isExecutable = true; diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs index 91dd440..21add53 100644 --- a/trivmix/Trivmix.hs +++ b/trivmix/Trivmix.hs @@ -53,7 +53,7 @@ data Options = Options , client :: String , initialLevel :: Level , initialBalance :: Balance - , fps, interval :: Rational + , fps, interval :: Float , run :: [FilePath] , balanceFiles :: [FilePath] , levelFiles :: [FilePath] @@ -188,7 +188,7 @@ trivmix Options{..} = do mulBalance (bToFloat -> b) x = either error id $ asFloat (*) (Lin . either error id $ refine b) x newLevel <- mulBalance <$> readMVar balance <*> readMVar level currentLevel <- readMVar level' - mapM_ (\(fromRational -> x) -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1] + mapM_ (\x -> swapMVar level' (linInt' x currentLevel newLevel) >> threadDelay delay) [0,recip frames..1] mix :: MVar Level -> CFloat -> IO CFloat mix level input = do -- cgit v1.2.3