I've defined a helper function to let me do regexps in functional style:
sed exp str = unsafePerformIO $ do
regexp - regcomp exp 0
regexec regexp str
Is this always safe? or where is it not?
(I'm using any one regexp more than once so it doesn't bother me that it
compiles each time)
--
benc:
I've defined a helper function to let me do regexps in functional style:
sed exp str = unsafePerformIO $ do
regexp - regcomp exp 0
regexec regexp str
Is this always safe? or where is it not?
(I'm using any one regexp more than once so it doesn't bother me that it
Neil Mitchell [EMAIL PROTECTED] writes:
To make things concrete, the example I'm really thinking of is a send
an email function, which would take a subject, a body, a list of
recipients, optional lists of cc and bcc recipients, an optional
mailserver (default localhost), an optional port
Hello Kirsten,
Friday, December 29, 2006, 6:30:22 PM, you wrote:
I suggest *not* using these pragmas unless a combination of profiling
and reading intermediate code dumps suggests that foo -- and its
un-specialized nature -- is truly a bottleneck.
it's a matter of taste - and experience. may
Hello Steve,
Friday, December 29, 2006, 8:10:29 PM, you wrote:
it force you to give names to intermediate results which is considered as
good programing style - program becomes more documented.
But that would imply that function composition and in-line function
definition are also Bad Style.
Hello Grady,
Friday, December 29, 2006, 11:00:42 PM, you wrote:
I've performed some experiments in GHCi, and it looks like even for a
get essentially the same execution times no matter which of the
definitions below I use
you should compare ghc -O2 times, ghci is very different beast. and
Maybe it's simpler to add a lot of INLINE, but that can make a program
slower as well as faster. It's much better to profile and add them
where they are needed.
-- Lennart
On Dec 30, 2006, at 08:42 , Bulat Ziganshin wrote:
Hello Kirsten,
Friday, December 29, 2006, 6:30:22 PM, you
I was solving some programming puzzles today[1], and found myself
pining for Map comprehensions.
Maybe there should be a Comprehensible class that's automatically
mapped to comprehension syntax. It's rather odd to have them only for
lists. That would be both more general and more elegant than
On 12/30/06, Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello Kirsten,
Friday, December 29, 2006, 6:30:22 PM, you wrote:
I suggest *not* using these pragmas unless a combination of profiling
and reading intermediate code dumps suggests that foo -- and its
un-specialized nature -- is truly a
On 12/29/06, Michael T. Richter [EMAIL PROTECTED] wrote:
I'm trying to wrap my mind around the darcs source code as a preliminary to looking into
GHC's guts. All of darcs is written as .lhs files which have bizarre mark-up in them
which distracts me from the actual Haskell source I'm trying
What would the Comprehensible class have? And how would it
be different from Monad(Zero)?
-- Lennart
On Dec 30, 2006, at 10:05 , Diego Navarro wrote:
I was solving some programming puzzles today[1], and found myself
pining for Map comprehensions.
Maybe there should be a
Hi
I was solving some programming puzzles today[1], and found myself
pining for Map comprehensions.
[ ... (key,val) - fromList map, ... ]
It isn't really that much more than a straight comprehension would be on a map.
By default should a map comprehension let you inspect the values, or
the
I tried compiling, but I got a linker error:
/usr/lib/ghc-6.4.2/libHSrts.a(Main.o): In function `main':
(.text+0x2): undefined reference to `__stginit_ZCMain'
/usr/lib/ghc-6.4.2/libHSrts.a(Main.o): In function `main':
(.text+0x16): undefined reference to `ZCMain_main_closure'
collect2: ld
On 12/30/06, Grady Lemoine [EMAIL PROTECTED] wrote:
I tried compiling, but I got a linker error:
/usr/lib/ghc-6.4.2/libHSrts.a(Main.o): In function `main':
(.text+0x2): undefined reference to `__stginit_ZCMain'
/usr/lib/ghc-6.4.2/libHSrts.a(Main.o): In function `main':
(.text+0x16): undefined
On Fri, 29 Dec 2006 18:39:04 +0100, you wrote:
Why not generate Haskell code from such a graph?
Well, that would indeed be a workable solution. But I don't have quite
the resources to design Yet Another Visual Programming Language.
And a textual representation of the graph would have exactly
Hello, I don't know why my simple example will not render a simple HTML
document.
For the moment, I simply want to render this:
html
/html
or whatever, the simplest document is.
When I run my source code, it simply hangs (as the transcript below shows)
{- SOURCE CODE -}
import
Hello,
According to this page:
http://www.cs.york.ac.uk/fp/HaXml/HaXml/Text-XML-HaXml-Wrappers.html
processXmlWith is used to apply a filter to an existing XML
document. By default, it will try to read the input document from
stdin. So, I am imagine that is what it is doing -- sitting their
On 12/30/06, Jeremy Shaw [EMAIL PROTECTED] wrote:
So may something like this would work:
main = print $ htmlprint $ go (CString False )
mk.hs:6:33:
Couldn't match expected type `Content i'
against inferred type `i1 - Content i1'
In the first argument of `go',
Actually, the examples directory in the distro for the development release
has a nice program to create an element and print it to stdout called
SimpleTestBool.hs:
module Main where
import List (isPrefixOf)
import Text.XML.HaXml.XmlContent
import Text.XML.HaXml.Types
import
I am trying to write a toy echo server that can handle multiple
connections. I would like to be able to test and see if there are any
connections waiting to be accepted on a socket. In C and related
languages I would use something like select or poll to be nice to the
OS, what would I use with
20 matches
Mail list logo