@@ -1,13 +1,14 @@
11{-# LANGUAGE DerivingVia #-}
2+{-# LANGUAGE NamedFieldPuns #-}
23{-# LANGUAGE RecordWildCards #-}
34{-# LANGUAGE StandaloneDeriving #-}
45{-# OPTIONS_GHC -fno-warn-orphans #-}
56
6−module Flat.Orphans where
7+
8+module Flat.Instances where
79
810import Data.Fixed
911import Data.Time
10−import Data.Vector
1112import Flat as F
1213
1314
@@ -19,7 +20,7 @@ instance Flat DiffTime where
1920 size = F.size . diffTimeToPicoseconds
2021
2122utcTimeToTuple :: UTCTime -> (Day, DiffTime)
22−utcTimeToTuple UTCTime{..} = (utctDay, utctDayTime)
23+utcTimeToTuple = ((,) <$> utctDay <*> utctDayTime)
2324
2425instance Flat UTCTime where
2526 encode = F.encode . utcTimeToTuple
@@ -65,5 +66,3 @@ instance Flat ZonedTime where
6566 size = F.size . zonedTimeToTuple
6667 encode = F.encode . zonedTimeToTuple
6768 decode = uncurry ZonedTime <$> F.decode
68−
69−deriving via (AsArray (Vector a)) instance Flat a => Flat (Vector a)