Hello,
While occasionally and slowly updating the future version of regex-tdfa I
found a bug that exists in the released 1.1.1 version. It was just a matter of
passing the wrong value into a function, so was easy to fix when I figured it
out.
The test case triggered an impossible "error" ca
Hello all,
The SampleVar module in base is not exception safe. I believe that there is
no way to fix this module to be exception safe while retaining the current
behavior.
The problem with the current behavior is that the writeSampleVar pretends to
know how many blocked reader threads are w
"Grasshopper, try to take the stone from my hand"
Hello all,
After looking at the code for QSem [1], I realize it is not exception safe.
And it does more work than needed.
I have a proposed replacement module MSem at
http://haskell.org/haskellwiki/SafeConcurrent on the wiki.
I claim this
Neil Mitchell wrote:
>
> I guess the "nested calls to parallel_" bit is the part of the spec
> that makes everything much harder!
>
> Thanks
>
> Neil
Yes. Much more annoying.
But the problem here is generic. To avoid it you must never allow all thread to
block at once.
The parallel_ functio
Neil Mitchell wrote:
> Sorry, accidentally sent before finishing the response! I also noticed
> you sent this directly to me, not to -cafe, was that intentional?
The mail/news gateway makes it look like that, but I also sent to the mailing
list.
> You mean something like:
>
> parallel_ xs =
>
You create one MVar for each task in order to ensure all the tasks are done.
This is pretty heavyweight.
You could create a single Control.Concurrent.QSemN to count the completed tasks,
starting with 0.
Each task is followed by signalQSemN with a value of 1. (I would use
"finally").
As paralle
You should ensure that the result of "evaluate" is in normal form, not just weak
head normal form. You can do this with the Control.Parallel.Strategies module:
import Control.Exception(ArithException(..),try,evaluate)
import Control.Parallel.Strategies(NFData,using,rnf)
import System.IO.Unsafe
This is both a bug fix release and a feature release.
The bug fix is a bit embarrassing, the indices were correct but the captured
text was wrong in version 1.1.0. Oops.
As of version 1.1.1 the following GNU extensions are recognized, all anchors:
\` at beginning of entire text
\' at end of en
Manlio Perillo wrote:
Hi.
I have some doubts about the runGetState function in the binary package.
The signature is:
runGetState :: Get a -> LBS -> Int64 -> (a, LBS, Int64)
however the Int64 "input parameter" is not documented.
What value should I pass?
How will be used?
Thanks Manlio Peril
I have just uploaded the new regex-tdfa-1.1.0 to hackage. This version is a
small performance update to the old regex-tdfa-1.0.0 version.
Previously all text (e.g. ByteString) being search was converted to String and
sent through a single engine.
The new version uses a type class and SPECIAL
Don Stewart wrote:
tphyahoo:
Is there something like subRegex... something like =~ s/.../.../ in
perl... for haskell pcre Regexen?
I mean, subRegex from Text.Regex of course:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/regex-compat
Thanks for any advice,
Basically, we should h
Thomas Hartman wrote:
testPcre = ( subRegex (mkRegex "(?
quoting from the man page for regcomp:
REG_NEWLINE Compile for newline-sensitive matching. By default, newline is a
completely ordinary character with
no special meaning in either REs or strings. With this flag,
`[^'
Thomas Hartman wrote:
testPcre = ( subRegex (mkRegex "(?
quoting from the man page for regcomp:
REG_NEWLINE Compile for newline-sensitive matching. By default, newline is a
completely ordinary character with
no special meaning in either REs or strings. With this flag,
`[^'
Grzegorz Chrupala wrote:
Hi all,
Is there a serialization library other than the Data.Binary from hackage?
Yes. "binary-strict" is one alternative:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary-strict
I am using Data.Binary in a couple of projects, but I have found i
Thomas Hartman wrote:
Is there something like subRegex... something like =~ s/.../.../ in
perl... for haskell pcre Regexen?
I mean, subRegex from Text.Regex of course:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/regex-compat
Thanks for any advice,
thomas.
Short answer: No.
Th
Anatoly Yakovenko wrote:
do nmergeIO or mergeIO preserve order? or not preserve order?
If you have a list of operations "[IO a]" then the future package at
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/future
can do this. It's 'forkPromises' function returns a "Chan a" which can
Don Stewart wrote:
Who needs to build futures into the language -- all you need is MVars, eh?
For a pure computation in Haskell one can use "par" (which did take changing the
runtime, and arguably adding to the language).
The future package I uploaded is just a clean way to get something a l
Hello,
As a side effect of the discussion of the new C++ future/promise features at
http://lambda-the-ultimate.org/node/3221 I have implemented a Haskell package
called "future" at
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/future
This ought to do what C++ standard futures/
I have a performance glitch in regex-tdfa related to GHC-6.10.1 (on a PPC G4
with -O2).
I have okay code that runs in 0.2 seconds.
I simplify this code to run faster and it takes 4.0 seconds (it allocates
something in the loop, I think)
I turn on -prof for the simpler code and it runs in 0.25
I have collected some of the backing code to "decode". This is all pasted below
so we can look at it. I will not improperly guess at the cause of the problem,
and be totally wrong.
I observe Get is a lazy monad:
Prelude Data.Binary Data.Binary.Get Data.Monoid> "World" == runGet ((return $!
(N^3) for wcs3. The new code is always O(N). The actual timings
for the old code on my G4 laptop for wcs on 2^8 and 2^9 and 2^10 are:
Reason:compare-tdfa chrisk$ time ./Test-TDFA-np wcs3 8 +RTS -sstderr 2>&1 |
head -4
./Test-TDFA-np wcs3 8 +RTS -sstderr
Test for [Char]
Right [array (0,1)
Bulat is right about making Block's fields strict.
-- | Get the offsets between entries in a list
getSizes :: [Integer] -> [Integer]
getSizes (x:y:[]) = [y - x]
getSizes (x:y:ys) = (y - x):(getSizes (y:ys))
You should change the first part to add maxSize:
> getSizes :: [Integer] -> [Intege
Hello,
The regex-tdfa package has had a series of bug fix releases (0.97.1 and 2 and
3 and now 4). This 0.97.4 releases finishes fixing the bug that was only mostly
fixed in the 0.97.1 release.
An example of the fixed bug: Apply the regex pattern (BB(B?))+(B?) to the
text . The "BB
On a G4:
s.hs (which does not need bang patterns) is:
main = seq (sum0 (10^9) 0) (return ())
sum0 :: Int -> Int -> Int
sum0 0 acc = acc
sum0 x acc = sum0 (x-1) $! (acc+x)
And s.c is (actually including 10^9, which Bulat's did not):
main()
{
int sum=0;
for(int i=1000*1000*1000; i>0; i--
To Haskell and Libraries and Haskell-Cafe,
Whilst improving regex-tdfa I have run across new bugs. Some patterns were
getting compiled wrong and others were affected by an execution bug.
As this package has actual users, I wanted to make sure they get these fixes
immediately.
Three Cheers
Jonathan Cast wrote:
On Fri, 2009-02-06 at 00:51 +0100, Peter Verswyvelen wrote:
On Thu, Feb 5, 2009 at 8:20 PM, ChrisK
wrote:
Since this is strict there is no laziness and the code must
evaluate the input and output "State RealWorld" to ensure they
are not
All Haskell programs start as
main :: IO ()
though... so they all get evaluated in the context of another IO ()
don't they?
True for most cases now, but historically false. Haskell existed and people
wrote programs for years before the Monad class and IO were created. A
Haskell98 prog
Gregg Reynolds wrote:
getChar >>= \x -> getChar
An optimizer can see that the result of the first getChar is discarded
True, so 'x' is not used, and it can be garbage collected, and may not even be
created.
But that data dependency is simple not the data dependency that make IO
sequent
Eugene Kirpichov wrote:
All in all, my question remains: what is the fastest way to do this
kind of parsing on a lazy bytestring?
Your example regular expression works the same in both Posix and Perl-ish
semantics. Do you know the difference? Posix libraries look for the longest
match of
I have three announcements to make about regex-* related packages.
The regex-posix-0.94.1 package update provides better semantics for multiple
matches. Below version 0.94, if any match was empty the matching would stop.
Now the empty match is returned and the position is incremented and the
Duncan Coutts wrote:
Proxy auto-configuration files are JavaScript. It uses more or less the
full JavaScript language (ECMA these days), though with a small subset
of the standard library.
W T F
So we want a tiny naive javascript interpreter, hopefully in pure Haskell. The
dumbest interprete
Great, thanks! I'm enlightened :)
And no one had to hit you with a stick first!
But how is this:
data SomeNum = forall a. SN a
different from:
data SomeNum = SN (forall a. a)
?
At a glance they look the same to me — but only the first is accepted by ghc.
There is also the GADT syntax:
Mauricio wrote:
Hi,
I'm trying, without success, to understand the difference
between existencial quantification and polymorphic
datatypes. Can you give me a hint, or an example where
one is valid and the other is not?
The first thing to ensure you know is that Haskell can have functions (usua
Manlio Perillo wrote:
Brandon S. Allbery KF8NH ha scritto:
>
...in theory. In practice GHC needs help with circular imports, and
some cycles might be impossible to resolve.
This is interesting.
Where can I find some examples?
Is this explained in the Real World Haskell book?
I have no i
Robin Green wrote:
What guidelines should one follow to make Haskell code least-strict?
Obviously the use of "seq" and bang-patterns make code more strict.
Code is strict when it evaluates values to determine a pattern match. So
avoiding that makes code lazier. Values are evaluated when dec
Alexandr,
Thanks for sending me this question about unicode and regex-pcre. I will
share with the mailing list. This is an encoding issue.
From the haddock documentation for regex-pcre:
http://hackage.haskell.org/packages/archive/regex-pcre/0.94.1/doc/html/Text-Regex-PCRE.html
"Using the
Here is a great "Monoid found in the wild story":
I just implemented a library for binary message serialization that follows
Google's protocol buffer format.
The documentation of this was very scattered in some respects but I kept reading
snippets which I have pasted below. The effect of the
Dan Weston wrote:
Richard Feinman once said: "if someone says he understands quantum
mechanics, he doesn't understand quantum mechanics".
But what did he know...
Well, I am a physicist and Feynman (with a y, not an i), is not talking about
the linear algebra.
Of course, linear algebra [1]
Thomas DuBuisson wrote:
How does forcing them to learn proposed terminology such as `Appendable'
help here? Learners of Haskell do still need to learn what the new word
means.
The contention is that 'Appendable' is an intuitive naming that people
will already have a rudimentary grasp of. This
Paulo: I suggest doing this more carefully.
Get the source from hackage.
Edit the regex-posix.cabal file to add the include and lib directories you need
on Cygwin.
cabal "configure" it.
cabal "build" it.
cabal "install" it.
Then in an unrelated directory try and run "ghci -package regex-po
Henning Thielemann wrote:
I have seen several libraries where all functions of a monad have the
monadic result (), e.g. Binary.Put and other writing functions. This is
a clear indicator, that the Monad instance is artificial and was only
chosen because of the 'do' notation.
I completely disagre
Tony Finch wrote:
The FreeBSD kernel uses a 64+64 bit fixed point type to represent time,
where the integer part is a normal Unix time_t. The fractional part is
64 bits wide in order to be able to represent multi-GHz frequencies
precisely.
"multi-GHz" being a euphemism for 18.45*10^9 GHz, over
Haskeline is designed to remove the readline dependency, because Windows does
not have readline. So rlwrap is useless there.
Andrew Hunter wrote:
On Mon, Jan 12, 2009 at 12:57:57PM -0800, Judah Jacobson wrote:
I'm pleased to announce the first release of ghci-haskeline. This
package uses th
Neil Davies wrote:
I've found the pico second accuracy useful in working with 'rate
equivalent' real time systems. Systems where the individual timings
(their jitter) is not critical but the long term rate should be accurate
- the extra precision helps with keeping the error accumulation under
An Double or Int64 are both 8 bytes and counts with picoseconds precision for
2.5 hours to 106 days. Going to 12 byte integer lets you count to 3.9 billion
years (signed). Going to 16 byte integer is over 10^38 years.
Lennart Augustsson wrote:
A double has 53 bits in the mantissa which means
Manlio Perillo wrote:
Hi.
Just out of curiosity, but why Haskell 98 System.CPUTime library module
uses picoseconds instead of, say, nanoseconds?
At least on POSIX systems, picoseconds precision is *never* specified.
I have not idea. But at a guess, I would say that 1 ns is not such a smal
Mauricio wrote:
patients, I wanted to be sure not to save wrong
information. It wouldn't matter if the clock is
saying we are on XVII century, as long as 10 seconds
would never be 10.1.
Chris (yes I am an experimental physicist) asks:
What are the interval durations you need to measure?
0.1
John A. De Goes wrote:
Here's hoping someone develops a native messaging framework for Haskell,
which is the equal of RabbitMQ.
The first thing would be to make a Haskell client library to speak AMQP
(Advanced Message Queuing Protocol) on the wire.
It is a very open binary standard (with
You can use "undefined" or "error ..." :
{-# LANGUAGE RecursiveDo #-}
import Control.Concurrent.STM
import Control.Monad.Fix
-- Transactional loop. A loop is a circular link list.
data Loop a
= ItemLink
{ item :: a
, prev :: TVar (Loop a)
, next :: TVar (Loop a)
}
-
Question and suggestion:
looking at
http://hackage.haskell.org/packages/archive/bytestring-trie/0.1.1/doc/html/src/Data-Trie.html#Trie
I am questioning your choice of foldr in fromList:
-- | Convert association list into a trie. On key conflict, values
-- earlier in the list shadow later ones.
Luke Palmer wrote:
On Mon, Dec 29, 2008 at 3:55 PM, Martijn van Steenbergen
mailto:mart...@van.steenbergen.nl>> wrote:
Hello,
I would like to construct an infinite two-dimensional grid of nodes,
where a node looks like this:
data Node = Node
{ north :: Node
I think the below code which compiles with ghc-6.10.1 should compile with
ghc-6.8.3 as well. My preference is to define a GADT such as ThingMap below.
Conceptually ThingMap contains two pieces of information. There is a Map to an
unknown type "thing" and there is a dictionary which implements
I think I can improve on your code.
Bertram Felgenhauer wrote:
But why does it manually manage the waiters at all? MVars are fair, in
ghc at least. So this should work:
data Sem = Sem (MVar Int) (MVar Int)
I changed the above to be a data
newSem :: Int -> IO Sem
newSem init
John Van Enk wrote:
I want to group them with Network functions because traditionally these
specific functions *are* in networking packages.
I agree. It is true that these functions are in the header on my
machine. The ntoh* and hton* are just data manipulation, just as Network.URI is
all
Yeah!
I am glad the mailing list has helped. If you get stuck or need something
fancier then let me know (I wrote RegexLike).
But I still don't know how to get makeRegex to work. You need it to specify
options like case insensitivity, or to use functions like matchAllText.
Well, the option
Hans van Thiel wrote:
I just saw somewhere that one of the purposes of monads is to capture
side effects.
There are a few things that have "side effects". The best way to capture this
is to see that there are both
(1) commands whose result depends on some external state
(2) commands whic
You can get pretty far with the same trick oleg mentions at [1].
If you use local type signature then you can do things like this:
{-
ghci infers this type:
*Main> :t f
f :: (Ord a) => Int -> a -> t -> String
-}
f i j x | False = (undefined (i::Int) (isOrd j)) :: String
f i j x = error "not fil
Or if you don't want to pay for laziness at all you could build your memo array
imperatively (but purely):
import Data.Array.IArray(elems,(!),inRange)
import Data.Array.MArray(newArray_,writeArray,readArray)
import Data.Array.Unboxed(UArray)
import Data.Array.ST(runSTUArray,STUArray)
import Cont
Mozhgan Kabiri wrote:
Hi .. Hope you are doing well . I've just joined this group.
Hi.
Recently, I am struggling to do some simple experiment with haskell
language about parallelism and wrong answers that we can get while using
a shared variable .
Your goal is still unclear.
Are you trying
Ross Paterson wrote:
On Wed, Dec 10, 2008 at 05:34:16PM +, ChrisK wrote:
Is there anyway to track down and fix why haskell-src-exts-0.4.4.1 still gets
"haddock: parse error in doc string"
when I try to get cabal to haddock the package?
Line numbers would be handy.
In this
Is there anyway to track down and fix why haskell-src-exts-0.4.4.1 still gets
"haddock: parse error in doc string"
when I try to get cabal to haddock the package?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/li
Duncan Coutts wrote:
Yet another reason why FilePath /= String (except on Windows where it
does).
Duncan
Well, it is not a "OS" issue but a "FileSystem" issue.
OS X is a Unix, but the main filesystem is HFS+ which has Unicode names, though
they use a different normalization.
So "FilePath =
Niklas Broberg wrote:
Fellow Haskelleers,
it is my pleasure to announce the new release of the haskell-src-exts
package, version 0.4.4:
The full list of pragmas supported by 0.4.4 is: SOURCE, RULES,
DEPRECATED, WARNING, INLINE, NOINLINE, SPECIALISE, CORE, SCC,
GENERATED and UNPACK.
Ah, exce
Hmmm... it seems that n=63 is a special case.
[EMAIL PROTECTED] wrote:
Yes, there is a solution for n=99 and for n=100 for that matter --
which can be found under one second. I only had to make a trivial
modification to the previously posted code
tour n k s b | k > n*n = return b
I have only used this, all of these are from Haskell:
pamac-cek10:~ chrisk$ cat /etc/apache2/other/httpd-fastcgi.conf
Alias /fcgi-bin/ "/Library/WebServer/FastCGI-Executables/"
AllowOverride None
Options None
Order allow,deny
Allow from all
SetHandler fast
Er, no. A fastcgi executable is (like a cgi executable) controlled by the front
end web server. I run my fastcgi using Apache as the front end. The front
end web server will control things like the port number.
Mauricio wrote:
Hi,
I'm learnng to use fastcgi and, reading the examples,
I s
The regex-tdfa package (and regex-posix) implement subexpressions capture.
So if you want to match alpha beta and gamma in parallel you could write
"(alpha)|(beta)|(gamma)" and check which subexpression has the non-empty match.
This becomes slightly complicated if there are parenthesis and capt
And, though I had never seen it before, the current winner for speed is "ATS" (
http://www.ats-lang.org/ ) which is dependently-typed functional language.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/h
Hello one and all,
Amid much rejoicing, my Haskell version of protocol-buffer is now
released (version 0.2.9).
What is this for? What does it do? Why?
Shorter answer: It generates Haskell data types that can be converted back
and forth to lazy ByteStrings that interoperate with Google's ge
There are some examples of adding IO actions to commit and rollback events at
http://www.haskell.org/haskellwiki/New_monads/MonadAdvSTM
Disclaimer: I wrote this instance of the code, but have not used it much.
Cheers,
Chris
___
Haskell-Cafe mailing
Matthew Brecknell wrote:
Unfortunately, I don't seem to be able to make the expected fprintf
function, because printf's format-dependent parameter list makes it
impossible to find a place to pass the handle. Hence the C++-like (<<)
ugliness.
How about this:
fprintf :: Handle -> F (IO ()) b ->
I am glad you asked Ben,
Short answer: It can return a Seq of your values. The values in the Seq are
lazy, the Seq itself is finite. It can return what it has so far before it
finishes parsing (or even before the rest of the input has arrived from the
network).
Ben Franksen wrote:
ChrisK
Hi John,
I recently posted new and fancy binary Get monads in
http://article.gmane.org/gmane.comp.lang.haskell.libraries/9691
and
http://article.gmane.org/gmane.comp.lang.haskell.libraries/9756
which might be of interest since network protocol are usually specified in bytes
at the wire level.
Thanks for the fix. I have gotten the darcs version and I am compiling...
Niklas Broberg wrote:
Hi all,
I'm pleased to report that haskell-src-exts is now updated to
understand Template Haskell syntax (it used to understand pre-6.4 TH,
but now it works with the current version). At least I hop
Hi,
Can one represent the ''Type template Haskell syntax of
$( makeMergeable ''FileDescriptorProto )
in haskell-src.exts Language.Haskell.Exts.Syntax ?
And what are the HsReify data (e.g. HsReifyType and HsReifyDecl and
HsReifyFixity )?
I don't see any pretty print capability to produce th
Joachim Breitner wrote:
* The 5th line does not have this effect. Because this gets desugared
to (>>), the special implementation of (>>) means that the next line
still sees the same dependency state as the before the call to liftIO.
You are violating the monad laws. (f >> k) and (f >>= \_ ->
hen, the readFileOD could put the timestamp
of the read file in a Monad-local state and the writeFileOD could, if
the output is newer then all inputs listed in the state, skip the
writing and thus the unsafeInterleaveIO’ed file reads are skipped as
well, if they were not required for deciding the
Are you adjusting 'System.IO.hSetBuffering' to NoBuffering for those handles?
Graham Fawcett wrote:
Hi folks,
I would like to communicate with an external, line-oriented process,
which takes a sequence of one-line commands, each returning an
arbitrary number of lines, and waits for another com
The garbage collector never gets to collect either the action used to populate
the cached value, or the private TMVar used to hold the cached value.
A better type for TIVal is given below. It is a newtype of a TVal. The
contents are either a delayed computation or the previously forced value.
More algebraically, including 'or' for symmtry:
and xs = foldr (&&) True xs
or xs = foldr (||) False xs
The True and False are the (monoid) identities with respect to && and || :
True && x == x
x && True == x
False || x == x
x || False == x
And so an empty list, if defined at all, should be t
Ryan Ingram wrote:
I usually use something like this instead:
hStrictGetContents :: Handle -> IO String
hStrictGetContents h = do
s <- hGetContents h
length s `seq` hClose h
return s
A small idiomatic nitpick: When I see (length s) gets computed and thrown away
I wince at the was
The length calculation looked complicated. So I reformulated it as a comparison
using HasIndex. But ghc-6.8.2 was not inferring the recursive constraint on
proj, so I split proj into proj_unsafe without the constraint and proj with the
constraint checked only once. I also renamed ZT to Nil to
My late night suggestions were nearly correct. I have actually written the code
now. Once keeping track of indices, and a second time without them:
{-# LANGUAGE BangPatterns #-}
-- By Chris Kuklewicz, copyright 2008, BSD3 license
-- Longest increasing subsequence
-- (see http://en.wikipedia.o
It is late, but I was not sleepy enough, so here is my first translation of the
algorithm to a functional approach...
{- Quote wikipedia: http://en.wikipedia.org/wiki/Longest_increasing_subsequence
L = 0
M[0] = 0
for i = 1, 2, ... n:
binary search for the largest j ≤ L such that X[M[j]]
Jules Bean wrote:
> Justin Bailey wrote:
>>> From a recent interview[1] with the guy leading Ruby development on
>> .NET at Microsoft:
>>
>> "You spend less time writing software than you spend maintaining
>> software. Optimizing for writing software versus maintaining software
>> is probably the
Okay, I get the difference.
The "T a" annotation in "val :: T a)"and "val :: T a" does not help choose the
"C a" dictionary.
But the "val :: a-> T a" and "val (undefined :: a)" allows "a" to successfully
choose the "C a" dictionary.
val :: T a fixes "T a" but does not imply "C a".
(undefined
Tom Schrijvers wrote:
Stefan,
I tried lexically scoped type variables, but to no avail:
instance forall a b. (C a, C b) => C (a, b) where
type T (a, b) = (T a, T b)
val = (val :: T a, val :: T b)
The problem is ambiguity. The type checker can't determine which val
function to
For Bimap is there anything like Data.Map.insertWithKey ?
Stuart Cook wrote:
On Sat, Feb 9, 2008 at 7:36 AM, Dan Weston <[EMAIL PROTECTED]> wrote:
If order is important, the new bijective Data.Bimap class
http://code.haskell.org/~scook0/haddock/bimap/Data-Bimap.html
may be your best bet (I h
Let me add:
> data ExpGADT t where
> ExpInt :: Int -> ExpGADT Int
> ExpChar :: Char -> ExpGADT Char
Which type do you think 'unHide' and 'wierd' should have:
> unHide h = case h of
> Hidden (_,e) -> e
>
> wierd = unHide (Hidden (TyInt,ExpInt 3))
either:
unHide :: Hidden
The "bit of a mess" that comes from avoiding monads is (my version):
import Foreign.Marshal.Array(withArray0)
import Foreign.Ptr(nullPtr,Ptr)
import Foreign.C.String(withCString,CString)
This uses withCString in order of the supplied strings, and a difference list
([CString]->[CString]) initia
The PCRE library has just fixed a buffer overflow (related to UTF-8 mode).
There are several haskell wrappers for the pcre library.
If you use a wrapper for the PCRE library (libpcre) then you may want to upgrade
the underlying library.
http://pcre.org/news.txt states:
News about PCRE release
Simon Peyton-Jones wrote:
1. Small examples of actual code.
I particularly like the lazy way of counting change example (also works for
picking items off a menu).
The code below show 3 approaches :
a function for computing the coins used in each way as a verbose list
a function for computi
Achim Schneider wrote:
Don Stewart <[EMAIL PROTECTED]> wrote:
jwlato:
In addition to STM, another item that should interest serious
programmers is forkIO. Lightweight threads that (unlike in Python)
can use multiple cpu's. Coming from Python, I personally appreciate
this. Using STM to handl
The advice below is for Mac OS X 10.4 and below. Starting with Mac OS X 10.5
(Leopard) the DISPLAY is set for you by the operating system. Mine is currently
"/tmp/launch-sQZXQV/:0" which looks very strange because it is used to cause the
launchd daemon to start the X server on demand (i.e. laz
Luke Palmer wrote:
In attempting to devise a variant of cycle which did not keep its
argument alive (for the purpose of cycle [1::Int..]), I came across
this peculiar behavior:
import Debug.Trace
cycle' :: (a -> [b]) -> [b]
cycle' xs = xs undefined ++ cycle' xs
take 20 $ cycle' (const $ 1:2:
ANNOUNCEMENT: Build fixed for regex-base, regex-posix, regex-compat, regex-pcre
The changes are mainly to the Cabal build files to support ghc-6.8 and ghc-6.6
simultaneously. They definitely work with cabal version 1.2.3.0 (required for
regex-pcre). The regex-base, regex-posix, and regex-comp
Could I has one question? What is the purpose of the "stream" function in the
ArrowLoop instance? Is it just to catch an unexpected [] at runtime?
8<
module Main where
import Control.Arrow
import Control.Arrow.Operations
import Control.Arrow.Transformer.Reader
--
-- Standard list/st
Brandon S. Allbery KF8NH wrote:
On Jan 6, 2008, at 15:02 , Ketil Malde wrote:
More seriously, perhaps "quantum" enters into the equation in how the
brain works, perhaps it is even necessary for "thought". However, I
get worried it's just another mystical mantra, a gratuitous factor
that, lack
Albert Y. C. Lai wrote:
> Mitar wrote:
>> I am really missing the (general) split function built in standard
>> Haskell. I do not understand why there is something so specific as
>> words and lines but not a simple split? The same goes for join.
>
> Don't forget Text.Regex.splitRegex.
Which is ju
Mitar wrote:
> Hi!
>
> On Dec 28, 2007 5:51 PM, Lihn, Steve <[EMAIL PROTECTED]> wrote:
>> Since regex is involved, it is specific to (Byte)String, not a generic
>> list.
>
> Oh, this gives me an interesting idea: making regular expressions more
> generic.
>
The new regex-base API is fairly generi
1 - 100 of 180 matches
Mail list logo