File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,11 @@ module Hledger.Data.PeriodData
1919, tests_PeriodData
2020) where
2121
22+ #if MIN_VERSION_base(4,18,0)
2223import Data.Foldable1 (Foldable1 (.. ))
24+ #else
25+ import Control.Applicative (liftA2 )
26+ #endif
2327import qualified Data.IntMap.Strict as IM
2428import qualified Data.IntSet as IS
2529#if !MIN_VERSION_base(4,20,0)
@@ -48,10 +52,12 @@ instance Foldable PeriodData where
4852 foldl f z (PeriodData h as) = foldl f (f z h) as
4953 foldl' f z (PeriodData h as) = let fzh = f z h in fzh `seq` foldl' f fzh as
5054
55+ #if MIN_VERSION_base(4,18,0)
5156instance Foldable1 PeriodData where
5257 foldrMap1 f g (PeriodData h as) = foldr g (f h) as
5358 foldlMap1 f g (PeriodData h as) = foldl g (f h) as
5459 foldlMap1' f g (PeriodData h as) = let fh = f h in fh `seq` foldl' g fh as
60+ #endif
5561
5662instance Traversable PeriodData where
5763 traverse f (PeriodData h as) = liftA2 PeriodData (f h) $ traverse f as
You can’t perform that action at this time.
0 commit comments