packages feed

fit 0.5 → 0.5.1

raw patch · 9 files changed

+195/−116 lines, 9 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Fit.Internal.FitParser: instance Functor (Const a)

Files

fit.cabal view
@@ -1,5 +1,5 @@ name:                fit-version:             0.5+version:             0.5.1 license:             BSD3 license-file:        LICENSE author:              Matt Giles@@ -21,6 +21,8 @@  "Fit" module should be sufficient and convenient for most uses, but if you need access  to the exact structure of the file you can use the data types in "Fit.Internal.FitFile"  and parsers in "Fit.Internal.Parse".+ .+ Feel free to contact me if you have any questions, suggestions, or requests. category:            Data, Parsing, Fitness stability:           experimental build-type:          Simple@@ -42,7 +44,7 @@                      , Fit.Internal.Numbers                      , Fit.Internal.Parse   ghc-options:         -Wall-  build-depends:       base >=4.7 && <4.8+  build-depends:       base >=4.7 && <4.9                      , attoparsec >= 0.10.3                      , bytestring                      , text@@ -56,7 +58,7 @@   main-is:           test/TestFit.hs   default-language:  Haskell2010   ghc-options:       -Wall-  build-depends:      base >=4.7 && <4.8+  build-depends:      base >=4.7 && <4.9                     , fit                     , hspec                     , hspec-attoparsec
src/Fit.hs view
@@ -1,3 +1,11 @@+{-|+Module      : Fit+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental+-}+ module Fit (   -- * Messages API   -- $messages
src/Fit/Internal/Architecture.hs view
@@ -1,10 +1,19 @@+{-|+Module      : Fit.Internal.Architecture+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++FIT files can contain values encoded with both little-endian and big-endian orderings, and this+can vary throughout the file. This module provides some helper types for using parsers+with the correct endian-ness during the parse. See the "Fit.Internal.Numbers" and+"Fit.Internal.FitParser" modules for example use.+-}+ {-# LANGUAGE KindSignatures #-} {-# LANGUAGE DataKinds #-} --- | FIT files can contain values encoded with both little-endian and big-endian orderings, and this--- can vary throughout the file. This module provides some helper types for using parsers--- with the correct endian-ness during the parse. See the "Fit.Internal.Numbers" and--- "Fit.Internal.FitParser" modules for example use. module Fit.Internal.Architecture (   Arch(..),   WithArch(..),@@ -14,7 +23,8 @@   withBE   ) where -import Control.Applicative (Applicative, pure, (<*>))+import Control.Applicative+import Prelude  data Arch = ArchLittle           | ArchBig@@ -31,10 +41,10 @@   (WithArch f) <*> (WithArch x) = WithArch (f x)  -- | Convenience type for values to use in a little-endian context-type LittleEndian a = WithArch ArchLittle a+type LittleEndian a = WithArch 'ArchLittle a  -- | Convenience type for values to use in a big-endian context-type BigEndian a = WithArch ArchBig a+type BigEndian a = WithArch 'ArchBig a  -- | Alias for 'pure' withLE :: a -> LittleEndian a
src/Fit/Internal/FitFile.hs view
@@ -1,3 +1,11 @@+{-|+Module      : Fit.Internal.FitFile+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++-} module Fit.Internal.FitFile (   Fit(..),   FitHeader(..),@@ -63,7 +71,7 @@ msgLmt (DefM (MessageDef lmt _ _ _)) = lmt msgLmt (DataM lmt _ _) = lmt --- | A @MessageDefinition@ for a local message type (LMT) determines how future data messages with+-- | A 'MessageDefinition' for a local message type (LMT) determines how future data messages with -- that LMT are decoded. LMTs can be re-used: a data message with LMT @n@ will use the /most recent/ -- message definition for LMT @n@. data MessageDefinition = MessageDef {@@ -99,7 +107,7 @@ -- | Singleton values. There is a Value constructor for each BaseType constructor. The wrapped -- value in these constructors corresponds to the specific format used in the FIT file, for -- example an 'enum' in FIT is stored as an 8-bit unsigned int (ie a Word8). The primary exception--- to this is using @Text@ for string values.+-- to this is using 'Text' for string values. data Value = EnumValue !Word8            | SInt8Value !Int8            | UInt8Value !Word8@@ -108,7 +116,7 @@            | SInt32Value !Int32            | UInt32Value !Word32            | StringValue Text -- ^ A 'string' in FIT is a null-terminated arrays of UTF-8-                              -- code units, but @Text@ is used here instead+                              -- code units, but 'Text' is used here instead            | Float32Value !Float            | Float64Value !Double            | UInt8ZValue !Word8@@ -145,11 +153,11 @@ -- | A local message type is a 4 bit unsigned integer newtype LocalMessageType = LMT { unLmt :: Int8 } deriving (Show, Eq) --- | Only the lower 4 bits of the integer are used to construct a @LocalMessageType@+-- | Only the lower 4 bits of the integer are used to construct a 'LocalMessageType' mkLocalMessageType :: (Integral a, Bits a) => a -> LocalMessageType mkLocalMessageType = LMT . fromIntegral . ((.&.) 0xF) --- | Unwrap a @LocalMessageType@. The resulting integer will be between 0 and 15+-- | Unwrap a 'LocalMessageType'. The resulting integer will be between 0 and 15 unLocalMessageType :: Integral a => LocalMessageType -> a unLocalMessageType = fromIntegral . unLmt 
src/Fit/Internal/FitParser.hs view
@@ -1,3 +1,12 @@+{-|+Module      : Fit.Internal.FitParser+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++-}+ {-# LANGUAGE LambdaCase #-}  module Fit.Internal.FitParser (@@ -35,7 +44,7 @@ import Fit.Internal.FitFile import qualified Fit.Internal.Numbers as N -import Control.Applicative ((<$>), (<*), (*>))+import Control.Applicative import Control.Monad.State.Class (get, modify) import Control.Monad.State.Strict (StateT, evalStateT) import Control.Monad.Trans (lift)@@ -47,6 +56,8 @@ import qualified Data.IntMap.Strict as IntMap (insert, lookup, empty) import Data.Word (Word8, Word16, Word32, Word64) +import Prelude+ type FitParser a = StateT FpState Parser a  -- | Turn a 'FitParser' into a plain attoparsec 'Parser'. This doesn't require any@@ -225,8 +236,3 @@  instance Functor Identity where   fmap f (Identity a) = Identity (f a)--newtype Const a b = Const { getConst :: a }--instance Functor (Const a) where-  fmap _ (Const x) = (Const x)
src/Fit/Internal/Numbers.hs view
@@ -1,7 +1,16 @@--- | Little-endian and big-endian parsers for signed and unsigned integers, and--- for single-precision and double-precision floating point numbers.------ The parsers are tagged for endianness using the tools in "Fit.Internal.Architecture".+{-|+Module      : Fit.Internal.Numbers+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++Little-endian and big-endian parsers for signed and unsigned integers, and+for single-precision and double-precision floating point numbers.++The parsers are tagged for endianness using the tools in "Fit.Internal.Architecture".+-}+ module Fit.Internal.Numbers (   -- * Little-endian parsers   int16le,@@ -30,7 +39,7 @@  import Fit.Internal.Architecture -import Control.Applicative ((<$>))+import Control.Applicative  import Data.Int (Int16, Int32, Int64) import Data.Bits (Bits, shiftL, FiniteBits, finiteBitSize)@@ -42,6 +51,8 @@  import qualified Foreign as F (alloca, poke, peek, castPtr) import System.IO.Unsafe (unsafePerformIO)++import Prelude  {- little-endian parsers -} word16le :: LittleEndian (Parser Word16)
src/Fit/Internal/Parse.hs view
@@ -1,3 +1,12 @@+{-|+Module      : Fit.Internal.Parse+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++-}+ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE PatternSynonyms #-}@@ -26,7 +35,7 @@ import Fit.Internal.FitFile import Fit.Internal.FitParser -import Control.Applicative ((<$>), (<*>), (<*))+import Control.Applicative import Control.Monad (replicateM) import Control.Monad.Trans (lift) import Data.Attoparsec.ByteString (Parser)@@ -41,13 +50,15 @@ import Data.Text.Encoding (decodeUtf8) import Data.Word (Word8) +import Prelude+ -- TODO ignores final CRC bytes--- | Parse a strict @ByteString@ containing the FIT data into a @Fit@ value+-- | Parse a strict 'ByteString' containing the FIT data into a 'Fit' value readFitRaw :: ByteString -> Either String Fit readFitRaw bs = let noCrc = B.init (B.init bs) -- Drop CRC bytes                 in A.parseOnly parseFit noCrc --- | An Attoparsec parser for @Fit@ values+-- | An Attoparsec parser for 'Fit' values parseFit :: Parser Fit parseFit = runFitParser $ Fit <$> parseHeader <*> parseMessages @@ -207,7 +218,7 @@     ctLmt = mkLocalMessageType $ (byte `shiftR` 5) .&. 0x3 -- in CT header the lmt is bits 5 and 6     ctOffset = mkTimeOffset byte -- in CT header the time offset is already low 5 bits --- Originally this was exported from Fit.Raw.Types, but haddock chokes on patterns+-- Originally this was exported from Fit.Internal.Types, but haddock chokes on patterns -- between modules. I think the bug is fixed in GHC 7.8.4, so can move this back to -- that module once we're off 7.8.3. pattern TimestampField t = SingletonField 253 (UInt32Value t)
src/Fit/Messages.hs view
@@ -1,11 +1,21 @@--- | The Messages API abtracts over the structure of a FIT file slightly and presents--- the FIT file as just the sequence of data messages in the file. The Messages API--- also abstracts over the various FIT base types (for example, signed/unsigned integers--- of different sizes) to give a simpler set of types to work with.------ If you need to know about the very specifics of the FIT file structure, use the Raw API--- instead. However, for pulling information out of a FIT file this API is much more--- convenient.+{-|+Module      : Fit.Messages+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++The Messages API abtracts over the structure of a FIT file slightly and presents+the FIT file as just the sequence of data messages in the file. The Messages API+also abstracts over the various FIT base types (for example, signed/unsigned integers+of different sizes) to give a simpler set of types to work with.++If you need to know about the specifics of the FIT file structure, use the API in+"Fit.Internal.FitFile" instead. However, for pulling information out of a FIT file+this API is much more convenient.+-}++ module Fit.Messages (   readMessages,   readFileMessages,@@ -18,10 +28,10 @@   ArrayValue(..)   ) where -import qualified Fit.Internal.FitFile as Raw-import qualified Fit.Internal.Parse as Raw+import qualified Fit.Internal.FitFile as FF+import qualified Fit.Internal.Parse as FF -import Control.Applicative ((<$>))+import Control.Applicative import Data.Attoparsec.ByteString (Parser) import Data.ByteString (ByteString) import qualified Data.ByteString as B (readFile, pack)@@ -34,6 +44,8 @@ import Data.Text (Text) import Data.Word (Word8) +import Prelude+ -- | The collection of data messages from the FIT file. newtype Messages = Messages {   _messages :: Seq Message@@ -42,7 +54,7 @@ -- | A FIT data message data Message = Message {   _mNumber :: !Int,        -- ^ The global message number, as found in the FIT profile-  _mFields :: IntMap Field -- ^ The fields in the message, mapped from field number to @Field@+  _mFields :: IntMap Field -- ^ The fields in the message, mapped from field number to 'Field'   } deriving (Show)  -- | A single field in a FIT data message@@ -56,77 +68,77 @@            | Array ArrayValue            deriving (Show) --- | A singleton value. In the Messages API we abstract over the specific FIT base type of the field. For example, the FIT types uint8, sint8, uint16, etc. are all presented as an @IntValue@. FIT strings (ie. character arrays) are presented as singleton @TextValue@s. If you need to know the specific base type of a field you can use the Raw API.+-- | A singleton value. In the Messages API we abstract over the specific FIT base type of the field. For example, the FIT types uint8, sint8, uint16, etc. are all presented as an 'IntValue'. FIT strings (ie. character arrays) are presented as singleton 'TextValue's. If you need to know the specific base type of a field you can use the API in "Fit.Internal.FitFile". data SingletonValue = IntValue !Int                     | RealValue !Double                     | ByteValue !Word8                     | TextValue Text                     deriving (Show) --- | Array values. Like singleton values these ignore the specific FIT base type to present a simpler interface. Byte arrays are presented as strict @ByteString@s. There are no character arrays, since the singleton @TextValue@ handles that case.+-- | Array values. Like singleton values these ignore the specific FIT base type to present a simpler interface. Byte arrays are presented as strict 'ByteString's. There are no character arrays, since the singleton 'TextValue' handles that case. data ArrayValue = IntArray (Seq Int)                 | RealArray (Seq Double)                 | ByteArray ByteString                 deriving (Show) --- | Parse a strict @ByteString@ containing the FIT data into its @Messages@+-- | Parse a strict 'ByteString' containing the FIT data into its 'Messages' readMessages :: ByteString -> Either String Messages-readMessages bs = toMessages <$> Raw.readFitRaw bs+readMessages bs = toMessages <$> FF.readFitRaw bs --- | Parse the given FIT file into its @Messages@+-- | Parse the given FIT file into its 'Messages' readFileMessages :: FilePath -> IO (Either String Messages) readFileMessages fp = B.readFile fp >>= return . readMessages --- | An Attoparsec parser for @Messages@+-- | An Attoparsec parser for 'Messages' parseMessages :: Parser Messages-parseMessages = fmap toMessages Raw.parseFit+parseMessages = fmap toMessages FF.parseFit -toMessages :: Raw.Fit -> Messages-toMessages rFit = Messages . S.fromList . catMaybes $ fmap toMessage (Raw.fMessages rFit)+toMessages :: FF.Fit -> Messages+toMessages rFit = Messages . S.fromList . catMaybes $ fmap toMessage (FF.fMessages rFit) -toMessage :: Raw.Message -> Maybe Message-toMessage (Raw.DefM _) = Nothing-toMessage (Raw.DataM _ gmt fields) = Just $ Message gmt (foldr go Map.empty fields)-  where go f@(Raw.SingletonField num _) fieldMap = Map.insert num (toField f) fieldMap-        go f@(Raw.ArrayField num _) fieldMap = Map.insert num (toField f) fieldMap+toMessage :: FF.Message -> Maybe Message+toMessage (FF.DefM _) = Nothing+toMessage (FF.DataM _ gmt fields) = Just $ Message gmt (foldr go Map.empty fields)+  where go f@(FF.SingletonField num _) fieldMap = Map.insert num (toField f) fieldMap+        go f@(FF.ArrayField num _) fieldMap = Map.insert num (toField f) fieldMap -toField :: Raw.Field -> Field-toField (Raw.SingletonField num value) = Field num . Singleton $ (fromSingletonValue value)-toField (Raw.ArrayField num array) = Field num . Array $ (fromArray array)+toField :: FF.Field -> Field+toField (FF.SingletonField num value) = Field num . Singleton $ (fromSingletonValue value)+toField (FF.ArrayField num array) = Field num . Array $ (fromArray array) -fromSingletonValue :: Raw.Value -> SingletonValue+fromSingletonValue :: FF.Value -> SingletonValue fromSingletonValue v =   case v of-   Raw.EnumValue i -> IntValue (fromIntegral i)-   Raw.SInt8Value i -> IntValue (fromIntegral i)-   Raw.UInt8Value i -> IntValue (fromIntegral i)-   Raw.SInt16Value i -> IntValue (fromIntegral i)-   Raw.UInt16Value i -> IntValue (fromIntegral i)-   Raw.SInt32Value i -> IntValue (fromIntegral i)-   Raw.UInt32Value i -> IntValue (fromIntegral i)-   Raw.StringValue t -> TextValue t-   Raw.Float32Value f -> RealValue (fromRational (toRational f))-   Raw.Float64Value f -> RealValue f-   Raw.UInt8ZValue i -> IntValue (fromIntegral i)-   Raw.UInt16ZValue i -> IntValue (fromIntegral i)-   Raw.UInt32ZValue i -> IntValue (fromIntegral i)-   Raw.ByteValue b -> ByteValue b+   FF.EnumValue i -> IntValue (fromIntegral i)+   FF.SInt8Value i -> IntValue (fromIntegral i)+   FF.UInt8Value i -> IntValue (fromIntegral i)+   FF.SInt16Value i -> IntValue (fromIntegral i)+   FF.UInt16Value i -> IntValue (fromIntegral i)+   FF.SInt32Value i -> IntValue (fromIntegral i)+   FF.UInt32Value i -> IntValue (fromIntegral i)+   FF.StringValue t -> TextValue t+   FF.Float32Value f -> RealValue (fromRational (toRational f))+   FF.Float64Value f -> RealValue f+   FF.UInt8ZValue i -> IntValue (fromIntegral i)+   FF.UInt16ZValue i -> IntValue (fromIntegral i)+   FF.UInt32ZValue i -> IntValue (fromIntegral i)+   FF.ByteValue b -> ByteValue b -fromArray :: Raw.Array -> ArrayValue+fromArray :: FF.Array -> ArrayValue fromArray a =   case a of-   Raw.EnumArray xs -> intArray xs-   Raw.SInt8Array xs -> intArray xs-   Raw.UInt8Array xs -> intArray xs-   Raw.SInt16Array xs -> intArray xs-   Raw.UInt16Array xs -> intArray xs-   Raw.SInt32Array xs -> intArray xs-   Raw.UInt32Array xs -> intArray xs-   Raw.Float32Array xs -> realArray xs-   Raw.Float64Array xs -> realArray xs-   Raw.UInt8ZArray xs -> intArray xs-   Raw.UInt16ZArray xs -> intArray xs-   Raw.UInt32ZArray xs -> intArray xs-   Raw.ByteArray bs -> ByteArray . B.pack $ F.toList bs+   FF.EnumArray xs -> intArray xs+   FF.SInt8Array xs -> intArray xs+   FF.UInt8Array xs -> intArray xs+   FF.SInt16Array xs -> intArray xs+   FF.UInt16Array xs -> intArray xs+   FF.SInt32Array xs -> intArray xs+   FF.UInt32Array xs -> intArray xs+   FF.Float32Array xs -> realArray xs+   FF.Float64Array xs -> realArray xs+   FF.UInt8ZArray xs -> intArray xs+   FF.UInt16ZArray xs -> intArray xs+   FF.UInt32ZArray xs -> intArray xs+   FF.ByteArray bs -> ByteArray . B.pack $ F.toList bs   where intArray is = IntArray $ fmap fromIntegral is         realArray rs = RealArray $ fmap (fromRational . toRational) rs
src/Fit/Messages/Lens.hs view
@@ -1,14 +1,23 @@--- | Some basic lenses for the Messages API. These are compatible with both lens and lens-family.--- This package doesn't provide any lens combinators like @^.@ or @^..@, so you'll need to use--- ones from a lens package.------ For example, the following code gets the values of the 'speed' fields--- from all of the 'record' messages in the file:------ @--- Right fit <- readFileMessages "file.fit"--- let speeds = fit ^.. message 20 . field 6 . int--- @+{-|+Module      : Fit.Messages.Lens+Copyright   : Copyright 2014-2015, Matt Giles+License     : Modified BSD License (see LICENSE file)+Maintainer  : matt.w.giles@gmail.com+Stability   : experimental++Some basic lenses for the Messages API. These are compatible with both lens and lens-family.+This package doesn't provide any lens combinators like @^.@ or @^..@, so you'll need to use+ones from a lens package.++For example, the following code gets the values of the 'speed' fields+from all of the 'record' messages in the file:++@+Right fit <- readFileMessages "file.fit"+let speeds = fit ^.. message 20 . field 6 . int+@+-}+ module Fit.Messages.Lens (   -- * Messages   messages,@@ -34,21 +43,23 @@  import Fit.Messages -import Control.Applicative ((<$>), pure, Applicative)+import Control.Applicative import Data.ByteString (ByteString) import Data.Functor.Contravariant (Contravariant, contramap) import qualified Data.IntMap as Map (filterWithKey) import Data.Sequence (Seq) import qualified Data.Sequence as S (filter) import Data.Text (Text)-import Data.Traversable (traverse)+import Data.Traversable import Data.Word (Word8) +import Prelude+ -- Helper for building Folds coerce :: (Contravariant f, Applicative f) => f a -> f b coerce = contramap (const ()) . fmap (const ()) --- | Traverse all the messages in a @Messages@+-- | Traverse all the messages in a 'Messages' -- -- @messages :: Traversal' Messages Message@ messages :: Applicative f => (Message -> f Message) -> Messages -> f Messages@@ -63,21 +74,21 @@   where targets = S.filter ((== msgNum) . _mNumber) (_messages ms) {-# INLINE message #-} --- | Lens on the message number from a @Message@+-- | Lens on the message number from a 'Message' -- -- @messageNumber :: Lens' Message Int@ messageNumber :: Functor f => (Int -> f Int) -> Message -> f Message messageNumber f m = (\n -> m { _mNumber = n }) <$> f (_mNumber m) {-# INLINE messageNumber #-} --- | Traverse all the fields in a @Message@+-- | Traverse all the fields in a 'Message' -- -- @fields :: Traversal' Message Field@ fields :: Applicative f => (Field -> f Field) -> Message -> f Message fields f (Message n flds) = Message n <$> traverse f flds {-# INLINE fields #-} --- | A Fold over the fields in a @Message@ with the given field number+-- | A Fold over the fields in a 'Message' with the given field number -- -- @field :: Int -> Fold Message Field@ field :: (Contravariant f, Applicative f) => Int -> (Field -> f Field) -> Message -> f Message@@ -85,14 +96,14 @@   where targetFields = Map.filterWithKey (\k _ -> k == n) (_mFields msg) {-# INLINE field #-} --- | Lens on the field number from a @Field@+-- | Lens on the field number from a 'Field' -- -- @fieldNumber :: Lens Field Int@ fieldNumber :: Functor f => (Int -> f Int) -> Field -> f Field fieldNumber f fld = (\n -> fld { _fNumber = n }) <$> f (_fNumber fld) {-# INLINE fieldNumber #-} --- | Lens on the @Value@ from a @Field@+-- | Lens on the 'Value' from a 'Field' -- -- @fieldValue :: Lens Field Value@ fieldValue :: Functor f => (Value -> f Value) -> Field -> f Field@@ -103,13 +114,13 @@ -- $values -- Generally when you're looking up the value for a particular field you'll know -- the expected type ahead of time. If you know the field you're looking at holds--- integers, then you can use @int@ to directly get an @Int@ instead of a+-- integers, then you can use 'int' to directly get an 'Int' instead of a -- @Singleton (IntValue x)@. ----- These traversals are not prisms, because to reconstruct the @Field@ we need+-- These traversals are not prisms, because to reconstruct the 'Field' we need -- the field number in addition to the wrapped value. --- | Traverse the @Singleton@ and @IntValue@ constructors for a field value+-- | Traverse the 'Singleton' and 'IntValue' constructors for a field value -- -- @int :: Traversal' Field Int@ int :: Applicative f => (Int -> f Int) -> Field -> f Field@@ -117,7 +128,7 @@ int _ fld = pure fld {-# INLINE int #-} --- | Traverse the @Singleton@ and @RealValue@ constructors for a field value+-- | Traverse the 'Singleton' and 'RealValue' constructors for a field value -- -- @real :: Traversal' Field Double@ real :: Applicative f => (Double -> f Double) -> Field -> f Field@@ -125,7 +136,7 @@ real _ fld = pure fld {-# INLINE real #-} --- | Traverse the @Singleton@ and @TextValue@ constructors for a field value+-- | Traverse the 'Singleton' and 'TextValue' constructors for a field value -- -- @text :: Traversal' Field Text@ text :: Applicative f => (Text -> f Text) -> Field -> f Field@@ -133,7 +144,7 @@ text _ fld = pure fld {-# INLINE text #-} --- | Traverse the @Singleton@ and @ByteValue@ constructors for a field value+-- | Traverse the 'Singleton' and 'ByteValue' constructors for a field value -- -- @byte :: Traversal' Field Word8@ byte :: Applicative f => (Word8 -> f Word8) -> Field -> f Field@@ -141,7 +152,7 @@ byte _ fld = pure fld {-# INLINE byte #-} --- | Traverse the @Array@ and @IntArray@ constructors for a field value+-- | Traverse the 'Array' and 'IntArray' constructors for a field value -- -- @ints :: Traversal' Field (Seq Int)@ ints :: Applicative f => (Seq Int -> f (Seq Int)) -> Field -> f Field@@ -149,7 +160,7 @@ ints _ fld = pure fld {-# INLINE ints #-} --- | Traverse the @Array@ and @RealArray@ constructors for a field value+-- | Traverse the 'Array' and 'RealArray' constructors for a field value -- -- @reals :: Traversal' Field (Seq Double)@ reals :: Applicative f => (Seq Double -> f (Seq Double)) -> Field -> f Field@@ -157,7 +168,7 @@ reals _ fld = pure fld {-# INLINE reals #-} --- | Travese the @Array@ and @ByteArray@ constructors for a field value+-- | Travese the 'Array' and 'ByteArray' constructors for a field value -- -- @bytestring :: Traversal' Field ByteString@ bytestring :: Applicative f => (ByteString -> f ByteString) -> Field -> f Field