Re: [Haskell-cafe] working with lists of couples

2006-11-18 Thread J. Garrett Morris
On 11/17/06, Henning Thielemann [EMAIL PROTECTED] wrote: On Fri, 17 Nov 2006, Clara Zamolo wrote: buildCouples = snd . foldl op (0,[]) where op (v,xs) x = (v+x,xs++[(x,v)]) You could make something like this that doesn't have quadratic-type appends by accumulating functions

Re: [Haskell-cafe] Wiki page for rewrite rules tips, types and tricks

2006-11-18 Thread Henk-Jan van Tuyl
Great page, I especially like the phrase: [...] changing a non-terminating program [...] into a much faster one [...] On Sat, 18 Nov 2006 06:27:34 +0100, Donald Bruce Stewart [EMAIL PROTECTED] wrote: After suggesting solutions based on rewrite rules to three different questions this week,

[Haskell-cafe] Re: Re: Debugging partial functions by the rules

2006-11-18 Thread Benjamin Franksen
Daniel, you wrote: I suspect I would be classified as a newbie relative to most posters on this list but here's my thoughts anyway... [...] One of my initial responses to haskell was disappointment upon seeing head, fromJust and the like. 'Those look nasty', I sez to meself. From day one

Re: [Haskell-cafe] Debugging partial functions by the rules

2006-11-18 Thread Donald Bruce Stewart
ndmitchell: Hi To see at a glance the various bug reports about fromJust you can search the bug database: http://bugs.darcs.net/[EMAIL PROTECTED]@sort=activity@group=priority@search_text=fromJust I count 7 bugs. I would be interested to see the results of static analysis tools

[Haskell-cafe] Type signatures in FFI exported functions

2006-11-18 Thread Alfonso Acosta
Hi, The FFI doesn't allow using type signatures in exported functions. Imagine this simplified example class Foo a where action1 :: a - IO() action2 :: a - IO() exportable :: Foo a = StablePtr a - IO() exportable ptr = do deref - deRefStablePtr ptr action1 deref

[Haskell-cafe] importing Distribution.Compat.FilePath fails

2006-11-18 Thread Magnus Therning
Putting import Distribution.Compat.FilePath in my source results in Could not find module `Distribution.Compat.FilePath': it is hidden (in package Cabal-1.1.6) I want to use 'joinFileName'. I found this thread from the cabal-devel list

Re: [Haskell-cafe] importing Distribution.Compat.FilePath fails

2006-11-18 Thread Lemmih
On 11/18/06, Magnus Therning [EMAIL PROTECTED] wrote: Putting import Distribution.Compat.FilePath in my source results in Could not find module `Distribution.Compat.FilePath': it is hidden (in package Cabal-1.1.6) I want to use 'joinFileName'. I found this thread from the

[Haskell-cafe] Cabal ^M bug

2006-11-18 Thread Vyacheslav Akhmechet
Cabal appears to have an end-of-line bug. If the .cabal file is created on Windows and the project is installed on a Unix system, the resulting executable ends up having ^M at the end because Cabal doesn't properly handle Windows line termination. If the .cabal file is converted to Unix style,

Re: [Haskell-cafe] importing Distribution.Compat.FilePath fails

2006-11-18 Thread Magnus Therning
On Sat, Nov 18, 2006 at 20:18:12 +0100, Lemmih wrote: On 11/18/06, Magnus Therning [EMAIL PROTECTED] wrote: Putting import Distribution.Compat.FilePath in my source results in Could not find module `Distribution.Compat.FilePath': it is hidden (in package Cabal-1.1.6) I want to use

Re: [Haskell-cafe] Wiki page for rewrite rules tips, types and tricks

2006-11-18 Thread Neil Mitchell
Hi Great page, I especially like the phrase: [...] changing a non-terminating program [...] into a much faster one [...] And one important point: In general its a bad idea for rules to change the semantics (meaning) of your code in such a way. Consider someone using reverse . reverse to

Re: [Haskell-cafe] importing Distribution.Compat.FilePath fails

2006-11-18 Thread Neil Mitchell
Hi How about using this instead: http://www-users.cs.york.ac.uk/~ndm/projects/libraries.php#filepath The only reason would be that it isn't in my GHC install by default (I'm on Debian Sid). However, I suppose I can look at this as an excellent first experiment with Cabal and packaging Haskell

[Haskell-cafe] Starting your own Haskell project: part 2

2006-11-18 Thread Donald Bruce Stewart
We've expanded the wiki page on 'How to write a Haskell project', to include a complete walkthrough creating: * Darcs * Cabal * QuickCheck infrastructure. http://haskell.org/haskellwiki/How_to_write_a_Haskell_program Feedback welcome! -- Don P.S. It might even be useful to