Re: [Haskell-cafe] Tupling functions

2011-09-14 Thread Richard O'Keefe
On 14/09/2011, at 2:45 PM, Casey McCann wrote: > >class Tuple t where >type Arg t :: * >type Result t :: * >tuple :: t -> Arg t -> Result t > >instance (x1 ~ x2) => Tuple (x1 -> a, x2 -> b) where >type Arg (x1 -> a, x2 -> b) = x1 >type Result (x1

[Haskell-cafe] Haskell Weekly News: Issue 199

2011-09-14 Thread Daniel Santa Cruz
Welcome to issue 199 of the HWN, a newsletter covering developments in the Haskell community. This release covers the week of September 4 to 10, 2011. Announcements Johannes Waldmann open the invitation to the 6th Haskell in Leipzig workshop, on October 7, 2011. It "will present an

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread wren ng thornton
On 9/13/11 11:03 PM, Kazu Yamamoto (山本和彦) wrote: Hello Cafe, I would like to have an efficient implementation of the chop function. As you guess, the chop function drops spaces in the tail of a list. chop " foo bar baz " ->" foo bar baz" A naive implementation is as follows:

[Haskell-cafe] cabal-install to produce a dependency tree

2011-09-14 Thread Ozgur Akgun
Dear Cafe, What would be the easiest way of generating the following output, given a package name optionally with additional constraints? $- foo "X > 3" "X > 3" depends on A-2.2, B-1.0, C-1.2 A-2.2 depends on D-1.2.3 ... I assume cabal-install internally does this anyway while creating the insta

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Donn Cave
Quoth Ivan Lazar Miljenovic , > Why the extra case for go? The otherwise guard can be part of the > second case... I noticed that myself, so I thought "let's see if it's just a matter of style that comes out the same after compilation ..." ... and after a few minutes fooling around with that, I

[Haskell-cafe] Turn GC off

2011-09-14 Thread Andreas Voellmy
Hi everyone, Is there a way to completely turn garbage collection off in the Haskell runtime system? I'm aware of the -A runtime option, but I'd like to completely turn it off, if possible. I'm OK with running the program until it runs out of memory, and I'm willing to recompile GHC if needed. Re

Re: [Haskell-cafe] Undefined symbol error coming from shared, dynamic library.

2011-09-14 Thread Sergiy Nazarenko
Hi, Captain ! I got haskell shared libraries with following cabal command: cabal install --global --reinstall --disable-library-profiling --enable-shared --ghc-option=-dynamic mtl and so on. It allowed me to get haskell libraries and I could compile my own shared libraries. And ldd helps me to k

Re: [Haskell-cafe] Undefined symbol error coming from shared, dynamic library.

2011-09-14 Thread Captain Freako
Hi Sergiy, *>I thought having static library to solve my problem. And I'm looking for how to build static library, but no luck. * I was also, originally trying to build a shared *static* library. (I wanted to distribute a plug-in, which could be used by people knowing nothing about Haskell working

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Ivan Lazar Miljenovic
On 15 September 2011 01:24, Sean Leather wrote: > On Wed, Sep 14, 2011 at 05:03, Kazu Yamamoto wrote: >> >> I would like to have an efficient implementation of the chop function. > > [...] > >> >> Are there any more efficient implementations of chop? Any suggestions? > >   chop xs = go xs id "" >

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Sean Leather
On Wed, Sep 14, 2011 at 05:03, Kazu Yamamoto wrote: > I would like to have an efficient implementation of the chop function. > [...] > Are there any more efficient implementations of chop? Any suggestions? > chop xs = go xs id "" where go "" _ = id go (c:cs)

Re: [Haskell-cafe] Tupling functions

2011-09-14 Thread Casey McCann
On Wed, Sep 14, 2011 at 9:32 AM, Victor Nazarov wrote: > I've just tried another approach (code below). And GHC even inferred > type for tupleF. But I think GHC inferred the wrong type and I can't > formulate the right one, it seems to require infinite number of > constraints. With GHC inferred ty

[Haskell-cafe] Final CFP: PEPM12 - Workshop on Partial Evaluation and Program Manipulation

2011-09-14 Thread oleg
Final Call For Papers Paper submission deadline: Mon, October 10, 2011, 23:59, GMT ACM SIGPLAN 2012 Workshop on Partial Evaluation and Program Manipulation January 23-24, 2012. Philadelphia, Pennsylvania, USA (co-located with POPL'12) http://www.program-transformation.org/PEPM12 The PEPM Sympos

Re: [Haskell-cafe] Tupling functions

2011-09-14 Thread Victor Nazarov
On Wed, Sep 14, 2011 at 6:45 AM, Casey McCann wrote: > On Tue, Sep 13, 2011 at 10:03 PM, Chris Smith wrote: >> Ah, okay... then sure, you can do this: >> >> class Tuple a b c | a b -> c where >>    tuple :: a -> b -> c >> >> instance Tuple (a -> b, a -> c) a (b,c) where >>    tuple (f,g) x = (f x

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Daniel Fischer
On Wednesday 14 September 2011, 09:17:16, Kazu Yamamoto wrote: > You can find the results of my friend: > > https://gist.github.com/1215660 > > Please ignore the Japanese text. Please read the code and the results. > I'm not sure why you had the different result. Input size. The lazy fol

Re: [Haskell-cafe] [Haskell] [ANNOUNCE] Haskdogs-0.1

2011-09-14 Thread Ivan Lazar Miljenovic
On 14 September 2011 19:18, Sergey Mironov wrote: > > Yes, I forgot to mention PATH. I expect somthing like > > export PATH="$HOME/.cabal/bin:$PATH" > > in .bash_profile or similar. > > Also, I probably should remove hasktags from the build-tools. Better > check it's presense in tuntime. You also

Re: [Haskell-cafe] [Haskell] [ANNOUNCE] Haskdogs-0.1

2011-09-14 Thread Sergey Mironov
2011/9/14 Ivan Lazar Miljenovic : > Re-cc'ing -cafe: > > On 14 September 2011 14:29, yi huang wrote: >> On Wed, Sep 14, 2011 at 11:32 AM, Ivan Lazar Miljenovic >> wrote: >>> >>> On 14 September 2011 13:27, yi huang wrote: >>> > On Wed, Sep 14, 2011 at 10:18 AM, Ivan Lazar Miljenovic >>> > wrote

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread 山本和彦
You can find the results of my friend: https://gist.github.com/1215660 Please ignore the Japanese text. Please read the code and the results. I'm not sure why you had the different result. --Kazu > This was exactly my first attempt on rewriting your foldr version. > > Unfortunately, it

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Roman Cheplyaka
* Kazu Yamamoto [2011-09-14 15:59:05+0900] > Hello, > > My friend reached the following version: > > chop :: String -> String > chop = foldr go [] > where > go x xs > | isSpace x && null xs = [] > | otherwise= x:xs > > This version is faster than the reverse versio

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread 山本和彦
Hello, My friend reached the following version: chop :: String -> String chop = foldr go [] where go x xs | isSpace x && null xs = [] | otherwise= x:xs This version is faster than the reverse version in most cases. The point is checking "isSpace" first and falling