Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Type error when using splitOn function. (S. H. Aegis) ---------------------------------------------------------------------- Message: 1 Date: Wed, 22 Feb 2017 21:02:22 +0900 From: "S. H. Aegis" <shae...@gmail.com> To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell <beginners@haskell.org> Subject: Re: [Haskell-beginners] Type error when using splitOn function. Message-ID: <cajp-nqxxwhmz-rjn0n_7gkaqe7w4qmjasjdx6ext8ptykuk...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Thank you so much. --makeRxDxList :: Functor f => f Text -> f [Text] Above signature comes from ghci using command :t My intention is makeRxDxList :: Text -> [[Text]] but, I got error, and try several times and below codes pass a complier. makeRxDxList rowRxDx = fmap (\x -> splitOn (pack ",") x) rowRxDx -- This code pass a compile. and then, I run ghci, type :t, and got below signature. makeRxDxList :: Functor f => f Text -> f [Text] Your kind answer says, I cannot help using fmap. right? ^^; Thanks again. 2017-02-22 18:35 GMT+09:00 Francesco Ariis <fa...@ariis.it>: > On Wed, Feb 22, 2017 at 05:33:01PM +0900, S. H. Aegis wrote: > > Hello. > > I'm new to Haskell and this is the first time I use Data.Text module. > > And using stack on OSX 10.12.3 > > I'm try several times, but fail. and I don't understand what error > message > > says. > > How can I fix this? > > Thank you a lot. > > Hello SH, Text.map has signature `(Char -> Char) -> Text -> Text`, so > I expect you to need fmap too if the return value of makeRxDxList has > type f [Text] > > makeRxDxList rowRxDx = fmap _ rowRxDx > -- or base map > > _ is a hole and if the compiler will tell you which function needs to > go there, in this case one with signature `Text -> [Text]`. > > Does that help? If not, provide makeRxDxList signature and a brief > description so it's easier to diagnose the problem > -F > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -- Sok Ha, CHANG Dr. Chang's Clinic. #203. 503-23. AmSa-Dong, GangDong-Gu, Seoul. Tel: +82-2-442-7585 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170222/9b396f90/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 104, Issue 15 ******************************************