Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-25 Thread John Goerzen
Hi Joey, Apologies for such a late reply. I don't know if others have replied on -cafe; it has become too high-volume for me to follow of late. There are several options. MissingH is one. I have accepted patches there for a long time. Another is that now that Hackage/Cabal foster easy

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-25 Thread John Meacham
That is one of the wonderful things about haskell, most languages have a negative correlation between codesize and productivity, however with haskell there is a strong positive correlation. You can re-use so much that as your code base grows it becomes easier to add new features rather than

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-24 Thread David Fox
On Mon, Jan 23, 2012 at 1:01 PM, Joey Hess j...@kitenet.net wrote:   Other stuff:   separate :: (a - Bool) - [a] - ([a], [a]) Is this partition from Data.List? No; it's like break but does not include the separating character in the snd list. I like let (hd, _ : tl) = break prd lst

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-24 Thread David Fox
On Tue, Jan 24, 2012 at 1:00 PM, David Fox dds...@gmail.com wrote: On Mon, Jan 23, 2012 at 1:01 PM, Joey Hess j...@kitenet.net wrote:   Other stuff:   separate :: (a - Bool) - [a] - ([a], [a]) Is this partition from Data.List? No; it's like break but does not include the separating

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-24 Thread Chris Wong
I like  let (hd, _ : tl) = break prd lst in... Oh, wait.  That won't always work. :( second (drop 1) . break prd list? :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-23 Thread Jean-Marie Gaillourdet
Hi, On 21.01.2012, at 21:20, Joey Hess wrote: My problem now is that as I start new projects, I want to have my haskell utility functions available, and copying them around is not ideal. So, put them on hackage. But where, exactly? It already has several grab bag utility libraries. The only

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-23 Thread Joey Hess
David Fox wrote: I try to create a workflow for this sort of thing. I create a package with a name like set-extra, with one module Data.Set.Extra and an alternative Data.Set module that exports both the old Data.Set and the symbols in Data.Set.Extra. Then I email the maintainers of the

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-22 Thread David Fox
I try to create a workflow for this sort of thing. I create a package with a name like set-extra, with one module Data.Set.Extra and an alternative Data.Set module that exports both the old Data.Set and the symbols in Data.Set.Extra. Then I email the maintainers of the Containers package with a

[Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Joey Hess
I'm finding a rather unusual problem as I write haskell.. Unlike every other language I've used, large portions of my haskell code are turning out to be general-purpose, reusable code. Fully 20% of the haskell code I've written for git-annex is general purpose. Now, I came out of a decade of perl

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Mike Burns
On 2012-01-21 16.20.25 -0400, Joey Hess wrote: My problem now is that as I start new projects, I want to have my haskell utility functions available, and copying them around is not ideal. So, put them on hackage. But where, exactly? Instead of putting all of them in one package, how about you

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Tristan Ravitch
You might find many of these on hackage in various forms already.. it might be easier to just depend on some of those libraries. On Sat, Jan 21, 2012 at 04:20:25PM -0400, Joey Hess wrote: Some quite generic monadic control functions, few of them truely unique: whenM :: Monad m = m Bool -

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Simon Hengel
headMaybe :: [a] - Maybe a Is this the same as Data.Maybe.maybeToList? readMaybe :: Read a = String - Maybe a This has been added to base recently [1]. Cheers, Simon [1] https://github.com/ghc/packages-base/commit/0e1a02b96cfd03b8488e3ff4ce232466d6d5ca77

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Christoph Breitkopf
One thing I found useful when looking if a function already exists under a different name is to use Hayoo to search for the type, i.e.: http://holumbus.fh-wedel.de/hayoo/hayoo.html#0:(a%20-%3E%20Bool)%20-%3E%20%5Ba%5D%20-%3E%20(%5Ba%5D%2C%5Ba%5D) - Chris

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Thiago Negri
There is also Hoogle, pretty equivalent I guess. http://www.haskell.org/hoogle/ Thiago. 2012/1/21 Christoph Breitkopf chbreitk...@googlemail.com: One thing I found useful when looking if a function already exists under a different name is to use Hayoo to search for the type, i.e.:

Re: [Haskell-cafe] where to put general-purpose utility functions

2012-01-21 Thread Christoph Breitkopf
On Sat, Jan 21, 2012 at 11:08 PM, Christoph Breitkopf chbreitk...@googlemail.com wrote: One thing I found useful when looking if a function already exists under a different name is to use Hayoo to search for the type, i.e.: Uh - please ignore the bogus link - I had blindly assumed that it