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,
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 Reg Ex).
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
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
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
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
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
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 c = if c
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
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
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 Y etc
now using
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?
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.
snip
You can
13 matches
Mail list logo