Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use bang patterns in example data type

Using strict fields is the right default. Among other things, this
removes the risk of creating thunks in the field conversion.
  • Loading branch information...
commit f088c35093735770522cebb54c88fa5ac064c07f 1 parent 9de2961
@tibbe authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 Data/Csv/Conversion.hs
View
8 Data/Csv/Conversion.hs
@@ -82,7 +82,7 @@ import qualified Data.IntMap as IM
--
-- here's an example type and instance:
--
--- > data Person = Person { name :: Text, age :: Int }
+-- > data Person = Person { name :: !Text, age :: !Int }
-- >
-- > instance FromRecord Person where
-- > parseRecord v
@@ -109,7 +109,7 @@ newtype Only a = Only {
--
-- An example type and instance:
--
--- > data Person = Person { name :: Text, age :: Int }
+-- > data Person = Person { name :: !Text, age :: !Int }
-- >
-- > instance ToRecord Person where
-- > toRecord (Person name age) = 'record' [
@@ -286,7 +286,7 @@ instance (ToField a, U.Unbox a) => ToRecord (U.Vector a) where
--
-- > {-# LANGUAGE OverloadedStrings #-}
-- >
--- > data Person = Person { name :: Text, age :: Int }
+-- > data Person = Person { name :: !Text, age :: !Int }
-- >
-- > instance FromRecord Person where
-- > parseNamedRecord m = Person <$>
@@ -307,7 +307,7 @@ class FromNamedRecord a where
--
-- An example type and instance:
--
--- > data Person = Person { name :: Text, age :: Int }
+-- > data Person = Person { name :: !Text, age :: !Int }
-- >
-- > instance ToRecord Person where
-- > toNamedRecord (Person name age) = namedRecord [
Please sign in to comment.
Something went wrong with that request. Please try again.