with matrices...
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Wed, May 04, 2005 at 07:20:20PM +, Aaron Denney wrote:
On 2005-05-03, David Roundy [EMAIL PROTECTED] wrote:
An interesting challenge would be to rewrite fftw in haskell, and see how
close one could come to the performance of the original... :)
What precisely do you mean
of which uses a
different encoding for the filenames. In the case of removable media, this
scenario isn't even unlikely.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
it.
Isn't it guaranteed unbreakable simply because there's no way to decrypt
it? Since there isn't a one-to-one mapping of cyphertext to plaintext, I
don't think it's actually a form of encryption. Basically it's the same as
the sort function, which is also not invertible.
--
David Roundy
http
I'm cc'ing haskell-cafe on this darcs bug, since I imagine there might
be a student (or professor) hanging around there who might be interested
in the implementation of an efficient LCS algorithm in haskell.
[markjugg - Sun Feb 20 09:15:57 2005]:
Typically in software, 1000's of line aren't
monad.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
locking that it couldn't have been read between the original m
and the later mzero.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
foobar)
Any idea what I'm doing wrong? I'm using
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.2.2
packaged for debian.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
the Char as an eight bit C
character, the only difference is that if it's opened as text on windows,
your newlines get mangled. (...or treated properly, depending on your
opinion.)
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe
On Sun, Jan 30, 2005 at 09:25:00PM +0100, Marcin 'Qrczak' Kowalczyk wrote:
David Roundy [EMAIL PROTECTED] writes:
No, it's not Unix-specific, it's portable. If you want to write
portable C code, you have to use the standard library, which means
that file names are represented as Ptr CChar
to convert
between FilePath and CString.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
painful would it be for the System.IO functions to have types such
as
readFile :: FilePath a = a - String
?
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
(instead, it sees if they exist by trying to compile with them),
so this constraint isn't necesary for *all* ghc users.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo
/. are also the same. The exception of course is that
/foo and ./foo are not the same thing.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
which block needs to be read into memory...
Wouldn't select always fail, since the block would never be read into
memory until you call read?
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org
half the time,
whereas the signatures are guaranteed by the compiler to be correct.
One of the great things about haskell is how expressive the signatures tend
to be... although that could just be an illusion due to the fact that I
code am now a better coder than I used to be.
--
David Roundy
http
what we need is a binary IO system first, and then
the character-based IO can do whatever it likes without breaking things
(since it'll only be used by programs that actually want unicode coding).
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe
failures all the time?
ghc does give warnings when pattern matches aren't exhaustive, at least
when called with the compile flags used with darcs. It seems that you may
be interested in the -fwarn-incomplete-patterns compile flag with ghc.
--
David Roundy
http://civet.berkeley.edu/droundy
number of read values which is
confusing and unsafe in my opinion.
Isn't that because there could be more than one way to read the string? For
example, in theory reads of an int from 123 might return
[(123,), (12,3), (1,23)]
--
David Roundy
http://www.darcs.net
it is
stable in the sense that it doesn't crash.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
...
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
it gets
garbage collected.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
playing which would be ideal.
Indeed.
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
for this are in the attached library.
Alternatively, you could just use atan or erfc to map between the complete
set of real numbers and the range from 0 to 1. This sort of trick is
sometimes helpful to convert a constrained minimization into an
unconstrained one.
--
David Roundy
http
, there are
any that actually perform IO).
--
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Tue, Nov 23, 2004 at 01:51:24PM +, Keean Schupke wrote:
David Roundy wrote:
There are plenty of non-IO reasons to use unsafePerformIO, for which it is
essential. If you want to write haskell code that uses a pointer
(allocated possibly via an FFI C routine), it has to be in the IO
the author of the format string less control over the formatting of
particular types like numbers.
It seems to me that control over formatting of numbers is the only reason
to use anything printf-like... but perhaps that's just because of the
frequency with which I print (and read) doubles.
--
David
effectively has a Nothing
value type. I suppose one could also make it a Weak (Maybe a), but in
any case, I'd rather be able to just initialize the IORef to an empty weak
pointer, so there wouldn't need to be any extra code when reading the
value.
--
David Roundy
http://www.abridgegame.org
.
Of course, you could also define a
writeConfig :: FilePath - Config - IO ()
but then a user of your class could accidentally overwrite a change, if you
had two parts of the code which read the same config, each made separate
changes, and then each wrote their separate changes.
--
David Roundy
.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
question: can you write a separate version of a
function for the case where its argument is within a more specific class?
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
= unsafePerformIO $ do ma - deRefWeak wa
case ma of
Nothing - return emptyWeak
Just b - mkWeakPtr (f b) Nothing
--
David Roundy
http://www.abridgegame.org
error message, so I
use fail and error raw to indicate actual user errors.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
, since wc -l would be something
like a two-liner...
--
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
in haskell.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
isn't
an option.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
...)
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
compile this with -O -funbox-strict-fields, so the packed string
contents are unboxed, if that makes any difference.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Thu, Mar 25, 2004 at 11:39:26AM -0800, Carl Witty wrote:
On Thu, 2004-03-25 at 10:09, David Roundy wrote:
The function is a simple packed string compare, and I basically just call
the C standard library function memcmp for this. Without further ado:
I don't know how to make your
% 1;
part_stack :: [Int]
part_stack = [0,50]
Note that I've performed a memoization optimization--this makes the code
both smaller, faster and easier to read! :P
But seriously, the C code doesn't do anything. Why do you want to
translate it? (Unless it's homework...)
--
David Roundy
http
, if you don't think of it as (is_less_than a) b, one might
naturally think that (is_less_than a b) should be (a b).
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
setPermissions f (p {writeable = True})
should make the file world-writeable or just user-writeable. I don't know
about that. But at a minimum, it should preserve world-readability.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing
(fileStatus, fileMode, setFileMode
etc.).
Well, in my case all I want to do is to copy permissions from one file to
another, so get/setPermissions would have been fine. But yeah, I've
already switched to using setFileMode etc.
--
David Roundy
http://www.abridgegame.org
] + g[i],
if_ a $ doexp out[i][j][k] += x,
if_ b $ doexp out[i][j][k] /= y[i][j][k]
]
There are also features relating to expressions, which can simplify
arithmetic for cases where a variable is known to be one or zero. But in
general, it's an ugly piece of code...
--
David Roundy
http
result) using
f = a `or_maybe` b `or_maybe` c
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
want to do. :(
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
the
standard system calls used by getCurrentDirectory etc accept CStrings).
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
, then the prelude catch will catch
them, which is more likely what you want.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
it, rather than user error, which makes them
wonder if they did something wrong.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
userErrors at the top level and failing with my own error message?
--
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Tue, Nov 11, 2003 at 04:49:29PM +0100, Marcin 'Qrczak' Kowalczyk wrote:
On, 10-11-2003, at 16:41, David Roundy wrote:
I was wondering why System.Posix.Signals is as it is, and whether it could
be rewritten to use exceptions, which seems like the obvious way to handle
signals.
I don't
.
Is there a problem with this idea?
--
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
make problems, +RTS -p works
fine. I get a message meaning the equivalent of statement in
'0x0058db43' points to memory in '0xfffc'. Could not read.)
I believe this bug is fixed in CVS, so you could get it there or wait for
6.2. (I didn't fix it, I just reported it.)
--
David Roundy
http
-type programs to be
written, as long as you don't also call hSetBuffering on the same
Handle.
Yay! That seems like precisely the right thing to do. :)
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED
On Fri, Oct 17, 2003 at 06:17:00PM -0400, Isaac Jones wrote:
David Roundy [EMAIL PROTECTED] writes:
Do you want to embed Haskell code or to embed a Haskell interpreter?
I actually would like to embed a Haskell interpreter.
(snip)
H. I may be able to get by without calling
support 64 bit platforms.
Is there a solution to these problems, or will I be stuck with thousands of
parentheses in my input file?
--
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org
of
misinformation. It seems that as long as you set stdin's buffering back to
LineBuffering before you exit, you are safe from messing up the terminal
settings.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http
, before I can seriously consider
starting work on a haskell interface.
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
, as in rascal or tattle. I feel silly telling people what a
great language it is, when I can't even pronounce its name... :)
--
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
even on small
test runs (rather than my monster run that kills swap on my machine), so if
you want a test case I can pretty easily get it for you. Although it won't
be a small amount of code, it at least wouldn't require 200M of data.
--
David Roundy
http://www.abridgegame.org
at a loss as
to how to track this problem down, so any advise would be appreciated.
--
David Roundy
http://www.abridgegame.org/darcs
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
, but such
is life.
Anyhow in case anyone is interested, I'm attaching the code. It creates a
pipe using pipe(2) and spawns a thread to pass the data between the pipe
and gzread or gzwrite. It's not pretty, but it's better than any other
solution I could think of. Suggestions or criticisms are welcome.
--
David
On Wed, Sep 03, 2003 at 02:28:18PM -, [EMAIL PROTECTED] wrote:
Are anyone aware of a haskell html-colorizer a' la the emacs-mode?
I've never used it, but webcpp may be what you're looking for.
http://webcpp.sourceforge.net/
--
David Roundy
http://civet.berkeley.edu/droundy
and 5 can be
installed in parallel without problems, and if you're writing pure haskell
98 with no extensions (as I imagine the book does), you should be able to
use either one with no problems.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe
will depend on the number of processors, but it was
definitely worth the effort (a day) to make all the intermediate results
are calculated in precisely the same order (that is, order of additions)
regardless of number of processors, just so I could have the strict
equality test.
--
David Roundy
http
fairness, so does gcc. I think it took two or three hours for me. It also
uses lots of memory, so you may be swapping like crazy.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
problems.
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
solution. If I remember correctly
floating constants themselves are defined in terms of fromRational, so you
shouldn't be introducing any additional conversion.
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL
. This looks to me like a bug in
either Text.Regex or glibc (with my bet being on Text.Regex. Any ideas how
to track it down and/or work around it?
Oh yeah, and I'm running ghc 6.0. Maybe this is fixed in CVS?
--
David Roundy
http://www.abridgegame.org
for. Fortunately, however, I've already found my bug by
a combination of inspection and good old Debug.Trace (which just served to
show me which file was being read when it crashed).
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
s = map (concatMap (++ \n)) $ break null $ lines s
(warning: untested code!)
David Roundy
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Wed, Apr 02, 2003 at 06:45:54AM -0500, David Roundy wrote:
tok s = map (concatMap (++ \n)) $ break null $ lines s
This should be
tok s = map unlines $ break null $ lines s
which restores the symmetry to the operation, and is therefore much more
readable.
David
time_t (integral number of
seconds since the epoch).
Thanks for the pointer! It seems I had totally missed the documentation on
hslibs, and was thus looking in entirely the wrong place. (Feeling
somewhat foolish...)
--
David Roundy
http://civet.berkeley.edu/droundy
.
--
David Roundy
http://www.abridgegame.org
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Wed, Mar 26, 2003 at 07:40:30AM -0800, Andy Moran wrote:
On Wednesday 26 March 2003 07:23 am, David Roundy wrote:
I would try using Debug.Trace.trace. It takes a string and an expression,
and returns the expressions while outputting the string to stderr (I
think). You can choose your
to use the low level
interface?
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
by something like:
whatisit :: String - IO String
whatisit f = do
ifM doesDirectoryExist f
then return dir
else ifM doesFileExist f
then return file
else return nothing
Is there any way I could do something like this?
--
David Roundy
http://civet.berkeley.edu
it with
the IO monad normally.
Is there any nice way to open up a file descriptor? I was looking at the
ghc internal code, which has an openFd function that would do what I want,
but it doesn't seem to be exported. :( Any ideas?
--
David Roundy
http://civet.berkeley.edu/droundy
On Sat, Feb 01, 2003 at 07:20:56PM -0500, David Roundy wrote:
Is there any nice way to open up a file descriptor? I was looking at the
ghc internal code, which has an openFd function that would do what I want,
but it doesn't seem to be exported. :( Any ideas?
Never mind. I found out
of installation.
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
result, and work up from there, testing your code each time you
add a new function. I recommend starting with the Gentle Introduction
(http://www.haskell.org/tutorial/).
Good luck on your haskelling!
--
David Roundy
http://civet.berkeley.edu/droundy
On Thu, Oct 24, 2002 at 09:44:17AM -0500, Andy Schmidt wrote:
So let me know what I need to do in order to get started.
What operating system are you using?
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL
.)
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
in that function. I'm still something like 100 times slower
than GNU diff, so I think (hope, certainly!) there's still room for more
improvement (another day). I'm sure I'll have more questions in a few
days, once I've tracked down what the new bottlenecks are.
--
David Roundy
http://civet.berkeley.edu
unless something is terribly wrong (which must be
the case here).
If it would help, I'd be happy to send a listing of the complete code, but
it's 6.5k so I figured it'd be better not to send it, since it seems
unlikely that anyone would want to run it anyways.
--
David Roundy
http
that I have done nothing to optimise for speed!
btw, thank you also to everyone else who gave me advice!
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
, and uses an array (which I'm none too familiar
with in haskell), and there aren't any smaller parts that I can see to
test. :(
--
David Roundy
http://civet.berkeley.edu/droundy/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
) sorting, and this is a bit awkward to
accomplish efficiently with lists. I would have thought that this
awkwardness should be dealt with in the standard library, but seeing an
O(n^2) algorithm in the description troubles me.
--
David Roundy
http://civet.berkeley.edu/droundy
301 - 388 of 388 matches
Mail list logo