[Haskell-beginners] how to check the format of a string ?

Sumit Sahrawat, Maths & Computing, IIT (BHU) sumit.sahrawat.apm13 at iitbhu.ac.in
Sun Feb 22 19:27:19 UTC 2015


Also, as far as I remember, cis194 made you build parser combinators like
parsec and attoparsec when teaching applicative functors and other fancy
stuff.
You can opt to wait till then.

On 23 February 2015 at 00:55, Sumit Sahrawat, Maths & Computing, IIT (BHU) <
sumit.sahrawat.apm13 at iitbhu.ac.in> wrote:

> The exercise was meant to be done without using any library. Try it out,
> it will work.
> A parser combinator library, such as parsec or attoparsec is better learnt
> after you have some idea of monads, which is the last topic cis194 deals
> with.
> But, if it interests you, keep going. Parsec might be a better option as
> it has been there for a longer amount of time, and thus has more learning
> resources.
>
> Hope this helps.
>
> On 23 February 2015 at 00:52, Roelof Wobben <r.wobben at home.nl> wrote:
>
>>  Thanks,
>>
>> Found this tutorial which works with log files like I have to do :
>> https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-frameworks/text-manipulation/attoparsec
>>
>> Roelof
>>
>>
>>
>> Benjamin Edwards schreef op 22-2-2015 om 20:14:
>>
>> If the format is sufficiently simple a regex can be a very neat way to
>> express the idea. Mostly people use parser combinators. Have a look at
>> parsec / attoparsec on hackage.
>>
>>  Ben
>>
>> On Sun Feb 22 2015 at 18:50:18 Roelof Wobben <r.wobben at home.nl> wrote:
>>
>>> Hello,
>>>
>>> Im still busy with CIS 194
>>>
>>> Now im facing this problem.
>>>
>>> There is a log file of strings.
>>>
>>> Most of them are of this format   char  Number [chars]
>>>
>>> What is the best way to check if the string has this format ?
>>>
>>> Regex or another way ?
>>>
>>> Roelof
>>>
>>> _______________________________________________
>>> Beginners mailing list
>>> Beginners at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>>
>>
>>
>> _______________________________________________
>> Beginners mailing listBeginners at haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>
>
> --
> Regards
>
> Sumit Sahrawat
>



-- 
Regards

Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150223/6f186d91/attachment.html>


More information about the Beginners mailing list