<div dir="ltr">Thank you, that works.<div><br></div><div>I started down this road but I only got to:<div><br></div><div>instance FromRow IIM where <br>  fromRow = IIM <$> field <br>                <*> field <br>                <*> field <br>                <*> T.fromPGArray  (fmap T.fromPGArray field)<br></div><div><br></div><div>Which I expected to work based on the fact that this is what I need to convert (PGArray (PGArray Double)) to [[Double]].</div><div><br></div><div>Why is there an additional fmap needed?</div><div><br><br>On Saturday, December 27, 2014 10:23:47 PM UTC+11, Tom Ellis wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Fri, Dec 26, 2014 at 09:31:02PM -0800, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="hezerW1nprEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">in...@rotnetix.com</a> wrote:
<br>> I would actually like my data IIM to be:
<br>> 
<br>> data IIM = IIM {key :: String
<br>>                ,itype :: String
<br>>                ,idet :: Maybe String
<br>>                ,imat :: [[Double]]} deriving (Read, Show, Eq)
<br>> 
<br>> But I can't figure out how to get a fromRow instance for that
<br>
<br>instance FromRow IIM where 
<br>  fromRow = IIM <$> field
<br>                <*> field
<br>                <*> field
<br>                <*> fmap (T.fromPGArray . fmap T.fromPGArray) field
<br>
<br>> PS. I started looking into Opaleye as a possible DSL and would appreciate 
<br>> any help you can give me in figuring out how to represent arrays in that. 
<br>>  I am assuming I need to do something with queryRunnerColumn but I was not 
<br>> able to understand the example.
<br>
<br>This is indeed somewhat fiddly to do because it requires fiddling with the
<br>implementation of postgresql-simple instances.  Unfortunately that library
<br>does not provide us with enough primitives to do this directly.
<br>
<br>I will work on this.
<br>
<br>Tom
<br>
<br>______________________________<wbr>_________________
<br>Haskell-Cafe mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="hezerW1nprEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">Haskel...@haskell.org</a>
<br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.haskell.org%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNHiVycCM53czUVzPma4Fkb_wPqP2A';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.haskell.org%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNHiVycCM53czUVzPma4Fkb_wPqP2A';return true;">http://www.haskell.org/<wbr>mailman/listinfo/haskell-cafe</a>
<br></blockquote></div></div></div>