... I hit Chapter 3 and started reading about expressions.
*If you are able to answer any of these questions, please send me an
email. I am very lost and confused in this section, so even one
answered question may help greatly.*
I actually decided to sit down and figure out the Haskell 98
Ian,
This is all programming language parsing jargon. If the Wikipedia
doesn't help (try http://en.wikipedia.org/wiki/Formal_grammar), I
recommend the first few chapters of Aho, Sethi, Ullman's Compilers:
Principles, Techniques, and Tools aka the dragon book, or any good
book on compilers, e.g.,
On Fri, Aug 17, 2007 at 04:50:02AM -0700, Ian Duncan wrote:
So here's my list of questions so far:
1. What are nonterminals?
2. What are productions and substitutions?
[snip]
Sounds to me like you want a book on language design, grammars,
parsing, etc. :-)
There are many good ones out
Hi all.
I want to create the following polymorphic type (EnvItem) that we can apply two
functions (envKey and envValue). I tried the following:
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem (Key, a) - String
envKey EnvItem (key, value) = key
envValue ::
On Aug 17, 2007, at 9:11 , rodrigo.bonifacio wrote:
envKey :: EnvItem (Key, a) - String
envKey EnvItem (key, value) = key
envValue :: EnvValue(Key, a) - a
envValue EnvItem (key, value) = value
But this is resulting in the error: [Constructor EnvItem must
have exactly 1 argument in
- Ursprüngliche Nachricht -
Von: rodrigo.bonifacio [EMAIL PROTECTED]
Datum: Freitag, August 17, 2007 3:11 pm
Betreff: [Haskell-cafe] Basic question
Hi all.
I want to create the following polymorphic type (EnvItem) that we
can apply two functions (envKey and envValue). I tried
Not only does you lack some parens around your patterns, your function
types are wrong :
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem a - String
envKey (EnvItem (key, value)) = key
envValue :: EnvItem a - a
envValue (EnvItem (key, value)) = value
--
Jedaï
Levi Stephen wrote:
Hi,
Apologies for a long post that may not be totally clear. I was thinking
through
a problem and how the data might be represented in Haskell. I'm now
stuck and
frustrated. Now, I'm not even sure whether I'm on the right track (I might
still be thinking too OO).
17 Aug 2007 14:44:28 +0100, Jon Fairbairn [EMAIL PROTECTED]:
Why not
data EnvItem a = EnvItem {key:: Key, value:: a}
It's the real solution, but I feel it was worthwhile to underscore the
other mistakes (often encountered by the newbies) in types and
parameters.
--
Jedaï
On 8/16/07, ok [EMAIL PROTECTED] wrote:
We're going to have to keep track of whether we have a last element
or not. The obvious candidate for this is Maybe x. Initially there
is no element, Nothing.
f x Empty = Just x
f x (Just y) = Just y
This picks up a new value (x) when there
[EMAIL PROTECTED]:~cat test.hs
import Debug.Trace
foo = foldl (\first second -
(trace ( first: ++ ( show first) ) first)
+
(trace ( second: ++ (show second) ) second) ) 0 [1,2,3]
bar = foldl (+)
traceIt x = trace (\nTraceIt:\n++show x++\n) x
[EMAIL PROTECTED]:~ghc -e foo test.hs
first:
Post the the library mailing list at [1] is the Boyer-Moore algorithm
implemented for strict and lazy bytestrings (and combinations thereof). It
finds all the overlapping instances of the pattern inside the target.
I have performance tuned it. But the performance for searching a strict
On 8/16/07, Matthew Brecknell [EMAIL PROTECTED] wrote:
However, it's possible that your use of this function is forcing
evaluation of a deeply-nested thunk you've created somewhere else (as
print does in the foldl example).
Thank you for the detailed and helpful reply. I was led to this
On 8/17/07, apfelmus [EMAIL PROTECTED] wrote:
Extracting the head and tail of ss with a let statement could lead to
a huge unevaluated expression like
rest = tail (tail (tail (...)))
Even though they are probably forced, would breaking the head and tail
apart via pattern-matching or a
or actually just...
[EMAIL PROTECTED]:~cat test.hs
import Debug.Trace
foo = foldl (\first second -
trace ( ( show first) ++ (+) ++ (show second ) )
( first + second) ) 0 [1,2,3]
[EMAIL PROTECTED]:~ghc -e foo test.hs
0+1
1+2
3+3
6
[EMAIL PROTECTED]:~
is probably better
Thomas Hartman
On 8/17/07, rodrigo.bonifacio [EMAIL PROTECTED] wrote:
Hi all.
I want to create the following polymorphic type (EnvItem) that we can
apply two functions (envKey and envValue). I tried the following:
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem (Key, a) -
Justin Bailey wrote:
apfelmus wrote:
Extracting the head and tail of ss with a let statement could lead to
a huge unevaluated expression like
rest = tail (tail (tail (...)))
Even though they are probably forced, would breaking the head and tail
apart via pattern-matching or a case
On 8/17/07, rodrigo.bonifacio [EMAIL PROTECTED] wrote:
Hi all.
I want to create the following polymorphic type (EnvItem) that we can apply
two functions (envKey and envValue). I tried the following:
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem (Key, a) -
I'm trying to build the latest regex base, which is required for the other
regex packages under ghc 6.7
It complains that it can't find Data.Sequence, because it's in a hidden
module containers. I added containers to the cabal depends as can be seen
in the grep below.
And containers isn't
On Fri, Aug 17, 2007 at 02:40:33PM -0400, Thomas Hartman wrote:
I'm trying to build the latest regex base, which is required for the other
regex packages under ghc 6.7
It complains that it can't find Data.Sequence, because it's in a hidden
module containers. I added containers to the cabal
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
thanks stefan, I did remember that discussion (actually also an answer to
a question I asked.)
I got from that that previous help that I had to edit the cabal file.
The problem here, as you say, is that I had not re-run runghc Setup.hs
configure.
thanks,
thomas.
Stefan O'Rear [EMAIL
trying to compile regex-tdfa, I ran into another issue. (earlier I had a
cabal problem but that's resolved.)
there's a line that won't compile, neither for ghc 6.6.1 nor 6.7
import
GHC.Prim(MutableByteArray#,RealWorld,Int#,sizeofMutableByteArray#,unsafeCoerce#)
so the fresh darcs regex tdfa
Did I find a bug cabal?
I have attempted to fix the problem
Main.c:(.text+0x22): undefined reference to `__stginit_ZCMain'
by compiling my Haskell library using the flag -no-hs-main. One would think
that this would make sense if the library is to be used by an external C
program. However I
On Fri, Aug 17, 2007 at 04:27:29PM -0400, Thomas Hartman wrote:
trying to compile regex-tdfa, I ran into another issue. (earlier I had a
cabal problem but that's resolved.)
there's a line that won't compile, neither for ghc 6.6.1 nor 6.7
import
Matthew Brecknell wrote:
The key point of the example is that foldl itself doesn't need any of
the intermediate values of the accumulator, so these just build up into
a deeply-nested unevaluated thunk. When print finally demands an
integer, the run-time pushes a stack frame for each level of
Gwern Branwen wrote:
On 0, Andrew Coppin [EMAIL PROTECTED] scribbled:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Take a look at issue 6 of The Monad Reader; search for time
On 8/17/07, Andrew Coppin [EMAIL PROTECTED] wrote:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Suppose you buy into the notion that monads sequence actions. Then
consider the following
On 8/17/07, Dan Piponi [EMAIL PROTECTED] wrote:
On 8/17/07, Andrew Coppin [EMAIL PROTECTED] wrote:
That sounds completely absurd to me... can anybody explain?
Except...you can switch on ghc's special time travel features...
On reflection I decided my example isn't very convincing. For one
Joe Buehler wrote:
What is the point in building this huge thunk if it can't be evaluated
without a stack overflow?
It's not that there's a point to it, it's just the behaviour of foldl.
Hence you shouldn't be using foldl.
GHC's strictness analyser can sometimes save you from yourself if
The HsOpenSSL package[1] is good work, but the author doesn't respond
to email(*). I've a bunch of darcs patches to add tests, DSA support
and fast Integer - BIGNUM functions. Can I use my Hackage account to
upload version 0.2 if someone else uploaded 0.1? It is reasonable?
I'm guessing that this
For a really good article to see how foldr is in fact very powerful
and how you can make it do some funny tricks, see the Monad.Reader 6th
issue :
http://www.haskell.org/sitewiki/images/1/14/TMR-Issue6.pdf
I'll point out that you can write a lazy dropWhile with foldr in the
style of the first
2007/8/18, Chaddaï Fouché [EMAIL PROTECTED]:
For a really good article to see how foldr is in fact very powerful
and how you can make it do some funny tricks, see the Monad.Reader 6th
issue :
http://www.haskell.org/sitewiki/images/1/14/TMR-Issue6.pdf
I just saw this was already linked in
I finally decided to actually solve the problem, and I'm sorry to say I
was on the wrong track. ListT won't do it on its own: you actually need
a custom monad that does the random pick in the bind operation.
Attached are a module to solve the problem and a Main module that tests
it. I hope
Andrew Coppin writes:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Actually, borrowing from the future - in an interpretation which is close
to my own interests - doesn't need
[EMAIL PROTECTED] wrote:
Andrew Coppin writes:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Actually, borrowing from the future - in an interpretation which is
close
to my own
Thanks Stefan. I got regex tdfa to compile on 6.7. FWIW, here's a patch,
generated with darcs whatsnew against a fresh unzip of regex tdfa 0.92
I didn't patch against the darcs head because this uses a language
progma in {-# options #-} in some file*, which ghc 6.7 didn't know what to
do with,
On Fri, Aug 17, 2007 at 08:13:55PM -0400, Thomas Hartman wrote:
Thanks Stefan. I got regex tdfa to compile on 6.7. FWIW, here's a patch,
generated with darcs whatsnew against a fresh unzip of regex tdfa 0.92
I didn't patch against the darcs head because this uses a language
progma in {-#
On 8/17/07, Kim-Ee Yeoh [EMAIL PROTECTED] wrote:
Lennart Augustsson wrote:
And as a previous poster showed, ghc does concatenate strings.
And Haskell (as in the current language definition) does not.
I was talking about Haskell.
Haskell says nothing about compile time or run time in
On 8/17/07, Kim-Ee Yeoh [EMAIL PROTECTED] wrote:
Incidentally, GHC's type checker is Turing complete. You
already have as much static evaluation as is practically possible.
You already knew that.
I don't see how the first statement implies the second.
Cheers,
Tim
--
Tim Chevalier *
Dan Weston wrote:
I hate to be a party pooper, but isn't this just:
f = foldr (\a z - (a:snd z,fst z)) ([],[])
This takes less time to grok and takes no longer to run.
For each type with exported constructors, one can always write
deconstructors for it, if not already found in libraries.
I agree. Computation on the type level does not imply computation on the
value level.
On 8/18/07, Tim Chevalier [EMAIL PROTECTED] wrote:
On 8/17/07, Kim-Ee Yeoh [EMAIL PROTECTED] wrote:
Incidentally, GHC's type checker is Turing complete. You
already have as much static evaluation as is
Dan Piponi wrote:
On 8/17/07, Dan Piponi [EMAIL PROTECTED] wrote:
On 8/17/07, Andrew Coppin [EMAIL PROTECTED] wrote:
That sounds completely absurd to me... can anybody explain?
Except...you can switch on ghc's special time travel features...
On reflection I decided my
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.
My guess is that profiling will only sometimes be useful in diagnosing
stack overflows, because I
Andrew Coppin wrote:
Surely all this means is that the magical mdo keyword makes the
compiler arbitrarily reorder the expression...?
It is not magical but simple syntactic sugar. And no, the compiler does
not 'arbitrarily reorder' anything, you do the same in any imperative
language with
On 8/18/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Surely all this means is that the magical mdo keyword makes the
compiler arbitrarily reorder the expression...?
What mdo actually does is described here:
http://www.cse.ogi.edu/PacSoft/projects/rmb/mdo.pdf
My last example desugars to:
test =
Hi all,
Recently I am considering doing part of my job using Haskell.
My duty is writing a network server which talks to another server through a
binary based private protocol.
As the old version of this component is written in C, it's very natural that
this protocol is base on C structure
I'm a little surprised no one's tried a parallel solution yet,
actually.
We've got an SMP runtime for a reason, people!
I hacked up a parallel version of Richard Bird's function pearl solver:
http://www.haskell.org/sitewiki/images/1/12/SudokuWss.hs
It not really optimized, but there are a
As I am a newbie to Haskell, I am not sure how to handle this problem
with less work. Do you have any ideas about this problem?
Thanks in advance!
Have a look at
http://haskell.org/haskellwiki/Applications_and_libraries/Data_structures
section 3 (IO) -
When reading an article about tail recursion
(http://themechanicalbride.blogspot.com/2007/04/haskell-for-c-3-programmers.
html) I came across the follow statements:
If you can write a non-recursive function that uses the colon syntax it is
probably better than a tail recursive one that doesn't.
On Sat, 2007-08-18 at 20:35 +0200, Peter Verswyvelen wrote:
When reading an article about tail recursion
(http://themechanicalbride.blogspot.com/2007/04/haskell-for-c-3-programmers.
html) I came across the follow statements:
If you can write a non-recursive function that uses the colon
I've started a blog series on writing a chess engine in Haskell. I
just posted the second blog entry today:
http://sequence.complete.org/node/361
I suspect there's more work to be done on that function, though. It
seems like there should be a nice way to remove that flip in apply.
Any thoughts?
L.S.,
Now that all hawiki pages have been removed, we have lost some valuable
information. For example The Monad.Reader; on
http://www.haskell.org/haskellwiki/The_Monad.Reader it says:
Older editions can be found on the old Haskell wiki – they haven't been
included here for licensing
Andrew Wagner wrote:
I've started a blog series on writing a chess engine in Haskell. I
just posted the second blog entry today:
http://sequence.complete.org/node/361
I suspect there's more work to be done on that function, though. It
seems like there should be a nice way to remove that flip in
Hi,
I am trying to implement quadratic fields Q(sqrt d). These are numbers of the
form a + b sqrt d, where a and b are rationals, and d is an integer.
In an earlier attempt, I tried
data QF = QF Integer Rational Rational
(see http://www.polyomino.f2s.com/david/haskell/hs/QuadraticField.hs.txt)
Use
value :: a - Integer
On 8/18/07, DavidA [EMAIL PROTECTED] wrote:
Hi,
I am trying to implement quadratic fields Q(sqrt d). These are numbers of
the
form a + b sqrt d, where a and b are rationals, and d is an integer.
In an earlier attempt, I tried
data QF = QF Integer Rational
DavidA wrote:
Hi,
I am trying to implement quadratic fields Q(sqrt d). These are numbers of the
form a + b sqrt d, where a and b are rationals, and d is an integer.
...
class IntegerType a where
value :: Integer
The problem is, this doesn't work. GHC complains:
The class method
foo n = if n0 then [] else n : foo (n-1)
bar n = aux 0 [] where
aux i xs = if in then xs else aux (i+1) (i:xs)
that foo is more efficient than bar because lazy evaluation of foo just puts
the delayed computation in the cdr of the list, while lazy evaluation of
bar has to keep track of
Twan van Laarhoven twanvl at gmail.com writes:
The solution is to use a dummy parameter:
class IntegerType a where
value :: a - Integer
And call it like:
f = value (undefined :: Two)
So for instance:
instance IntegerType d = Show (QF d) where
show (QF a b) = show a ++
On Saturday 18 August 2007 19:05:04 Wouter Swierstra wrote:
I hacked up a parallel version of Richard Bird's function pearl solver:
http://www.haskell.org/sitewiki/images/1/12/SudokuWss.hs
It not really optimized, but there are a few neat tricks there.
Rather than prune the search space by
This isn't really a Haskell question but I'm guessing some Haskell
hackers have a solution. MacOS X's Spotlight doesn't seem to be able
to search for text in .lhs and .hs files. But it can find text in .txt
files. Is there a way of getting Spotlight to treat .lhs and .hs files
like .txt files so I
2007/8/19, Daniel C. Bastos [EMAIL PROTECTED]:
Any help is appreciated.
I also had problem with this exercise. However this was more Haskell
newbie problem :)
If you're feeling lost you can always try google and come up with this
blog with solutions to exercises from this book. You should find
(*) Exercise 2.2
Define a function regularPolygon :: Int - Side - Shape such that
regularPolygon n s is a regular polygon with n sides, each of length
s. (Hint: consider using some of Haskell's trigonometric
functions, such
as sin :: Float - Float, cos :: Float - Float, and tan :: Float
Hi,
The Haskell desugaring for list comprehensions is given in:
http://haskell.org/onlinereport/exps.html#list-comprehensions
All the rules seem to be left to right rewrites, apart from the second
one, which seems to be right to left. Is there some deep reason for
this, or is this accidental.
Hi
Sorry for the noise, I've now realised they are a left to right
rewrite system, the second rule is required to set up the base case.
Thanks
Neil
On 8/19/07, Neil Mitchell [EMAIL PROTECTED] wrote:
Hi,
The Haskell desugaring for list comprehensions is given in:
Setup.hs:13:7:
Could not find module `Distribution.Compat.FilePath':
it is hidden (in package Cabal-1.1.6.2)
This is what I did to make takusen build with ghc-6.6.1:
[EMAIL PROTECTED]: .../haskell/takusen_0 darcs whatsnew
{
hunk ./Setup.hs 13
-import
Does GHC do stuff like converting (2*) into (shift 1) or converting x +
x into 2*x?
If I do x * sin 12, is GHC likely to compute sin 12 at compile-time?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Since it is not really Haskell related, I have answered by email. If
anyone is interested, don't hesitate to email me.
alpheccar.
This isn't really a Haskell question but I'm guessing some Haskell
hackers have a solution. MacOS X's Spotlight doesn't seem to be able
to search for text in .lhs
Neil Mitchell wrote:
The Haskell desugaring for list comprehensions is given in:
http://haskell.org/onlinereport/exps.html#list-comprehensions
All the rules seem to be left to right rewrites, apart from the second
one, which seems to be right to left. Is there some deep reason for
this, or is
DavidA wrote:
Twan van Laarhoven twanvl at gmail.com writes:
The solution is to use a dummy parameter:
class IntegerType a where
value :: a - Integer
Thanks to all respondents for this suggestion. That works great.
I prefer a slightly elaborate way,
newtype Mark n t = Mark t
Hi
I am using collections-0.3 and need to perform some operations on keys resp.
values of a map. In the concrete implementations there are functions
like 'elems' and 'keys' but there is no such thing in Data.Collections.
Instead there are the types 'ElemsView' and 'KeysView' and
functions
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 reason I expected that the instances of Get and Put for Float and
Double would send across the
On 8/19/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Does GHC do stuff like converting (2*) into (shift 1) or converting x +
x into 2*x?
Hmm, that's an interesting architecture where multiplication is
cheaper than addition :-)
If I do x * sin 12, is GHC likely to compute sin 12 at
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 *really* shouldn't be using
Thanks. I got confused because the StackOverflow link on
http://www.haskell.org/haskellwiki/HaWiki_migration
is dead.
-Original Message-
From: Derek Elkins [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 18, 2007 8:54 PM
To: Peter Verswyvelen
Cc: haskell-cafe@haskell.org
Subject: Re:
The page
http://www.haskell.org/haskellwiki/Applications_and_libraries/Mathematics#Number_representations
lists several implementations of several flavours of computable reals,
which may be useful for you.
___
Haskell-Cafe mailing list
On 8/19/07, Frank Buss [EMAIL PROTECTED] wrote:
(*) Exercise 2.2
Define a function regularPolygon :: Int - Side - Shape such that
regularPolygon n s is a regular polygon with n sides, each of length
s. (Hint: consider using some of Haskell's trigonometric
functions, such
as sin ::
Subject: IO in HApps handler ?
I am trying to add a handler that would run an external command in
HApps 0.8.8, and I got a type issue I do not know how to get around..
can we have IO in a handler ?
testcmdpost.hs:52:8:
Couldn't match expected type `Ev st Request'
against inferred
Date: Sun, 19 Aug 2007 12:39:50 +0200
Subject: Fwd: ghc 6.7 /6.8
hello.
will 6.7 be released, or will only 6.8 be ?
( i.e do you use an even/uneven
relesing number convention)
-in that case, does the 6.8 branch means the freeze is on, and what would be
the target for 6.8 ? Q3/2007 ? Q4 ?
(
Hi
will 6.7 be released, or will only 6.8 be ?
6.7 is the HEAD branch, 6.8 will be released.
-in that case, does the 6.8 branch means the freeze is on, and what would be
the target for 6.8 ? Q3/2007 ? Q4 ?
Soon, in the next month - according to latest targets/estimates.
( context: I am
Stefan O'Rear wrote:
On Fri, Aug 17, 2007 at 04:27:29PM -0400, Thomas Hartman wrote:
trying to compile regex-tdfa, I ran into another issue. (earlier I had a
cabal problem but that's resolved.)
there's a line that won't compile, neither for ghc 6.6.1 nor 6.7
import
On Sun, Aug 19, 2007 at 11:25:49PM +0100, ChrisK wrote:
#ifdef __GLASGOW_HASKELL__
foreign import ccall unsafe memcpy
memcpy :: MutableByteArray# RealWorld - MutableByteArray# RealWorld -
Int# - IO ()
{-# INLINE copySTU #-}
copySTU :: (Show i,Ix i,MArray (STUArray s) e (ST s))
Hi folks!
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 the
Maps
From: Rafael Almeida [mailto:[EMAIL PROTECTED]
I used the cosine law in order to calculate r. After all, s is
actually the size of the side of the polygon and not the distance of
its vertices from the origin.
You are right, my solution was wrong. If you don't mind rounding errors,
this is
Hi TAESCH,
THat's what haskell is good for.
It prevents you from doing unsafe things by accident.
You must get the source and have a look at the definition of the Ev
type: (module HAppS.MACID.Types where:)
(Not sure wether this code is most recent or not (Version: 0.8.8))
=
Subject: IO in HApps handler ?
I am trying to add a handler that would run an external command in
HApps 0.8.8, and I got a type issue I do not know how to get around..
can we have IO in a handler ?
http://www.haskell.org/haskellwiki/HAppS_tutorial#Application
The MACID monad lets you update
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
201 - 300 of 102226 matches
Mail list logo