Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Haskal Thread

Name: Anonymous 2012-05-18 4:49

So i have this haskal problem and i thought you might be able to help.
I'm trying to use parsec to match a pattern where what comes before may be arbitrary.
If the pattern consisted of special characters that aren't in the rest of the string it would be easy:

do { many (noneOf ['1'..'9']); many ['1'..'9'] }

but what if for example the pattern is 2 upper case letters followed by 2 lower case ones.

Now there's a function that does something similar: manyTill
unfortunately it returns not the pattern but everything before it. I've managed to write a solution with manyTill but it seems awfully complicated for such a simple task:

do { manyTill anyChar (try $ lookAhead pattern); pattern }

Is there a better solution? Ideally something like manyTill that returns the pattern instead.

Name: Anonymous 2012-05-18 10:27

do { manyTill anyChar (try $ lookAhead pattern); pattern }
VALID PERL CODE!

Name: Anonymous 2012-05-18 10:41

endsIn post = (++) <$> manyTill anyChar (try $ lookAhead post) *> post
VALID PERL CODE!

Name: bampu pantsu 2012-05-29 5:02

bampu pantsu

Name: Sgt.Kabuꤧ쑧kiman⎽ 2012-05-29 13:34

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Name: Anonymous 2013-09-01 13:50


When considering these large objects, we might also want to see if the notion of counting order coincides with that of cardinal defined above for these infinite sets. It happens that it doesn't; by considering the above example we can see that if some object "one greater than infinity" exists, then it must have the same cardinality as the infinite set we started out with. It is possible to use a different formal notion for number, called ordinals, based on the ideas of counting and considering each number in turn, and we discover that the notions of cardinality and ordinality are divergent once we move out of the finite numbers.

Name: Anonymous 2013-09-01 16:08


Set theory is also a promising foundational system for much of mathematics. Since the publication of the first volume of Principia Mathematica, it has been claimed that most or even all mathematical theorems can be derived using an aptly designed set of axioms for set theory, augmented with many definitions, using first or second order logic.

Don't change these.
Name: Email:
Entire Thread Thread List