Can someone post some simple examples of using the Data.Graph library?
So I can define a simple graph
let g = buildG (1,2) [(1,2), (2,1)]
but how do i label my edges and nodes? i want to be able to name my
nodes, and add weights to the edges and be able to update those
weights as well.
Thanks,
On Thu, May 15, 2008 at 8:45 PM, Andrew Coppin
<[EMAIL PROTECTED]> wrote:
> Yitzchak Gale wrote:
>>
>>
>> And of course, you wouldn't want that:
>>
>> f xs = xs : map expensiveCalculation xs
>>
>> Please don't fuse those two loops into one.
>>
>
> ...doesn't type check. Did you mean (++)?
Hmm? Wh
On 16 May 2008, at 01:13, Jonathan Cast wrote:
On 15 May 2008, at 4:29 AM, Conor McBride wrote:
Replying slap-foreheadedly to own post...
On 15 May 2008, at 11:56, Conor McBride wrote:
Folks
I'm also wondering whether it makes sense to have a
"bottomless Top" type, with constructor _ and
On Thu, May 15, 2008 at 6:23 PM, Duncan Coutts <[EMAIL PROTECTED]>
wrote:
>
> On Thu, 2008-05-15 at 13:40 -0400, Olivier Boudry wrote:
> As an example let me show you as an example how we use it in Cabal:
>
>
Hi Duncan,
I tried to place a "length text `seq`" before the mapM_ writeExport to force
On 15 May 2008, at 4:29 AM, Conor McBride wrote:
Replying slap-foreheadedly to own post...
On 15 May 2008, at 11:56, Conor McBride wrote:
Folks
I'm also wondering whether it makes sense to have a
"bottomless Top" type, with constructor _ and lazy pattern _
(with (undefined :: Top) equal to _
On 15 May 2008, at 8:33 pm, Yitzchak Gale wrote:
The point is that it is always best to keep language syntax
as simple as possible, for many reasons. In the case of Unicode,
that means staying as close as possible to the spirit of Unicode and
minimizing our own ad hoc rules.
In particular, Unic
On Thu, 2008-05-15 at 13:40 -0400, Olivier Boudry wrote:
> Hi all,
>
> It's the first time I use the runInteractiveCommand and I was probably
> bitten by laziness.
Yes. I think Philip diagnosed the problem correctly.
As an example let me show you as an example how we use it in Cabal:
rawSystem
On Wed, 2008-05-14 at 21:49 +0100, Andrew Coppin wrote:
> At this point, my best guess is that the unofficial Gtk2hs binary is
> broken somehow. [Although I don't recall hearing anybody yelling about
> it...] Maybe tomorrow I'll try again on my other box that has an older
> GHC on it and see h
On Thu, 2008-05-15 at 01:01 +0400, Bulat Ziganshin wrote:
> Hello Andrew,
>
> Thursday, May 15, 2008, 12:49:32 AM, you wrote:
>
> > touch. Now, let's see what this IDE actually looks li-- oh you have GOT
> > to be KIDDING me! It can't find the right GTK DLL?!?
>
> gtk2hs includes *developer* gt
Mattias Bengtsson wrote:
A good read.
With Don, it usually is. ;-)
Side point: Is the name "go" part of the idiom you mentioned? I
sometimes use the same practise but usually just calls the worker the
same as the real function with an added prime (').
I usually use "work". Same differ
moonlite:
> On Thu, 2008-05-15 at 11:31 -0700, Don Stewart wrote:
> > I've written an extended post on how to understand and reliably optimise
> > code like this, looking at it all the way down to the assembly.
> >
> > The result are some simple rules to follow for generated code as good
> > as gc
Yitzchak Gale wrote:
And of course, you wouldn't want that:
f xs = xs : map expensiveCalculation xs
Please don't fuse those two loops into one.
...doesn't type check. Did you mean (++)?
In the case of "mean", the outer function in question
is /, and that is a good candidate for fusion
On Thu, May 15, 2008 at 2:31 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
> I've written an extended post on how to understand and reliably optimise
> code like this, looking at it all the way down to the assembly.
>
That is a _fabulous_ article. I'm looking forward to the HOF installment.
--
Darri
Don Stewart <[EMAIL PROTECTED]> wrote:
> http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast
>
Can you put this on the wiki, with the title "An example of how
Haskell executes programs", right next to the "Haskell for C
programmers" tutorial? It's really helpful for people who are more or
l
> Side point: Is the name "go" part of the idiom you mentioned? I
> sometimes use the same practise but usually just calls the worker the
> same as the real function with an added prime (').
I like to use "go" or the name of the function with _ prepended. For
threading state type things outside o
Hi Philip,
I just asked a question to the list about using runInteractiveCommand. You
may find the code useful but will need to either remove the forkIO
instruction or synchronize the two threads using a MVar to avoid the
concurrency problem I had.
You'll find the thread here:
http://www.has
Hello,
> I would like to be able to run a shell command like curl and process the
> output in my Haskell program, but I couldn't find anything helpful about
it.
>
Try looking in System.Process. runInteractiveProcess should work for you.
-Jeff
---
This e-mail may contain confidential and/o
Hello Olivier,
Thursday, May 15, 2008, 11:06:19 PM, you wrote:
> As I could not find a function to wait on a ThreadId I used a MVar to
> synchronize both threads.
> Is this normal or have I missed the `waitOnThreadId` function?
yes, it's common idiom
--
Best regards,
Bulat
Hi,
I would like to be able to run a shell command like curl and process the
output in my Haskell program, but I couldn't find anything helpful about it.
Something like
main = do
args <- getArgs
inp <- exec "curl" args
putStrLn (processInput inp)
would be very helpful
On Thu, May 15, 2008 at 2:42 PM, Ronald Guida <[EMAIL PROTECTED]> wrote:
> It looks like a simple race condition to me. You are using
> "waitForProcess pid" to wait for runInteractiveCommand to finish, but
> you don't seem to have anything that waits for createDefFile to
> finish.
>
Thanks Ronal
On Thu, 2008-05-15 at 11:31 -0700, Don Stewart wrote:
> I've written an extended post on how to understand and reliably optimise
> code like this, looking at it all the way down to the assembly.
>
> The result are some simple rules to follow for generated code as good
> as gcc -O2.
>
> Enjoy,
>
On Thu, May 15, 2008 at 11:42 AM, Ronald Guida <[EMAIL PROTECTED]> wrote:
> It looks like a simple race condition to me. You are using
> "waitForProcess pid" to wait for runInteractiveCommand to finish, but
> you don't seem to have anything that waits for createDefFile to
> finish.
>
Whoops, sorry
It looks like a simple race condition to me. You are using
"waitForProcess pid" to wait for runInteractiveCommand to finish, but
you don't seem to have anything that waits for createDefFile to
finish.
> main :: IO ()
> main = do
> (file:_) <- getArgs
> (_, out, _, pid) <- runInteractiveComman
> I offer up the following example:
>
> mean xs = sum xs / length xs
>
> Now try, say, "mean [1.. 1e9]", and watch GHC eat several GB of RAM. (!!)
>
> If we now rearrange this to
>
> mean = (\(s,n) -> s / n) . foldr (\x (s,n) -> let s' = s+x; n' = n+1
> in s' `seq` n' `seq` (s', n')) (0,0)
2008/5/15 Olivier Boudry <[EMAIL PROTECTED]>:
> Hi all,
>
> It's the first time I use the runInteractiveCommand and I was probably
> bitten by laziness.
>
> When I run the following program and send its output to a file using '>'
> redirection I get the full output of the called process. But if I r
Hi all,
It's the first time I use the runInteractiveCommand and I was probably
bitten by laziness.
When I run the following program and send its output to a file using '>'
redirection I get the full output of the called process. But if I run it in
the console I get only half of the output. As con
"Claus Reinke" <[EMAIL PROTECTED]> wrote:
> then again, Jane Austen was happy enough writing about her
> characters not being "one and twenty", so perhaps that is just a
> lost art?-)
>
I'm quite content as long as I'm not "four twenty nineteen".
--
(c) this sig last receiving data processing
> As to your assertion of discrimination against Greek: my point was that
> mathematical notation *already* discriminates against speakers of Greek by
> appropriating their alphabet for its own purposes, so if you want to enable
> a mathematical-notation language mode it's already difficult to sup
Thanks a lot for your comprehensive response, Claus!
Per your suggestion, I started a GHC wiki page at http://
hackage.haskell.org/trac/ghc/wiki/GhcApiStatus.
I added your comments and I will continue to add more things as I
find them.
I am closely following the Yi project and I am aware t
Hi all,
I found a solution to my linking problem, but it's a bit scary and I'm
wondering if there is a simpler way to do this:
The solution comes from the following article:
http://www.emmestech.com/moron_guides/moron1.html
To get ghc to link my dll properly I had to do the following:
1. Cr
2008/5/15 Yitzchak Gale <[EMAIL PROTECTED]>:
> So I think the best and simplest idea is to make
> the letter lambda a keyword. True, you need a space after it
> then. You already need spaces between the variables after the
> lambda, so anyway you might say that would be more consistent.
You could
On Wed, May 14, 2008 at 1:38 AM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrote:
> Graham Fawcett wrote:
>>
>> Yes, but that's still a 'quick' short-circuiting. In your example, if
>> 'n' is Nothing, then the 'f >>= g >>= h' thunks will not be forced
>> (thanks to lazy evaluation), regardless of asso
Bulat Ziganshin wrote:
Hello Richard,
Yes it was just a plausible guess, but not contradicted by the experts.
And that was using the Windows version of GHC so other versions may
have better optimisation. I don't know how to check, maybe the experts
can illuminate the subject?
note that my let
On 2008 May 15, at 4:33, Yitzchak Gale wrote:
Brandon S. Allbery KF8NH wrote:
Come to think of it, if you're after math notation, enough Greek
letters are used as symbols that it might be necessary to just
exclude them from use as letters.
Yitz Gale wrote:
While I have not yet noticed anyone
On 2008 May 15, at 3:25, Achim Schneider wrote:
"Yitzchak Gale" <[EMAIL PROTECTED]> wrote:
Brandon S. Allbery KF8NH wrote:
Come to think of it, if you're after math notation, enough Greek
letters are used as symbols that it might be necessary to just
exclude them from use as letters.
While
On 2008 May 15, at 3:03, Yitzchak Gale wrote:
Brandon S. Allbery KF8NH wrote:
Adjacent different scripts in general is probably a reasonable token
discriminator. A "token" combining LTR and RTL, for example, is just
confusing.
So you would like to ban identifiers that contain both
letters a
Replying slap-foreheadedly to own post...
On 15 May 2008, at 11:56, Conor McBride wrote:
Folks
I'm also wondering whether it makes sense to have a
"bottomless Top" type, with constructor _ and lazy pattern _
(with (undefined :: Top) equal to _). Then the constant-time
shape operator makes the
Folks
[statutory warning: functors, terminal objects, unsafeCoerce]
I had a peculiar notion this morning to wonder whether I could
get away with
shape :: Functor f => f a -> f ()
shape fa = unsafeCoerce fa
Sure enough, ghci gives me
*Top> shape "moo"
[(),(),()]
*Top> shape [undefined]
[**
Don Stewart wrote:
> You'd want a general fusion framework for this...
> Stream fusion... at least does this for zips...
> but for an arbitrary 'f' instead of zip,
> seems harder.
And of course, you wouldn't want that:
f xs = xs : map expensiveCalculation xs
Please don't fuse those two loops int
2008/5/15, Claus Reinke <[EMAIL PROTECTED]>:
> - is it possible to use standalone deriving to get a generic
> programming framework over the ASTs without blowing
> up GHC's code for its own use (deriving Data, etc.)?
Speaking of generics, I'm working on deriving Data.Traversable for
GHC's abst
> My own priority is to have the compilation phases exposed. One (selfish)
> reason for this is that it will force a number of refactorings and cleanups
> inside GHC, that we've had on the radar for some time. As soon as there's a
> wiki page up I can start downloading some of the contents of my
Brandon S. Allbery KF8NH wrote:
>>> Come to think of it, if you're after math notation, enough Greek
>>> letters are used as symbols that it might be necessary to just
>>> exclude them from use as letters.
Yitz Gale wrote:
>> While I have not yet noticed anyone from Greece on this list,
>> I don't
Claus, thanks for taking the time to articulate all this, speaking as the
mentor for the project this material is invaluable. I'd particularly like
to see a wiki page collecting issues, plans and priorities too.
My own priority is to have the compilation phases exposed. One (selfish)
reason
"Yitzchak Gale" <[EMAIL PROTECTED]> wrote:
> Brandon S. Allbery KF8NH wrote:
> > Come to think of it, if you're after math notation, enough Greek
> > letters are used as symbols that it might be necessary to just
> > exclude them from use as letters.
>
> While I have not yet noticed anyone from G
Brandon S. Allbery KF8NH wrote:
> Come to think of it, if you're after math notation, enough Greek letters are
> used as symbols that it might be necessary to just exclude them from use as
> letters.
While I have not yet noticed anyone from Greece on this list,
I don't think it would be appropriat
Brandon S. Allbery KF8NH wrote:
> Adjacent different scripts in general is probably a reasonable token
> discriminator. A "token" combining LTR and RTL, for example, is just
> confusing.
So you would like to ban identifiers that contain both
letters and digits for those who happen to speak langua
46 matches
Mail list logo