Andrew Wagner wrote:
So, in writing my chess engine, I've been trying to maintain 2 Map
objects. One maps squares on the board to Ints, the other maps Ints to
actual Pieces. It occurred to me that it would be useful to explicitly
have a Bi-directional Map, which does the maintenance of keeping
I was playing with some code for compiling regular expressions to finite
state machines and I ran into the following problem. I've solved it, but
I'm not terribly happy with my solution and was wondering if someone
could come up with a better one. :-)
Essentially I have
data FSM = State {
foldr on ElemsView is defined as such:
foldr f i (ElemsView c) = foldr (f . snd) i c
so, for example:
getElementList = toList . ElemViews
When I designed this code (some years ago), I didn't like the fold of Map to
have the type:
fold :: (a - b - b) - b - Map k a - b
This just doesn't
I have a C function of type
void f ( HsWord32* p0, HsWord32* p1, HsWord32 size );
along with the FFI declaration:
foreign import ccall unsafe f :: Ptr Word32 - Ptr Word32 - Word32 - IO
()
In my Haskell code I have an unboxed IO array of Word32; IOUArray Int
Word32.
I want to pass the
On Monday 20 August 2007 07:27:04 Ryan Ingram wrote:
I have a C function of type
void f ( HsWord32* p0, HsWord32* p1, HsWord32 size );
along with the FFI declaration:
foreign import ccall unsafe f :: Ptr Word32 - Ptr Word32 - Word32 -
IO ()
In my Haskell code I have an unboxed IO
On 8/18/07, Matthew Brecknell [EMAIL PROTECTED] wrote:
Justin Bailey:
Would retainer profiling help me see what was building up
this large thunk/closure?
I'm not really familiar enough with GHC's profiling to answer that, but
I'll take a guess.
You're experimental programs have given me
Not really more efficient but plays to the language
implementation's strengths.
Imagine
take 10 $ foo (10^9)
and
take 10 $ bar (10^9)
bar wouldn't evaluate until the 10^9 was done. (And I just
ground my laptop to a halt checking that. :) foo on the other
hand would run out to 10^6
Lanny Ripple wrote:
Not really more efficient but plays to the language implementation's
strengths.
Imagine
take 10 $ foo (10^9)
and
take 10 $ bar (10^9)
bar wouldn't evaluate until the 10^9 was done. (And I just ground my
laptop to a halt checking that. :) foo on the other hand
David Ritchie MacIver wrote:
I was playing with some code for compiling regular expressions to finite
state machines and I ran into the following problem. I've solved it, but
I'm not terribly happy with my solution and was wondering if someone could
come up with a better one. :-)
cafe, is there a way to patch the build-depends line of a cabal file
without breaking backwards compatibility?
I just patched HDBC head to compile under ghc 6.7. Unfortunately it now
won't compile in 6.6.1.
is there a way for build-depends to detect which version of ghc you're on?
also I
problemw with the -I flag to ghc are causing cabal install to fail for
hdbc-odbc (darcs head).
man ghc still reports that -I is a valid flag after installing ghc 6.7
from darcs head a couple days ago.
I think the problem might be the space after the -I flag (which is bad for
both 6.6.1 and
Stefan O'Rear wrote:
On Sun, Aug 19, 2007 at 12:53:07PM +0100, Andrew Coppin wrote:
Does GHC do stuff like converting (2*) into (shift 1) or converting x + x
into 2*x?
For a good time, compile some code which uses even or odd :: Int - Bool
using -O2 -fasm -ddump-asm... The compiler
On 20 aug 2007, at 18.37, Thomas Hartman wrote:
cafe, is there a way to patch the build-depends line of a cabal
file without breaking backwards compatibility?
I just patched HDBC head to compile under ghc 6.7. Unfortunately it
now won't compile in 6.6.1.
is there a way for
so you get
$ runghc Setup.hs configure
Setup.hs: Multiple description files found. Please use only one of :
[HaXml.cabal,HaXml-darcs.cabal]
is there a way to specify which cabal file should be used, or do you just
have to move a file out out the way with eg
mv HaXml.cabal HaXml.cabal.tmp
On 8/20/07, apfelmus [EMAIL PROTECTED] wrote:
Andrew Wagner wrote:
It occurred to me that it would be useful to explicitly
have a Bi-directional Map, which does the maintenance of keeping the
Maps synchronized behind the scenes. Thus, Bimap was born!
... most of the map functions
On Mon, Aug 20, 2007 at 05:27:04AM -0700, Ryan Ingram wrote:
I have a C function of type
void f ( HsWord32* p0, HsWord32* p1, HsWord32 size );
along with the FFI declaration:
foreign import ccall unsafe f :: Ptr Word32 - Ptr Word32 - Word32 - IO
()
In my Haskell code I have an
On 8/19/07, Matthew Sackman [EMAIL PROTECTED] wrote:
But it's vastly harder to do that for floats / non-integers. Now I know
that the number classes in the Prelude are basically broken anyway and
all really need rewriting, but it does seem completely arbitrary that
Words somehow are only
Take a look at the Cabal.cabal file, how this is solved, atm.
where is this, how can I take a look at it?
The next release of Cabal (and the current HEAD) supports conditionals
I couldn't install head, but since I'm running 6.7, do I already have it?
[EMAIL
Hi
Distribution/Simple/InstallDirs.hs:267:36:
Not in scope: `dropDrive'
[EMAIL PROTECTED]:~/installs/cabal-head/caballs -l `which ghc`
lrwxrwxrwx 1 root root 31 2007-08-20 11:08 /usr/local/bin/ghc -
/usr/local/bin/ghc-6.7.20070816
You'll need to upgrade the filepath library as well,
On Mon, Aug 20, 2007 at 11:21:01AM -0500, Lanny Ripple wrote:
Not really more efficient but plays to the language implementation's
strengths.
Imagine
take 10 $ foo (10^9)
and
take 10 $ bar (10^9)
bar wouldn't evaluate until the 10^9 was done. (And I just ground my
laptop to a
On Mon, Aug 20, 2007 at 06:30:27PM +0100, Andrew Coppin wrote:
Stefan O'Rear wrote:
On Sun, Aug 19, 2007 at 12:53:07PM +0100, Andrew Coppin wrote:
Does GHC do stuff like converting (2*) into (shift 1) or converting x + x
into 2*x?
For a good time, compile some code which uses even or
GHC does some constant folding, but little by way of strength reduction, or
using shifts instead of multiplication. It's pretty easy to add more: it's all
done in a single module. Look at primOpRules in the module PrelRules.
Patches welcome! But please also supply test-suite tests that check
On 2007-08-19, Matthew Sackman [EMAIL PROTECTED] wrote:
Recently, Adam Langley responded so:
On 8/18/07, Matthew Sackman [EMAIL PROTECTED] wrote:
Also, one thing to watch out for is the fact the existing Get and Put
instances may not do anything like what you expect. For example, for
some
On 8/20/07, David Ritchie MacIver [EMAIL PROTECTED] wrote:
I was playing with some code for compiling regular expressions to finite
state machines and I ran into the following problem.
I've met exactly the same problem myself and you got me interested in it again.
I think the tricky part isn't
On Mon, Aug 20, 2007 at 03:39:28PM -0700, Dan Piponi wrote:
On 8/20/07, David Ritchie MacIver [EMAIL PROTECTED] wrote:
I was playing with some code for compiling regular expressions to finite
state machines and I ran into the following problem.
I've met exactly the same problem myself and
Al Falloon wrote:
Maybe I am misunderstanding your requirements, but it seems to me that
the simplest solution would be best in this case:
data Widget = BlogWidget [Article]
| TextWidget String
| MenuWiget Menu
| Rows Spacing [Widget]
| Columns Spacing [Widget]
You can also
On 20 aug 2007, at 20.58, Thomas Hartman wrote:
Take a look at the Cabal.cabal file, how this is solved, atm.
where is this, how can I take a look at it?
http://darcs.haskell.org/cabal/Cabal.cabal
See below for a little more explaination.
The next release of Cabal (and the current
A small announcement :)
5 1/2 years after its inception, under the guiding hand of Shae Erisson
(aka shapr), the #haskell IRC channel[1] on freenode has finally reached
400 users!
To chart the growth, we can note that the channel was founded
in late 2001, and had slow growth till 2006,
for sake of argument, suppose an enterprising haskell newbie wanted to
code up concurrent b-trees (really b-link trees) in haskell. if i am
understanding STM correctly, it will NOT help in any way with the
implementation, because of the IO-intensive nature of the algorithms?
so i will have to
On 8/21/07, Ben [EMAIL PROTECTED] wrote:
for sake of argument, suppose an enterprising haskell newbie wanted to
code up concurrent b-trees (really b-link trees) in haskell. if i am
understanding STM correctly, it will NOT help in any way with the
implementation, because of the IO-intensive
David Ritchie MacIver wrote:
Essentially I have
data FSM = State { transitions :: (Map Char FSM) }
and
transitions' :: Regexp - Map Char Regexp
I want to lift this so that the Regexps become states of the finite state
machine (while making sure I set up a loop in the data structure).
31 matches
Mail list logo