Permalink
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...
1 parent 9de2961 commit f088c35093735770522cebb54c88fa5ac064c07f @tibbe committed Feb 23, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 Data/Csv/Conversion.hs
View
@@ -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 [

0 comments on commit f088c35

Please sign in to comment.