<div dir="ltr"><div><div>It works !!! (^O^)<br></div>Thank you so much.<br><br></div>Have a nice day~!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-22 22:31 GMT+09:00 Francesco Ariis <span dir="ltr"><<a href="mailto:fa-ml@ariis.it" target="_blank">fa-ml@ariis.it</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Feb 22, 2017 at 09:02:22PM +0900, S. H. Aegis wrote:<br>
> Thank you so much.<br>
><br>
> --makeRxDxList :: Functor f => f Text -> f [Text]<br>
> Above signature comes from ghci using command :t<br>
> My intention is<br>
> makeRxDxList :: Text -> [[Text]]<br>
> but, I got error, and try several times and below codes pass a complier.<br>
> makeRxDxList rowRxDx = fmap (\x -> splitOn (pack ",") x) rowRxDx  -- This<br>
> code pass a compile.<br>
> and then, I run ghci, type :t, and got below signature.<br>
> makeRxDxList :: Functor f => f Text -> f [Text]<br>
><br>
> Your kind answer says, I cannot help using fmap. right? ^^;<br>
> Thanks again.<br>
<br>
</span>Then this:<br>
<br>
    makeRxDxList :: Text -> [[Text]]<br>
    makeRxDxList rowRxDx = fmap f (lines rowRxDx)<br>
                -- you imported Prelude hiding map, so we will use fmap<br>
        where<br>
              f :: Text -> [Text]<br>
              f x = splitOn (pack ",") x<br>
<br>
should do (at least it typechecks).<br>
<br>
GHC errors may not have the prettiest formatting ever, but they are<br>
very useful, the most important bits being line & column of the offending<br>
expression plus the "expected this but got that" part; get acquainted<br>
with them!<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Sok Ha, CHANG<br></div>Dr. Chang's Clinic. #203. 503-23. AmSa-Dong, GangDong-Gu, Seoul.<br></div>Tel: +82-2-442-7585<br></div></div>
</div>