Hello Donald,
Thursday, November 2, 2006, 4:31:31 AM, you wrote:
>>Just an example, like opening file "somefile" and separating
>>it into something that can be edited in the code (like 8 bit
>>words) then go to word nr12 and edit the last bit?
> http://haskell.org/haskellwiki/Binary_I
Hi,
When writing IO version, I wasn't aware of other twister versions,
and the only reason is/was that it was easiest to me and that I knew
(believed) that plain lists would have been inefficient. I just wanted
to see and learn, how close to C version this can be made. (And still
do.)
There we
On 02/11/2006, at 4:45 PM, Jason Dagit wrote:
Hello,
I just found it (in ghci and hugs) that this is a valid haskell
program:
let 0 = 1 in 0
This program evaluates to 0 (to my surprise).
This is a weird example of a pattern binding, and it is surprising
(to me) that the syntax is valid
Hello,
I just found it (in ghci and hugs) that this is a valid haskell program:
let 0 = 1 in 0
This program evaluates to 0 (to my surprise).
I expected something similar to how this works:
let { 1 + 1 = 3; 3 + 1 = 7 } in 1 + 1 + 1
Where you get 7.
So, if the 0 is not used as an identifier (ie
The problem with your approach is the gratuitous use of division,
which tends to be very slow.
In my solution, I first generate a list of "seed primes", all primes
less than sqrt 10. Then, for each input m and n, I generate
all multiples of the seed primes between m and n. I then
Thanks a lot.
(you really spoil me;-))
What a stupid mistake I've made!(flush)
I'll rewrite my code later.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Thanks Stefan,-JohnOn 11/1/06, Stefan Holdermans <[EMAIL PROTECTED]> wrote:
John,> My question is, how do I preserve the ordering of entities in my> list and still be able to assign the proper order values to each> entity? Is there an efficient way to do this? How else might I
> improve my orderB
On Wednesday 01 November 2006 10:57, Albert Lai wrote:
> Daniel McAllansmith <[EMAIL PROTECTED]> writes:
> > Hello.
> >
> > I have some html from which I want to extract records.
> > Each record is represented within a number of nodes, and all records
> > nodes are contained by the same parent no
lemmih:
> On 11/1/06, isto <[EMAIL PROTECTED]> wrote:
> >Hi all,
> >
> >On HaWiki was an announcement of MersenneTwister made by Lennart
> >Augustsson. On a typical run to find out 1000th rnd num the output
> >is (code shown below):
> >
> >$ time ./testMTla
> >Testing Mersenne Twister.
> >Resu
The whole point of writing the Mersenne Twister was that I wanted to
show how a stateful computation could be encapsulated in the ST monad
and none of it showing up outside. This aspect of the code is
totally gone now when everything is in the IO monad. Is there some
good reason to have i
On 11/2/06, Lennart Augustsson <[EMAIL PROTECTED]> wrote:
A big problem with the Mersenne Twister is the shifts. As has been
noted elsewhere, ghc doesn't do such a great job on those.
Actually, the shifts are only evaluated once (hurrah for lazy
evaluation) and with -funfolding-use-threshold=1
On 11/1/06, isto <[EMAIL PROTECTED]> wrote:
Hi all,
On HaWiki was an announcement of MersenneTwister made by Lennart
Augustsson. On a typical run to find out 1000th rnd num the output
is (code shown below):
$ time ./testMTla
Testing Mersenne Twister.
Result is [3063349438]
real0m4.925
Am Donnerstag, 2. November 2006 00:06 schrieb Slavomir Kaslev:
> Hello.
>
> I am new to Haskell and I am going through "Haskell: The craft of
> functional programming". I am trying to grasp haskell's classes and
> instances, so here is slightly modified code from the book:
>
> class Show a => Visib
A big problem with the Mersenne Twister is the shifts. As has been
noted elsewhere, ghc doesn't do such a great job on those.
-- Lennart
On Nov 1, 2006, at 20:17 , Donald Bruce Stewart wrote:
Now, this will be hard to get close the the highly tuned C.
Possibly its
doable.
The mai
nuno:
>
>Hi all!
>
>Today i was reading System.IO and didn't manage to
>understand how it works just by reading it.
>I looked the internet for some help on this, but only
>"advanced" information is available.
>Can anyone show me how to use openBinaryFile ?
>Just an exa
On 11/1/06, Farida Mishra <[EMAIL PROTECTED]> wrote:
i would like to post mesg this list
Your wish has been granted.
Cheers!
--Tom Phoenix
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-c
Hi all!
Today i was reading System.IO and didn't manage to understand how it works just by reading it.
I looked the internet for some help on this, but only "advanced" information is available.
Can anyone show me how to use openBinaryFile ?
Just an example, like opening file "somefile" and sepa
Now, this will be hard to get close the the highly tuned C. Possibly its
doable.
The main tricks are documented here:
http://haskell.org/haskellwiki/Performance/GHC#Unboxed_types
Inspecting the Core to ensure the math is being inlined and unboxed will
be the most crucial issue, I'd imagine.
Err, sorry for the meaningless mail subject. Should be 'Newbie class
problem' or something like that.
--
Slavomir Kaslev
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello.
I am new to Haskell and I am going through "Haskell: The craft of
functional programming". I am trying to grasp haskell's classes and
instances, so here is slightly modified code from the book:
class Show a => Visible a where
toString :: a -> String
toString = show
size :: a -> I
Hi all,
On HaWiki was an announcement of MersenneTwister made by Lennart
Augustsson. On a typical run to find out 1000th rnd num the output
is (code shown below):
$ time ./testMTla
Testing Mersenne Twister.
Result is [3063349438]
real0m4.925s
user0m4.856s
I was exercising with the
Apologies if this is a duplicate, the original appears to have gone astray.
On Wednesday 01 November 2006 10:57, Albert Lai wrote:
> Daniel McAllansmith <[EMAIL PROTECTED]> writes:
> > Hello.
> >
> > I have some html from which I want to extract records.
> > Each record is represented within a num
I suppose this might be a good time to announce the tentative availability of BLACK t-shirts in the "Haskell Hackers" design, which in fact features a "monster". (Note that I am only responsible for the composition of elements on the shirt: the monster drawing itself comes from a dingbat font.)The
Two more hints I used in my code:
5) Except for 2, all primes are odd. Don't bother testing the evens.
6) sqrt(n) is (a little) costly, but I used it in my first solution for
clarity. You can also create an infinite list of squares of primes, then
trim the list of primes to the length of (take
I didn't see any other replies and didn't want to leave you hanging, so...
Three hints:
1) you are testing every integer >= 2 as a divisor when you only need to
test prime numbers <= floor(sqrt(n))
2) Since for all n > 2, floor(sqrt(n)) < n, you can use the very primes
you are generating in
Hello haskell-cafe,
just one more nice snippet of code:
classDefaults a where defaultValue :: a
instance Defaults Bool where defaultValue = False
instance Defaults [a]where defaultValue = []
instance Defaults (a->a) where defaultValue = id
instance Num a => Defaults a where default
Henk-Jan van Tuyl wrote:
On Wed, 01 Nov 2006 10:29:18 +0100, Stefan Holdermans
<[EMAIL PROTECTED]> wrote:
sortOnLab = sortBy (\(l, _) (m, _) -> compare l m)
The following does the same:
sortOnLab = sort
Not quite, sortOnLab preserves the order of tuples with the same first
Henk-Jan,
sortOnLab = sortBy (\(l, _) (m, _) -> compare l m)
The following does the same:
sortOnLab = sort
It does, but I kind of liked the analogy with sortOnPrio, which could
have been defined in some other ways as well, of course.
Cheers,
Stefan
On Wed, 01 Nov 2006 10:29:18 +0100, Stefan Holdermans <[EMAIL PROTECTED]>
wrote:
sortOnLab = sortBy (\(l, _) (m, _) -> compare l m)
The following does the same:
sortOnLab = sort
--
Met vriendelijke groet,
Henk-Jan van Tuyl
--
http://Van.Tuyl.eu/
--
Using Opera's revol
Ulf Norell wrote:
> I'm not sure what you're asking...
Me neither probably.
> , but it's possible to get
>
> my_read :: .. => Expr -> Term a
>
> Previously given code:
>
> >-- Give a GADT for representation types
> >data R a where
> > Rint :: R Int
> > Rbool :: R Bool
> > Rpair ::
Hello Greg,It seems that I am late for the party but we used a "GADT parser" in the tool we built for our "Generating Generic Functions" paper[1]. It so happens that I made slides for this material so, if you're interested you can have a look at [2].
The motivation for doing this was that we needed
On 11/1/06, Malcolm Wallace <[EMAIL PROTECTED]> wrote:
"Alexey Rodriguez" <[EMAIL PROTECTED]> wrote:> I have been trying to build hmake 3.12 using ghc-6.6 on a Fedora Core> Linux running on a dual 64-bit Opteron machine. However, I had the
> following error related to the readline library:> ...> I
"Alexey Rodriguez" <[EMAIL PROTECTED]> wrote:
> I have been trying to build hmake 3.12 using ghc-6.6 on a Fedora Core
> Linux running on a dual 64-bit Opteron machine. However, I had the
> following error related to the readline library:
> ...
> I googled for this error and I saw the following th
[EMAIL PROTECTED] wrote:
>
> Greg Buchholz has posed an interesting problem of writing a
> typechecker. Given untyped terms of the form
...snip...
> We show the solution that uses no GADTs and no representation types.
> We retain however the eval function in the previous message that uses
> GADT
Hi
I'm new to Haskell.
I found this site on the Haskell wiki https://www.spoj.pl. But I got some
trouble on trying to solve the problem titled "Prime Generator"
https://www.spoj.pl/problems/PRIME1.
The online-judge system tells me "time limit excedded"
Would you be so kind to tell me how to ma
Hi i would like to post mesg this list
Everyone is raving about the all-new Yahoo! Mail.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello Haskell
people,
I have been
trying to build hmake 3.12 using ghc-6.6 on a Fedora Core Linux running on a
dual 64-bit Opteron machine. However, I had the following error related to the
readline library:
/home/t-alexer/packages/hmake-3.12/script/hmake
-hc=ghc HInteractive
-d/hom
On Wed, Nov 01, 2006 at 10:27:53AM +, Jón Fairbairn wrote:
> "David House" <[EMAIL PROTECTED]> writes:
>
> > On 01/11/06, Andrew Pimlott <[EMAIL PROTECTED]> wrote:
> > > I present here a gentle introduction to monsters.
> >
> > Absolutely brilliant. This certainly made me laugh! Perhaps a
> >
"David House" <[EMAIL PROTECTED]> writes:
> On 01/11/06, Andrew Pimlott <[EMAIL PROTECTED]> wrote:
> > I present here a gentle introduction to monsters.
>
> Absolutely brilliant. This certainly made me laugh! Perhaps a
> light-hearted candidate for the Monad.Reader?
>
> And do we have any artist
Try
test' = square . (4 :: a -> (Integer,a))
Otherwise, how is the compiler to know that you want 4 to be of that
type?
S
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Greg
| Buchholz
| Sent: 26 October 2006 18:46
| To: haskell-cafe@haskell.org
|
John,
My question is, how do I preserve the ordering of entities in my
list and still be able to assign the proper order values to each
entity? Is there an efficient way to do this? How else might I
improve my orderByPriority algorithm.
Straightforwardly, you could do it like this:
i
On 01/11/06, Andrew Pimlott <[EMAIL PROTECTED]> wrote:
I present here a gentle introduction to monsters.
Absolutely brilliant. This certainly made me laugh! Perhaps a
light-hearted candidate for the Monad.Reader?
And do we have any artistic Haskellers out there? Could we get
drawings of these
Hello Andrew,
Wednesday, November 1, 2006, 8:14:23 AM, you wrote:
> produced few results. Inspired by Felleisen, and in the spirit of
> Halloween, I offer a new alternative: Meet "monsters", your
> computational companions in the land of lazy functional programming.
> All monsters are capable
Hi,I have a list of entities. Each entity has a priority field and an order field. The priority field contain the input values to my algorithm, the order fields contain the output value of my algorithm. My algorithm needs to assign 1 to the order field of the entity with the lowest priority valu
Greg Buchholz has posed an interesting problem of writing a
typechecker. Given untyped terms of the form
> data Expr = ELit Int
> | EInc Expr
> | EIsZ Expr
we are to compute typed terms:
> data Term a where
> Lit :: Int -> Term Int
> Inc :: Term In
45 matches
Mail list logo