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.  Alphanumerical input (A. Mc.)


----------------------------------------------------------------------

Message: 1
Date: Fri, 5 Mar 2021 21:31:23 -0800
From: "A. Mc." <47dragonf...@gmail.com>
To: beginners@haskell.org
Subject: [Haskell-beginners] Alphanumerical input
Message-ID:
        <CAOsti3mLkK8S2eStmcZtAXzfTNe9M1XOSWsj=w8tfskhsg6...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello,

I was wondering what the best way was for tranforming a list of
alphanumerical characters from main IO() such as:

Enter String:
A 101 E 182

and tranforming it into an Int list of

[0, 101, 4, 182]

Which converting A and E to 0 and 4 is easy enough with toEnum/fromEnum and
simple subtraction, and using read can convert to a [Char], but recognizing
101 as a single Int from a Char string in main, and getting both converted
together as part of the same function, I'm a bit less sure of without
resorting to much lower level imperative methods.

Thanks in advance and thank you for your time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210305/a6de6996/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 152, Issue 2
*****************************************

Reply via email to