/usr/share/doc/libghc-csv-conduit-doc/html/Data-CSV-Conduit-Conversion.html is in libghc-csv-conduit-doc 0.6.7-1build7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Data.CSV.Conduit.Conversion</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-CSV-Conduit-Conversion.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-CSV-Conduit-Conversion.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">csv-conduit-0.6.7: A flexible, fast, conduit-based CSV parser library for Haskell.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>Ozgun Ataman Johan Tibell</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>Ozgun Ataman <ozataman@gmail.com></td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.CSV.Conduit.Conversion</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Type conversion</a></li><li><a href="#g:2">Parser</a></li><li><a href="#g:3">Accessors</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module has been shamelessly taken from Johan Tibell's nicely
put together cassava package, which itself borrows the approach
from Bryan O<code>Sullivan</code>s widely used aeson package.</p><p>We make the necessary adjustments and some simplifications here to
bolt this parsing interface onto our underlying <a href="CSV.html">CSV</a> typeclass.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">newtype</span> <a href="#t:Only">Only</a> a = <a href="#v:Only">Only</a> {<ul class="subs"><li><a href="#v:fromOnly">fromOnly</a> :: a</li></ul>}</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Named">Named</a> a = <a href="#v:Named">Named</a> {<ul class="subs"><li><a href="#v:getNamed">getNamed</a> :: a</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:Record">Record</a> = <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:NamedRecord">NamedRecord</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><span class="keyword">class</span> <a href="#t:FromRecord">FromRecord</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:FromNamedRecord">FromNamedRecord</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:ToNamedRecord">ToNamedRecord</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:FromField">FromField</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:ToRecord">ToRecord</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="#t:ToField">ToField</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">type</span> <a href="#t:Field">Field</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:runParser">runParser</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> a</li><li class="src short"><a href="#v:index">index</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:.-33-">(.!)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:unsafeIndex">unsafeIndex</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:lookup">lookup</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:.:">(.:)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:namedField">namedField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:.-61-">(.=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>)</li><li class="src short"><a href="#v:record">record</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>] -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a></li><li class="src short"><a href="#v:namedRecord">namedRecord</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>)] -> <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a></li></ul></div><div id="interface"><h1 id="g:1">Type conversion</h1><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:Only" class="def">Only</a> a <a href="src/Data-CSV-Conduit-Conversion.html#Only" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></p><div class="doc"><p>Haskell lacks a single-element tuple type, so if you CSV data
with just one column you can use the <code><a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a></code> type to represent a
single-column result.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Only" class="def">Only</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:fromOnly" class="def">fromOnly</a> :: a</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Only" class="caption collapser" onclick="toggleSection('i:Only')">Instances</p><div id="section.i:Only" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Only:Eq:1" class="instance expander" onclick="toggleSection('i:id:Only:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-166" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Only:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Only:Ord:2" class="instance expander" onclick="toggleSection('i:id:Only:Ord:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-166" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Only:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(<)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(<=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(>)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(>=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Only:Read:3" class="instance expander" onclick="toggleSection('i:id:Only:Read:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Read.html#t:Read">Read</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Read.html#t:Read">Read</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-166" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Only:Read:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a) <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a) <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Only:Show:4" class="instance expander" onclick="toggleSection('i:id:Only:Show:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-166" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Only:Show:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Only:ToRecord:5" class="instance expander" onclick="toggleSection('i:id:Only:ToRecord:5')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-199" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Only:ToRecord:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Only:FromRecord:6" class="instance expander" onclick="toggleSection('i:id:Only:FromRecord:6')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-190" class="link">Source</a> <a href="#t:Only" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Only:FromRecord:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:Named" class="def">Named</a> a <a href="src/Data-CSV-Conduit-Conversion.html#Named" class="link">Source</a> <a href="#t:Named" class="selflink">#</a></p><div class="doc"><p>A wrapper around custom haskell types that can directly be
converted/parsed from an incoming CSV stream.</p><p>We define this wrapper to stop GHC from complaining
about overlapping instances. Just use <code><a href="Data-CSV-Conduit-Conversion.html#v:getNamed">getNamed</a></code> to get your
object out of the wrapper.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Named" class="def">Named</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:getNamed" class="def">getNamed</a> :: a</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Named" class="caption collapser" onclick="toggleSection('i:Named')">Instances</p><div id="section.i:Named" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Named:CSV:1" class="instance expander" onclick="toggleSection('i:id:Named:CSV:1')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromNamedRecord">FromNamedRecord</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToNamedRecord">ToNamedRecord</a> a, <a href="Data-CSV-Conduit.html#t:CSV">CSV</a> s (<a href="Data-CSV-Conduit-Types.html#t:MapRow">MapRow</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>)) => <a href="Data-CSV-Conduit.html#t:CSV">CSV</a> s (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a)</span> <a href="src/Data-CSV-Conduit.html#line-242" class="link">Source</a> <a href="#t:CSV" class="selflink">#</a></td><td class="doc"><p>Conversion of stream directly to/from a custom complex haskell
type.</p></td></tr><tr><td colspan="2"><div id="section.i:id:Named:CSV:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rowToStr">rowToStr</a> :: <a href="Data-CSV-Conduit-Types.html#t:CSVSettings">CSVSettings</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> s <a href="src/Data-CSV-Conduit.html#rowToStr" class="link">Source</a> <a href="#v:rowToStr" class="selflink">#</a></p><p class="src"><a href="#v:intoCSV">intoCSV</a> :: <a href="file:///usr/share/doc/libghc-resourcet-doc/html/Control-Monad-Trans-Resource.html#t:MonadThrow">MonadThrow</a> m => <a href="Data-CSV-Conduit-Types.html#t:CSVSettings">CSVSettings</a> -> <a href="file:///usr/share/doc/libghc-conduit-doc/html/Data-Conduit.html#t:Conduit">Conduit</a> s m (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a) <a href="src/Data-CSV-Conduit.html#intoCSV" class="link">Source</a> <a href="#v:intoCSV" class="selflink">#</a></p><p class="src"><a href="#v:fromCSV">fromCSV</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Data-CSV-Conduit-Types.html#t:CSVSettings">CSVSettings</a> -> <a href="file:///usr/share/doc/libghc-conduit-doc/html/Data-Conduit.html#t:Conduit">Conduit</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a) m s <a href="src/Data-CSV-Conduit.html#fromCSV" class="link">Source</a> <a href="#v:fromCSV" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Named:Eq:2" class="instance expander" onclick="toggleSection('i:id:Named:Eq:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-119" class="link">Source</a> <a href="#t:Named" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Named:Eq:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Named:Ord:3" class="instance expander" onclick="toggleSection('i:id:Named:Ord:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-119" class="link">Source</a> <a href="#t:Named" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Named:Ord:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(<)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(<=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(>)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(>=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Named:Read:4" class="instance expander" onclick="toggleSection('i:id:Named:Read:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Read.html#t:Read">Read</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Read.html#t:Read">Read</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-119" class="link">Source</a> <a href="#t:Named" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Named:Read:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a) <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a) <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Named:Show:5" class="instance expander" onclick="toggleSection('i:id:Named:Show:5')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-119" class="link">Source</a> <a href="#t:Named" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Named:Show:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-CSV-Conduit-Conversion.html#t:Named">Named</a> a] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Record" class="def">Record</a> = <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Data-CSV-Conduit-Conversion.html#Record" class="link">Source</a> <a href="#t:Record" class="selflink">#</a></p><div class="doc"><p>A record corresponds to a single line in a CSV file.</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:NamedRecord" class="def">NamedRecord</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Data-CSV-Conduit-Conversion.html#NamedRecord" class="link">Source</a> <a href="#t:NamedRecord" class="selflink">#</a></p><div class="doc"><p>A shorthand for the ByteString case of <code>MapRow</code></p></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:FromRecord" class="def">FromRecord</a> a <span class="keyword">where</span> <a href="src/Data-CSV-Conduit-Conversion.html#FromRecord" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></p><div class="doc"><p>A type that can be converted from a single CSV record, with the
possibility of failure.</p><p>When writing an instance, use <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:empty">empty</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#v:mzero">mzero</a></code>, or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#v:fail">fail</a></code> to make a
conversion fail, e.g. if a <code><a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a></code> has the wrong number of
columns.</p><p>Given this example data:</p><pre>John,56
Jane,55</pre><p>here's an example type and instance:</p><pre>data Person = Person { name :: !Text, age :: !Int }
instance FromRecord Person where
parseRecord v
| length v == 2 = Person <$>
v .! 0 <*>
v .! 1
| otherwise = mzero</pre></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:parseRecord" class="def">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p><p class="src"><a id="v:parseRecord" class="def">parseRecord</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Generic">Generic</a> a, GFromRecord (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Rep">Rep</a> a)) => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:FromRecord" class="caption collapser" onclick="toggleSection('i:FromRecord')">Instances</p><div id="section.i:FromRecord" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:1" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:1')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> [a]</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-311" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> [a] <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:2" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:2')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-317" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:3" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:3')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed-Mutable.html#t:Unbox">Unbox</a> a) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-323" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:4" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:4')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-190" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:5" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:5')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> b) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (a, b)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-202" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a, b) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:6" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:6')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> c) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (a, b, c)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-213" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a, b, c) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:7" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:7')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> d) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (a, b, c, d)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-226" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a, b, c, d) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:8" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:8')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> d, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> e) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (a, b, c, d, e)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-242" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a, b, c, d, e) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:9" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:9')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> d, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> e, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> f) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (a, b, c, d, e, f)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-259" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a, b, c, d, e, f) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromRecord:FromRecord:10" class="instance expander" onclick="toggleSection('i:ic:FromRecord:FromRecord:10')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> d, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> e, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> f, <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> g) => <a href="Data-CSV-Conduit-Conversion.html#t:FromRecord">FromRecord</a> (a, b, c, d, e, f, g)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-278" class="link">Source</a> <a href="#t:FromRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromRecord:FromRecord:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseRecord">parseRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a, b, c, d, e, f, g) <a href="src/Data-CSV-Conduit-Conversion.html#parseRecord" class="link">Source</a> <a href="#v:parseRecord" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:FromNamedRecord" class="def">FromNamedRecord</a> a <span class="keyword">where</span> <a href="src/Data-CSV-Conduit-Conversion.html#FromNamedRecord" class="link">Source</a> <a href="#t:FromNamedRecord" class="selflink">#</a></p><div class="doc"><p>A type that can be converted from a single CSV record, with the
possibility of failure.</p><p>When writing an instance, use <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:empty">empty</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#v:mzero">mzero</a></code>, or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#v:fail">fail</a></code> to make a
conversion fail, e.g. if a <code><a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a></code> has the wrong number of
columns.</p><p>Given this example data:</p><pre>name,age
John,56
Jane,55</pre><p>here's an example type and instance:</p><pre>{-# LANGUAGE OverloadedStrings #-}
data Person = Person { name :: !Text, age :: !Int }
instance FromRecord Person where
parseNamedRecord m = Person <$>
m .: "name" <*>
m .: "age"</pre><p>Note the use of the <code>OverloadedStrings</code> language extension which
enables <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code> values to be written as string literals.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:parseNamedRecord" class="def">parseNamedRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#parseNamedRecord" class="link">Source</a> <a href="#v:parseNamedRecord" class="selflink">#</a></p><p class="src"><a id="v:parseNamedRecord" class="def">parseNamedRecord</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Generic">Generic</a> a, GFromNamedRecord (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Rep">Rep</a> a)) => <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#parseNamedRecord" class="link">Source</a> <a href="#v:parseNamedRecord" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:FromNamedRecord" class="caption collapser" onclick="toggleSection('i:FromNamedRecord')">Instances</p><div id="section.i:FromNamedRecord" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromNamedRecord:FromNamedRecord:1" class="instance expander" onclick="toggleSection('i:ic:FromNamedRecord:FromNamedRecord:1')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:FromNamedRecord">FromNamedRecord</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-383" class="link">Source</a> <a href="#t:FromNamedRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromNamedRecord:FromNamedRecord:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseNamedRecord">parseNamedRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> a) <a href="src/Data-CSV-Conduit-Conversion.html#parseNamedRecord" class="link">Source</a> <a href="#v:parseNamedRecord" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:ToNamedRecord" class="def">ToNamedRecord</a> a <span class="keyword">where</span> <a href="src/Data-CSV-Conduit-Conversion.html#ToNamedRecord" class="link">Source</a> <a href="#t:ToNamedRecord" class="selflink">#</a></p><div class="doc"><p>A type that can be converted to a single CSV record.</p><p>An example type and instance:</p><pre>data Person = Person { name :: !Text, age :: !Int }
instance ToRecord Person where
toNamedRecord (Person name age) = namedRecord [
"name" .= name, "age" .= age]</pre></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:toNamedRecord" class="def">toNamedRecord</a> :: a -> <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> <a href="src/Data-CSV-Conduit-Conversion.html#toNamedRecord" class="link">Source</a> <a href="#v:toNamedRecord" class="selflink">#</a></p><p class="src"><a id="v:toNamedRecord" class="def">toNamedRecord</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Generic">Generic</a> a, GToRecord (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Rep">Rep</a> a) (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>)) => a -> <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> <a href="src/Data-CSV-Conduit-Conversion.html#toNamedRecord" class="link">Source</a> <a href="#v:toNamedRecord" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:ToNamedRecord" class="caption collapser" onclick="toggleSection('i:ToNamedRecord')">Instances</p><div id="section.i:ToNamedRecord" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToNamedRecord:ToNamedRecord:1" class="instance expander" onclick="toggleSection('i:ic:ToNamedRecord:ToNamedRecord:1')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:ToNamedRecord">ToNamedRecord</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-386" class="link">Source</a> <a href="#t:ToNamedRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToNamedRecord:ToNamedRecord:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toNamedRecord">toNamedRecord</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/containers-0.5.7.1/Data-Map-Lazy.html#t:Map">Map</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> <a href="src/Data-CSV-Conduit-Conversion.html#toNamedRecord" class="link">Source</a> <a href="#v:toNamedRecord" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:FromField" class="def">FromField</a> a <span class="keyword">where</span> <a href="src/Data-CSV-Conduit-Conversion.html#FromField" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></p><div class="doc"><p>A type that can be converted from a single CSV field, with the
possibility of failure.</p><p>When writing an instance, use <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:empty">empty</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#v:mzero">mzero</a></code>, or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#v:fail">fail</a></code> to make a
conversion fail, e.g. if a <code><a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a></code> can't be converted to the given
type.</p><p>Example type and instance:</p><pre>{-# LANGUAGE OverloadedStrings #-}
data Color = Red | Green | Blue
instance FromField Color where
parseField s
| s == "R" = pure Red
| s == "G" = pure Green
| s == "B" = pure Blue
| otherwise = mzero</pre></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-CSV-Conduit-Conversion.html#v:parseField">parseField</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:parseField" class="def">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:FromField" class="caption collapser" onclick="toggleSection('i:FromField')">Instances</p><div id="section.i:FromField" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:1" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:1')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-453" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Assumes UTF-8 encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:2" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:2')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-468" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts same syntax as <code>rational</code>.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:3" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:3')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Float">Float</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-479" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts same syntax as <code>rational</code>.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Float">Float</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:4" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:4')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-496" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts a signed decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:5" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:5')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int8">Int8</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-516" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts a signed decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int8">Int8</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:6" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:6')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int16">Int16</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-526" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts a signed decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int16">Int16</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:7" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:7')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-536" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts a signed decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:8" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:8')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-546" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts a signed decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:9" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:9')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-506" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts a signed decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:10" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:10')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word">Word</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-556" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts an unsigned decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word">Word</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:11" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:11')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-566" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts an unsigned decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:12" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:12')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word16">Word16</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-576" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts an unsigned decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:12" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word16">Word16</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:13" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:13')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word32">Word32</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-586" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts an unsigned decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:13" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word32">Word32</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:14" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:14')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word64">Word64</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-596" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Accepts an unsigned decimal number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:14" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word64">Word64</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:15" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:15')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> ()</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-448" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Ignores the <code><a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a></code>. Always succeeds.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:15" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> () <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:16" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:16')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-613" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:16" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:17" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:17')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-605" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:17" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:18" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:18')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-632" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Assumes UTF-8 encoding. Fails on invalid byte sequences.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:18" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:19" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:19')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-622" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Assumes UTF-8 encoding. Fails on invalid byte sequences.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:19" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:20" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:20')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>]</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-642" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p>Assumes UTF-8 encoding. Fails on invalid byte sequences.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:20" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>] <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:FromField:FromField:21" class="instance expander" onclick="toggleSection('i:ic:FromField:FromField:21')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-436" class="link">Source</a> <a href="#t:FromField" class="selflink">#</a></td><td class="doc"><p><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if the <code><a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a></code> is <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#v:empty">empty</a></code>, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#v:Just">Just</a></code> otherwise.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:FromField:FromField:21" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:parseField">parseField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a) <a href="src/Data-CSV-Conduit-Conversion.html#parseField" class="link">Source</a> <a href="#v:parseField" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:ToRecord" class="def">ToRecord</a> a <span class="keyword">where</span> <a href="src/Data-CSV-Conduit-Conversion.html#ToRecord" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></p><div class="doc"><p>A type that can be converted to a single CSV record.</p><p>An example type and instance:</p><pre>data Person = Person { name :: !Text, age :: !Int }
instance ToRecord Person where
toRecord (Person name age) = record [
toField name, toField age]</pre><p>Outputs data on this form:</p><pre>John,56
Jane,55</pre></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:toRecord" class="def">toRecord</a> :: a -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p><p class="src"><a id="v:toRecord" class="def">toRecord</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Generic">Generic</a> a, GToRecord (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Generics.html#t:Rep">Rep</a> a) <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a>) => a -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:ToRecord" class="caption collapser" onclick="toggleSection('i:ToRecord')">Instances</p><div id="section.i:ToRecord" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:1" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:1')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> [a]</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-314" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: [a] -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:2" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:2')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-320" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#t:Vector">Vector</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:3" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:3')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed-Mutable.html#t:Unbox">Unbox</a> a) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (<a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-326" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: <a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector-Unboxed.html#t:Vector">Vector</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:4" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:4')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-199" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Only">Only</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:5" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:5')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> b) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (a, b)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-210" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: (a, b) -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:6" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:6')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> c) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (a, b, c)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-222" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: (a, b, c) -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:7" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:7')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> d) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (a, b, c, d)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-237" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: (a, b, c, d) -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:8" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:8')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> d, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> e) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (a, b, c, d, e)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-254" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: (a, b, c, d, e) -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:9" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:9')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> d, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> e, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> f) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (a, b, c, d, e, f)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-273" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: (a, b, c, d, e, f) -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToRecord:ToRecord:10" class="instance expander" onclick="toggleSection('i:ic:ToRecord:ToRecord:10')"></span> (<a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> b, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> c, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> d, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> e, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> f, <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> g) => <a href="Data-CSV-Conduit-Conversion.html#t:ToRecord">ToRecord</a> (a, b, c, d, e, f, g)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-293" class="link">Source</a> <a href="#t:ToRecord" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToRecord:ToRecord:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toRecord">toRecord</a> :: (a, b, c, d, e, f, g) -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#toRecord" class="link">Source</a> <a href="#v:toRecord" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a id="t:ToField" class="def">ToField</a> a <span class="keyword">where</span> <a href="src/Data-CSV-Conduit-Conversion.html#ToField" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></p><div class="doc"><p>A type that can be converted to a single CSV field.</p><p>Example type and instance:</p><pre>{-# LANGUAGE OverloadedStrings #-}
data Color = Red | Green | Blue
instance ToField Color where
toField Red = "R"
toField Green = "G"
toField Blue = "B"</pre></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-CSV-Conduit-Conversion.html#v:toField">toField</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:toField" class="def">toField</a> :: a -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:ToField" class="caption collapser" onclick="toggleSection('i:ToField')">Instances</p><div id="section.i:ToField" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:1" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:1')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-463" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses UTF-8 encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:2" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:2')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-474" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal notation or scientific notation, depending on the
number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:3" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:3')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Float">Float</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-485" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal notation or scientific notation, depending on the
number.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Float">Float</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:4" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:4')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-501" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding with optional sign.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:5" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:5')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int8">Int8</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-521" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding with optional sign.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int8">Int8</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:6" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:6')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int16">Int16</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-531" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding with optional sign.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int16">Int16</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:7" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:7')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-541" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding with optional sign.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:7" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int32">Int32</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:8" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:8')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-551" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding with optional sign.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:8" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:9" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:9')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-511" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding with optional sign.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:9" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:10" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:10')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word">Word</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-561" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:10" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word">Word</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:11" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:11')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-571" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:11" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word8">Word8</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:12" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:12')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word16">Word16</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-581" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:12" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word16">Word16</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:13" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:13')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word32">Word32</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-591" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:13" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word32">Word32</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:14" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:14')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word64">Word64</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-601" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses decimal encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:14" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Word.html#t:Word64">Word64</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:15" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:15')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-617" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:15" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:16" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:16')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-609" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:16" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:17" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:17')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-637" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses UTF-8 encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:17" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text-Lazy.html#t:Text">Text</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:18" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:18')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-627" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses UTF-8 encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:18" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/libghc-text-doc/html/Data-Text.html#t:Text">Text</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:19" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:19')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>]</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-647" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p>Uses UTF-8 encoding.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:19" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Char.html#t:Char">Char</a>] -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ToField:ToField:20" class="instance expander" onclick="toggleSection('i:ic:ToField:ToField:20')"></span> <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-443" class="link">Source</a> <a href="#t:ToField" class="selflink">#</a></td><td class="doc"><p><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> is encoded as an <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#v:empty">empty</a></code> field.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ToField:ToField:20" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:toField">toField</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Field">Field</a> <a href="src/Data-CSV-Conduit-Conversion.html#toField" class="link">Source</a> <a href="#v:toField" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Field" class="def">Field</a> = <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Data-CSV-Conduit-Conversion.html#Field" class="link">Source</a> <a href="#t:Field" class="selflink">#</a></p><div class="doc"><p>A single field within a record.</p></div></div><h1 id="g:2">Parser</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Parser" class="def">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#Parser" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></p><div class="doc"><p>Conversion of a field to a value might fail e.g. if the field is
malformed. This possibility is captured by the <code><a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></code> type, which
lets you compose several field conversions together in such a way
that if any of them fail, the whole record conversion fails.</p></div><div class="subs instances"><p id="control.i:Parser" class="caption collapser" onclick="toggleSection('i:Parser')">Instances</p><div id="section.i:Parser" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Parser:Monad:1" class="instance expander" onclick="toggleSection('i:id:Parser:Monad:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#t:Monad">Monad</a> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-749" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Parser:Monad:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(>>=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> (a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b) -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b <a href="#v:-62--62--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62--62-">(>>)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b <a href="#v:-62--62-" class="selflink">#</a></p><p class="src"><a href="#v:return">return</a> :: a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:return" class="selflink">#</a></p><p class="src"><a href="#v:fail">fail</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:fail" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Parser:Functor:2" class="instance expander" onclick="toggleSection('i:id:Parser:Functor:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Functor.html#t:Functor">Functor</a> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-758" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Parser:Functor:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -> b) -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(<$)</a> :: a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Parser:Applicative:3" class="instance expander" onclick="toggleSection('i:id:Parser:Applicative:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Applicative">Applicative</a> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-763" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Parser:Applicative:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(<*>)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> (a -> b) -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*>)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(<*)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> b -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:-60--42-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Parser:Alternative:4" class="instance expander" onclick="toggleSection('i:id:Parser:Alternative:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#t:Alternative">Alternative</a> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-769" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Parser:Alternative:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:empty">empty</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:empty" class="selflink">#</a></p><p class="src"><a href="#v:-60--124--62-">(<|>)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:-60--124--62-" class="selflink">#</a></p><p class="src"><a href="#v:some">some</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> [a] <a href="#v:some" class="selflink">#</a></p><p class="src"><a href="#v:many">many</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> [a] <a href="#v:many" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Parser:MonadPlus:5" class="instance expander" onclick="toggleSection('i:id:Parser:MonadPlus:5')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Monad.html#t:MonadPlus">MonadPlus</a> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></span> <a href="src/Data-CSV-Conduit-Conversion.html#line-775" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Parser:MonadPlus:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mzero">mzero</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:mzero" class="selflink">#</a></p><p class="src"><a href="#v:mplus">mplus</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:mplus" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Parser:Monoid:6" class="instance expander" onclick="toggleSection('i:id:Parser:Monoid:6')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a)</span> <a href="src/Data-CSV-Conduit-Conversion.html#line-782" class="link">Source</a> <a href="#t:Parser" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Parser:Monoid:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mempty">mempty</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:mempty" class="selflink">#</a></p><p class="src"><a href="#v:mappend">mappend</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:mappend" class="selflink">#</a></p><p class="src"><a href="#v:mconcat">mconcat</a> :: [<a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a] -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="#v:mconcat" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:runParser" class="def">runParser</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#t:Either">Either</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> a <a href="src/Data-CSV-Conduit-Conversion.html#runParser" class="link">Source</a> <a href="#v:runParser" class="selflink">#</a></p><div class="doc"><p>Run a <code><a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a></code>, returning either <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#v:Left">Left</a></code> errMsg</code> or <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#v:Right">Right</a></code>
result</code>. Forces the value in the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#v:Left">Left</a></code> or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Either.html#v:Right">Right</a></code> constructors to
weak head normal form.</p><p>You most likely won't need to use this function directly, but it's
included for completeness.</p></div></div><h1 id="g:3">Accessors</h1><div class="top"><p class="src"><a id="v:index" class="def">index</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#index" class="link">Source</a> <a href="#v:index" class="selflink">#</a></p><div class="doc"><p>Retrieve the <em>n</em>th field in the given record. The result is
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:empty">empty</a></code> if the value cannot be converted to the desired type.
Raises an exception if the index is out of bounds.</p><p><code><a href="Data-CSV-Conduit-Conversion.html#v:index">index</a></code> is a simple convenience function that is equivalent to
<code><code><a href="Data-CSV-Conduit-Conversion.html#v:parseField">parseField</a></code> (v <code><a href="file:///usr/share/doc/libghc-vector-doc/html/Data-Vector.html#v:-33-">!</a></code> idx)</code>. If you're certain that the index is not
out of bounds, using <code><a href="Data-CSV-Conduit-Conversion.html#v:unsafeIndex">unsafeIndex</a></code> is somewhat faster.</p></div></div><div class="top"><p class="src"><a id="v:.-33-" class="def">(.!)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <span class="fixity">infixl 9</span><span class="rightedge"></span> <a href="src/Data-CSV-Conduit-Conversion.html#.%21" class="link">Source</a> <a href="#v:.-33-" class="selflink">#</a></p><div class="doc"><p>Alias for <code><a href="Data-CSV-Conduit-Conversion.html#v:index">index</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:unsafeIndex" class="def">unsafeIndex</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#unsafeIndex" class="link">Source</a> <a href="#v:unsafeIndex" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Data-CSV-Conduit-Conversion.html#v:index">index</a></code> but without bounds checking.</p></div></div><div class="top"><p class="src"><a id="v:lookup" class="def">lookup</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#lookup" class="link">Source</a> <a href="#v:lookup" class="selflink">#</a></p><div class="doc"><p>Retrieve a field in the given record by name. The result is
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Control-Applicative.html#v:empty">empty</a></code> if the field is missing or if the value cannot be converted
to the desired type.</p></div></div><div class="top"><p class="src"><a id="v:.:" class="def">(.:)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:FromField">FromField</a> a => <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="Data-CSV-Conduit-Conversion.html#t:Parser">Parser</a> a <a href="src/Data-CSV-Conduit-Conversion.html#.%3A" class="link">Source</a> <a href="#v:.:" class="selflink">#</a></p><div class="doc"><p>Alias for <code><a href="Data-CSV-Conduit-Conversion.html#v:lookup">lookup</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:namedField" class="def">namedField</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>) <a href="src/Data-CSV-Conduit-Conversion.html#namedField" class="link">Source</a> <a href="#v:namedField" class="selflink">#</a></p><div class="doc"><p>Construct a pair from a name and a value. For use with
<code><a href="Data-CSV-Conduit-Conversion.html#v:namedRecord">namedRecord</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:.-61-" class="def">(.=)</a> :: <a href="Data-CSV-Conduit-Conversion.html#t:ToField">ToField</a> a => <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -> a -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>) <a href="src/Data-CSV-Conduit-Conversion.html#.%3D" class="link">Source</a> <a href="#v:.-61-" class="selflink">#</a></p><div class="doc"><p>Alias for <code><a href="Data-CSV-Conduit-Conversion.html#v:namedField">namedField</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:record" class="def">record</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>] -> <a href="Data-CSV-Conduit-Conversion.html#t:Record">Record</a> <a href="src/Data-CSV-Conduit-Conversion.html#record" class="link">Source</a> <a href="#v:record" class="selflink">#</a></p><div class="doc"><p>Construct a record from a list of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s. Use <code><a href="Data-CSV-Conduit-Conversion.html#v:toField">toField</a></code>
to convert values to <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>s for use with <code><a href="Data-CSV-Conduit-Conversion.html#v:record">record</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:namedRecord" class="def">namedRecord</a> :: [(<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a>)] -> <a href="Data-CSV-Conduit-Conversion.html#t:NamedRecord">NamedRecord</a> <a href="src/Data-CSV-Conduit-Conversion.html#namedRecord" class="link">Source</a> <a href="#v:namedRecord" class="selflink">#</a></p><div class="doc"><p>Construct a named record from a list of name-value <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></code>
pairs. Use <code><a href="Data-CSV-Conduit-Conversion.html#v:.-61-">.=</a></code> to construct such a pair from a name and a value.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|