From 6303886f84086bcfd3c47f3b9c28b51a6bfd0001 Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Tue, 30 Nov 2021 23:57:19 +0700 Subject: [PATCH] BarTimeframe: Correct FromDhall instance --- src/ATrade/Driver/Junction/Types.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ATrade/Driver/Junction/Types.hs b/src/ATrade/Driver/Junction/Types.hs index 8ff13e1..d16f76e 100644 --- a/src/ATrade/Driver/Junction/Types.hs +++ b/src/ATrade/Driver/Junction/Types.hs @@ -21,7 +21,7 @@ import Data.Default (Default) import Data.IORef (IORef) import qualified Data.Text as T import Data.Time (UTCTime) -import Dhall (FromDhall) +import Dhall (FromDhall, autoWith, natural) import GHC.Generics (Generic) data StrategyDescriptor c s = @@ -41,7 +41,9 @@ data TickerConfig = } deriving (Generic) -instance FromDhall BarTimeframe +instance FromDhall BarTimeframe where + autoWith _ = BarTimeframe . fromIntegral <$> natural + instance FromDhall TickerConfig data BigConfig c = BigConfig {