[Haskell-beginners] Type error when using splitOn function.

Francesco Ariis fa-ml at ariis.it
Wed Feb 22 09:35:57 UTC 2017


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


More information about the Beginners mailing list