tphyahoo:
>
> So the core question (speaking as a perler) is how do you write
>
> my $s= 'abcdefg';
> $s =~ s/a/z/g;
> $s =~ s/b/y/g;
> print "$s\n";
Simple patterns like this you'd just use a 'map' of course:
main = print (clean "abcdefg")
clean = map (by . az)
where by
Bill Wood wrote:
> It would seem that for a regular expression facility to constitute a
> parser it would have to be able to work on token streams. So my question
> is, does either the the perl6 generalization or any of the Haskell regex
> facilities support regular expressions over any free monoid
It would seem that for a regular expression facility to constitute a
parser it would have to be able to work on token streams. So my question
is, does either the the perl6 generalization or any of the Haskell regex
facilities support regular expressions over any free monoid other than
finite charac
On Jan 5, 2007, at 9:38 , Jules Bean wrote:
Yitzchak Gale wrote:
You need to use a more sophisticated algorithm - building
up trees of potential matches, backtracking in some cases,
etc. Why re-invent the wheel? Just use the regex library,
where that is already done.
It's merely a question o
Yitzchak Gale wrote:
You need to use a more sophisticated algorithm - building
up trees of potential matches, backtracking in some cases,
etc. Why re-invent the wheel? Just use the regex library,
where that is already done.
It's merely a question of selecting the right wheel. Some problems ar
tphyahoo wrote:
There are various haskell regex libraries out there,
Jules Bean wrote:
But that's such a perler attitude. When all you have is a regex,
everything looks like a s///!
Not always, sometimes it is right to use regexes in Haskell
also.
If there are more than a few patterns to ma
tphyahoo wrote:
> So the core question (speaking as a perler) is how do you write
>
> my $s= 'abcdefg';
> $s =~ s/a/z/g;
> $s =~ s/b/y/g;
> print "$s\n";
>
> in haskell? There are various haskell regex libraries out there,
> including ones that advertise they are PCRE (Perl Compatible R
yes, I admit it's a perler attitude.
I still want to know how to do "s///" in haskell. My guess is that for a
"real" regex substitution scenario, you would use parsec. Is that more or
less correct, or are there other (easier?) approaches. It would of course be
great to be able to transfer as much
tphyahoo wrote:
So the core question (speaking as a perler) is how do you write
my $s= 'abcdefg';
$s =~ s/a/z/g;
$s =~ s/b/y/g;
print "$s\n";
in haskell? There are various haskell regex libraries out there,
But that's such a perler attitude. When all you have is a regex,
everythi
Oops, I seem not to have proofread my message.
On 1/4/07, J. Garrett Morris <[EMAIL PROTECTED]> wrote:
On 1/4/07, brad clawsie <[EMAIL PROTECTED]> wrote:
> s = "abcdefg"
> patterns = ["a","b"]
> replacements = ["Z","Y"]
I changed the name here so as not to conflict with the replace function.
So the core question (speaking as a perler) is how do you write
my $s= 'abcdefg';
$s =~ s/a/z/g;
$s =~ s/b/y/g;
print "$s\n";
in haskell? There are various haskell regex libraries out there,
including ones that advertise they are PCRE (Perl Compatible Reg Ex).
But which one to use? H
On 1/4/07, brad clawsie <[EMAIL PROTECTED]> wrote:
lets say i have a string
s = "abcdefg"
now i have two lists of strings, one a list of patterns to match, and
a list of replacement strings:
patterns = ["a","b"]
replace = ["Z","Y"]
from which my intent is that "a" be replaced by "Z", "b" by "
Hi Brad,
i have a small problem that will be certainly trivial for almost
everyone reading this, i would appreciate a little help
If you have trivial problems, its often useful to ask on Haskell IRC
(http://www.haskell.org/haskellwiki/IRC_channel)
from which my intent is that "a" be replaced
greetings to this helpful and informative list
i have a small problem that will be certainly trivial for almost
everyone reading this, i would appreciate a little help
lets say i have a string
s = "abcdefg"
now i have two lists of strings, one a list of patterns to match, and
a list of replacem
14 matches
Mail list logo