Hello Nick,
Am 02.11.2006 um 20:51 schrieb Nicolas Frisby:
OI has been lingering in the back of my mind during my own
comonadic adventures.
Did you enjoy them?
One thing that's bothered me is the signature of comain.
comain :: OI () -> ()
If the OI comonad is to represent values "in t
mattcbro:
>
>
>
> Jason Dagit-2 wrote:
> >
> >
> >
> > Do any memory leaks show up if you compile with -caf-all when you profile?
> >
> > Jason
> > ___
> > Haskell-Cafe mailing list
> > Haskell-Cafe@haskell.org
> > http://www.haskell.org/mailman/li
Jason Dagit-2 wrote:
>
>
>
> Do any memory leaks show up if you compile with -caf-all when you profile?
>
> Jason
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
It doesn't
On 11/2/06, SevenThunders <[EMAIL PROTECTED]> wrote:
SevenThunders wrote:
>
> All my code is compiled using the -prof -auto
> flag and then run using +RTS -hc -RTS. The resulting plots do not show
> a linear increase in heap usage, although the Windows XP operating
> system does report such
SevenThunders wrote:
>
> All my code is compiled using the -prof -auto
> flag and then run using +RTS -hc -RTS. The resulting plots do not show
> a linear increase in heap usage, although the Windows XP operating
> system does report such an increase.
>
>
This is either a bug in GHC or
On 02/11/2006, at 9:56 PM, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Bernie Pope <[EMAIL PROTECTED]>:
This is a weird example of a pattern binding, and it is surprising
(to me) that the syntax is valid.
Maybe. But you wouldn't balk at this:
numzeroes xs = sum [ 1 | 0 <- xs ]
...e
On 11/2/06, Maurício <[EMAIL PROTECTED]> wrote:
Hi,
Is there a function to get that? I'm using
\x -> x - fromIntegral(floor x)
since I was not able to find something better, but I guess I have missed
something in the standard library since there are functions with similar
funcionality.
Hi,
Is there a function to get that? I'm using
\x -> x - fromIntegral(floor x)
since I was not able to find something better, but I guess I have missed
something in the standard library since there are functions with similar
funcionality.
Thanks,
Maurício
__
On Thu, 02 Nov 2006 12:20:55 -0800, you wrote:
>It seems you only need a table of counts of the number of times
>the string has occurred previously, which you can have available
>on the first pass.
>
>e.g,
>import Data.List
>import Data.Map as Map
>mark strings = snd $ mapAccumL
>(\counts str ->
>
Steve Schafer wrote:
I have a list of text strings:
["Alice", "Bob", "Cindy", "Bob", "Bob", "Dave", "Cindy"]
As you can see, some of the strings occur only once; others appear two
or more times.
I would like to end up with a new list, according to the following
rules:
1) If a string occurs o
I have a rather complex Haskell program that performs an engineering
simulation using a lot of large complex valued
matrices. The imperative components of the simulation are written in C
and interfaced into Haskell which handles
the higher level logic. This has served me fairly well, and I've b
OI has been lingering in the back of my mind during my own comonadic adventures.
One thing that's bothered me is the signature of comain.
comain :: OI () -> ()
If the OI comonad is to represent values "in the context of the
RealWorld", and yet we can have multiple and differing copies of the
R
I have a list of text strings:
["Alice", "Bob", "Cindy", "Bob", "Bob", "Dave", "Cindy"]
As you can see, some of the strings occur only once; others appear two
or more times.
I would like to end up with a new list, according to the following
rules:
1) If a string occurs only once in the origina
On 11/2/06, Slavomir Kaslev <[EMAIL PROTECTED]> wrote:
On 11/2/06, Sebastian Sylvan <[EMAIL PROTECTED]> wrote:
> On 11/2/06, Slavomir Kaslev <[EMAIL PROTECTED]> wrote:
> > Little by little, I think I am getting closer.
> >
> > class Show a => Visible a where
> > toString :: a -> String
> >
Hi & no problems (I didn't tell it clearly right away),
I modified the code along the comments given by Lemmih and things
improved a lot. mod-operator can be removed by two loops as in C
version, which still further improved the speed. I tried this with
the old version and the speed-up was next
I just realized that I mixed up data bases and functional programming
and apologize for this. Of course, I meant "referential transparency"!
Sven Biedermann
Am 02.11.2006 um 16:43 schrieb Sven Biedermann:
Dear Haskellers,
The OI Comonad in Richard Kieburtz' paper does break referential
inte
On 11/2/06, Sebastian Sylvan <[EMAIL PROTECTED]> wrote:
On 11/2/06, Slavomir Kaslev <[EMAIL PROTECTED]> wrote:
> Little by little, I think I am getting closer.
>
> class Show a => Visible a where
> toString :: a -> String
> toString = show
> size :: a -> Int
> size = length . show
On 11/2/06, Spencer Janssen <[EMAIL PROTECTED]> wrote:
On Nov 2, 2006, at 8:48 AM, alaiyeshi wrote:
> Also, I guess my code still waste too much time "parsing" input (I
> compiled my code with -prof flag on)...
> Maybe ByteString may save me (or a smarter brain), What is your
> opinion about doin
Thank you so much!
I've met replicateM_ for the first time;-) This could be a "template" for doing
online-judge exercises I guess. And it's very useful for newbies like me.
Again many Thanks:-)___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
On Nov 2, 2006, at 8:48 AM, alaiyeshi wrote:
Also, I guess my code still waste too much time "parsing" input (I
compiled my code with -prof flag on)...
Maybe ByteString may save me (or a smarter brain), What is your
opinion about doing faster IO, would you please tell me?
ByteString will lik
Lemmih wrote:
Using 'seq' is generally a bad idea. It can worsen the performance if
not used carefully and GHCs strictness analyser is usually good
enough.
Is GHC.Conc.pseq any better? Usually the whole point of making things
more strict is to optimize performance for pieces you know will be
ev
On 11/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
G'day all.
Quoting Bernie Pope <[EMAIL PROTECTED]>:
> This is a weird example of a pattern binding, and it is surprising
> (to me) that the syntax is valid.
Maybe. But you wouldn't balk at this:
numzeroes xs = sum [ 1 | 0 <- xs ]
Dear Haskellers,
The OI Comonad in Richard Kieburtz' paper does break referential
integrity, but he worte, that the implementation is just something
"...to experiment with". In this papers he states, that a real
OI needs special properties. For instance enableOI needs "...to have the
effect of co
On 11/2/06, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:
Hello Slavomir,
Thursday, November 2, 2006, 4:42:21 PM, you wrote:
> instance Show a => Visible a where
> toString = show
> size = length . show
> instance Visible a => Visible [a] where
>toString = concat . map toString
>s
Thank you for replying.
Smart method! I've learned much;-) I'll have a try using UArray.
Also, I guess my code still waste too much time "parsing" input (I compiled my
code with -prof flag on)...
Maybe ByteString may save me (or a smarter brain), What is your opinion about
doing faster IO, wou
Little by little, I think I am getting closer.
class Show a => Visible a where
toString :: a -> String
toString = show
size :: a -> Int
size = length . show
Is just declaration, not definition. It doesn't define anything, even
though it has default implementations for toString and si
Hello Slavomir,
Thursday, November 2, 2006, 4:42:21 PM, you wrote:
> instance Show a => Visible a where
> toString = show
> size = length . show
> instance Visible a => Visible [a] where
>toString = concat . map toString
>size = foldl (+) 0 . map size
> Illegal instance dec
On 11/2/06, Sebastian Sylvan <[EMAIL PROTECTED]> wrote:
On 11/2/06, Slavomir Kaslev <[EMAIL PROTECTED]> wrote:
>
> Visible 'subclasses' Show. Doesn't this mean that Visible should be
> defined for all types with Show instances?
No, it just means that any type that you want to instantiate in
Vis
Am Donnerstag, 2. November 2006 10:57 schrieb Slavomir Kaslev:
> -- Forwarded message --
> From: Slavomir Kaslev <[EMAIL PROTECTED]>
> Date: Nov 2, 2006 10:47 AM
> Subject: Re: [Haskell-cafe] Class
> To: Daniel Fischer <[EMAIL PROTECTED]>
>
> On 11/2/06, Daniel Fischer <[EMAIL PROTE
Oh, sorry, I thought your version was a rewritten version of mine. :)
The names are so similar, after all.
On Nov 2, 2006, at 02:26 , isto wrote:
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
(believe
bulat.ziganshin:
> Hello isto,
>
> Thursday, November 2, 2006, 1:16:55 AM, you wrote:
>
> > I have tried to do different things but now I'm stuck. unsafeRead
> > and unsafeWrite improved a bit the lazy (STUArray-version) and
>
> why you think it's a lazy? :) ST monad is just the same as IO mon
G'day all.
Quoting Bernie Pope <[EMAIL PROTECTED]>:
> This is a weird example of a pattern binding, and it is surprising
> (to me) that the syntax is valid.
Maybe. But you wouldn't balk at this:
numzeroes xs = sum [ 1 | 0 <- xs ]
...even if you wouldn't naturally express it that way. Pat
Hello Lennart,
Thursday, November 2, 2006, 6:04:39 AM, you wrote:
> 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
Hello Lennart,
Thursday, November 2, 2006, 4:34:04 AM, you 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.
#ifdef __GLASGOW_HASKELL__
(I# a) <<# (I# b) = (I# (a `iShiftL#` b))
(I# a) >># (I# b) = (I# (a
Hello isto,
Thursday, November 2, 2006, 1:16:55 AM, you wrote:
> I have tried to do different things but now I'm stuck. unsafeRead
> and unsafeWrite improved a bit the lazy (STUArray-version) and
why you think it's a lazy? :) ST monad is just the same as IO monad
internally, only types are dif
Hello Jason,
Thursday, November 2, 2006, 8:45:14 AM, you wrote:
> let 0 = 1 in 0
> let { 1 + 1 = 3; 3 + 1 = 7 } in 1 + 1 + 1
> Where you get 7.
these sippets looks cool :) they may be placed in somewhat like
Haskell puzzles
--
Best regards,
Bulatmailto:[EMAIL PRO
Hello Slavomir,
Thursday, November 2, 2006, 2:06:05 AM, you wrote:
> Can someone please enlighten my (still) C++ thinking head?
you is not alone :))) look into
http://haskell.org/haskellwiki/OOP_vs_type_classes
--
Best regards,
Bulatmailto:[EMAIL PROTECTED]
-- Forwarded message --
From: Slavomir Kaslev <[EMAIL PROTECTED]>
Date: Nov 2, 2006 10:47 AM
Subject: Re: [Haskell-cafe] Class
To: Daniel Fischer <[EMAIL PROTECTED]>
On 11/2/06, Daniel Fischer <[EMAIL PROTECTED]> wrote:
Am Donnerstag, 2. November 2006 00:06 schrieb Slavomir Kasl
On Tue, Oct 31, 2006 I wrote:
Consider the following sequence of functions
that replace a single element in an n-dimensional
list:
replace0 :: a -> a -> a
replace1 :: Int -> a -> [a] -> [a]
replace2 :: Int -> Int -> a -> [[a]] -> [[a]]
Generalize this using type classes.
Thanks to everyone fo
39 matches
Mail list logo