Re: [Haskell-cafe] arrows-.02 fails when rebuilding ghc 6.6.1

2007-08-26 Thread Ross Paterson
On Sun, Aug 26, 2007 at 11:16:17PM +0200, Luc TAESCH wrote: I try download and build 6.6.1 ( as ubntu has just 6.6 on package) and most went ok ( compiler and most libs) but arrows i tried and download arrow 0.2 from hackage but no more success You need to change the Extensions line in

[Haskell-cafe] Re: [Haskell] Functor ((,) a)

2007-09-19 Thread Ross Paterson
On Wed, Sep 19, 2007 at 10:24:50AM +0200, Janis Voigtlaender wrote: BTW, what would have been the easiest way for me to find this out on my own? Somehow, I would have hoped to be able to navigate to the appropriate point from the mentioned place in the online docs, where it is stated that

Re: [Haskell-cafe] Re: PROPOSAL: New efficient Unicode string library.

2007-09-27 Thread Ross Paterson
On Wed, Sep 26, 2007 at 11:25:30AM +0100, Tony Finch wrote: On Wed, 26 Sep 2007, Aaron Denney wrote: It's true that time-wise there are definite issues in finding character boundaries. UTF-16 has no advantage over UTF-8 in this respect, because of surrogate pairs and combining characters.

Re: [Haskell-cafe] Re: PROPOSAL: New efficient Unicode string library.

2007-09-27 Thread Ross Paterson
On Thu, Sep 27, 2007 at 07:26:07AM +, Aaron Denney wrote: On 2007-09-27, Ross Paterson [EMAIL PROTECTED] wrote: Combining characters are not an issue here, just the surrogate pairs, because we're discussing representations of sequences of Chars (Unicode code points). You'll never

Re: [Haskell-cafe] Re: PROPOSAL: New efficient Unicode string library.

2007-09-27 Thread Ross Paterson
On Thu, Sep 27, 2007 at 06:39:24AM +, Aaron Denney wrote: On 2007-09-27, Deborah Goldsmith [EMAIL PROTECTED] wrote: Well, not so much. As Duncan mentioned, it's a matter of what the most common case is. UTF-16 is effectively fixed-width for the majority of text in the majority of

Re: [Haskell-cafe] Dynamic choice of reverse implementation

2007-09-28 Thread Ross Paterson
On Fri, Sep 28, 2007 at 05:54:23PM +0100, Brian Hulley wrote: Yes this type should be fine. To implement reversor though you'd still need to first convert from the concrete list to whatever foldable you're using, before reversing the foldable, or implement something more general eg:

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-16 Thread Ross Paterson
On Tue, Oct 16, 2007 at 01:08:49PM +0100, Simon Marlow wrote: So rather than keep replying to individual points, I'd like to make some concrete proposals so we can make progress. 1. Document the version numbering policy. We should have done this earlier, but we didn't. The proposed policy,

[Haskell-cafe] Re: [Haskell] Re: Trying to install binary-0.4

2007-10-17 Thread Ross Paterson
On Wed, Oct 17, 2007 at 12:54:12PM +0100, Simon Marlow wrote: I've written down the proposed policy for versioning here: http://haskell.org/haskellwiki/Package_versioning_policy It turned out there was a previous page written by Bulat that contained essentially this policy, but it wasn't

Re: [Haskell-cafe] Re: Type-level arithmetic

2007-10-18 Thread Ross Paterson
On Tue, Oct 16, 2007 at 10:56:27AM +1000, Manuel M T Chakravarty wrote: Lennart Augustsson wrote, And Haskell embedded a logical programming language on accident. Well, we are just trying to fix that :) Since types are inferred using unification, and classes are still present, adding

Re: [Haskell-cafe] Why doesn't Hackage link to Haddock documentation anymore?

2007-10-19 Thread Ross Paterson
On Fri, Oct 19, 2007 at 11:31:06AM +0200, Johan Tibell wrote: Maybe I'm seeing things but from what I remember packages that used to have links to Haddock documentation in their exported modules list no longer has. It's a super useful feature! What happened to those packages? Documentation

Re: [Haskell-cafe] About Fibonacci again...

2007-11-07 Thread Ross Paterson
On Thu, Nov 08, 2007 at 12:56:46AM +0100, [EMAIL PROTECTED] wrote: This nasty acquaintance of mine asked the students to write down a simple procedure which generates the sequence after the infinite number of units of time. Of course, any finite prefix of it. rabbit = let rs = 0 : [x | r - rs,

Re: [Haskell-cafe] expanded standard lib

2007-11-21 Thread Ross Paterson
On Wed, Nov 21, 2007 at 08:14:09PM +, Magnus Therning wrote: Many other programming languages have packaging strategies that sound very similar. Several of them have managed to have a negative impact on platforms that already have good packaging technologies (i.e. almost every platform

Re: [Haskell-cafe] class default method proposal

2007-12-11 Thread Ross Paterson
On Tue, Dec 11, 2007 at 04:26:52PM +, Simon Marlow wrote: Duncan Coutts wrote: On Tue, 2007-12-11 at 07:07 -0800, Stefan O'Rear wrote: This is almost exactly the http://haskell.org/haskellwiki/Class_system_extension_proposal; that page has some discussion of implementation issues. Oh

Re: [Haskell-cafe] ANN / CFP - LLVM bindings for Haskell

2008-01-03 Thread Ross Paterson
On Thu, 03 Jan 2008 03:43:49 -0800, Bryan O'Sullivan wrote: (Hackage can't host code that uses GHC 6.8.2's language extension names yet.) It should be able to now. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] breadth first search one-liner?

2010-03-22 Thread Ross Paterson
On Mon, Mar 22, 2010 at 11:02:32AM +0100, Johannes Waldmann wrote: Dear all, there is this neat one-line BFS implementation bfs :: Eq a = ( a - [a] ) - a - [a] bfs next start = let xs = nub $ start : ( xs = next ) in xs but it has a problem: it only works for infinite

Re: [Haskell-cafe] Re: breadth first search one-liner?

2010-03-22 Thread Ross Paterson
On Mon, Mar 22, 2010 at 10:30:32AM +, Johannes Waldmann wrote: Nice! - Where's the 'nub'? A bit longer: bfs :: Eq a = (a - [a]) - a - [a] bfs f s = concat $ takeWhile (not . null) $ map snd $ iterate step ([], [s]) where step (seen, xs) = let seen' = xs++seen in (seen', nub $ [y | x - xs,

Re: [Haskell-cafe] Re: breadth first search one-liner?

2010-03-22 Thread Ross Paterson
A bit closer to the original: bfs :: Eq a = (a - [a]) - a - [a] bfs f s = concat $ takeWhile (not . null) levels where levels = foldr trim [] $ [s] : map (nub . (= f)) levels trim xs xss = xs : map (\\ xs) xss ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: ANN: data-category, restricted categories

2010-03-30 Thread Ross Paterson
On Tue, Mar 30, 2010 at 11:26:39PM +0100, Conor McBride wrote: Getting back to the question, whatever happened to empty case expressions? We should not need bottom to write total functions from empty types. Empty types? Toto, I've a feeling we're not in Haskell anymore.

Re: [Haskell-cafe] Hackage accounts and real names

2010-04-05 Thread Ross Paterson
On Sun, Apr 04, 2010 at 10:28:26PM +0100, David House wrote: An issue came up on #haskell recently with Hackage accounts requiring real names. The person in question (who didn't send this email as he's wishing to remain anonymous) applied for a Hackage account and was turned down, as he

Re: [Haskell-cafe] Re: Hackage accounts and real names

2010-04-06 Thread Ross Paterson
On Tue, Apr 06, 2010 at 10:10:09AM +0100, David House wrote: 3. Privacy issues. Some people simply cannot reveal their real names. I've already said I was prepared to make exceptions in such cases, but perhaps you missed that. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Why does Haskell not infer most general type?

2010-04-06 Thread Ross Paterson
On Tue, Apr 06, 2010 at 03:56:32PM -0400, Job Vranish wrote: f _ = undefined where _ = y :: Int - Int y x = undefined where _ = f x Because f and y are mutually recursive, their types are inferred together, so y gets the type Int - Int (as given), which forces f :: Int - a.

Re: [Haskell-cafe] Why does Haskell not infer most general type?

2010-04-06 Thread Ross Paterson
On Tue, Apr 06, 2010 at 05:18:34PM -0400, Job Vranish wrote: So in Haskell 98, would the added constraints result in a type error? Yes, because the types of the mutually recursive identifiers would be inferred together without using the type signatures, and then would fail to match the declared

Re: [Haskell-cafe] Re: GSoC: Hackage 2.0

2010-04-13 Thread Ross Paterson
On Fri, Apr 09, 2010 at 09:23:51PM -0400, Matthew Gruen wrote: The proposal as I submitted it is here: http://docs.google.com/View?docid=0Afa5MxwyB_zYZGhjanNrdjNfMjkzZjloOWNienYpageview=1hgd=1hl=en [...] The work on bringing hackage-server up to feature parity is primary. Absolutely. I

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Ross Paterson
On Thu, Apr 15, 2010 at 10:52:51AM +0200, Sean Leather wrote: Any idea why the Haddock docs have not been generated for this version? There's also no built on available. Is it an issue with the server? A glitch when I was switching the builds to use cabal install --dry-run.

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-24 Thread Ross Paterson
On Sat, Apr 24, 2010 at 08:21:04PM +1000, Ivan Lazar Miljenovic wrote: Mads Lindstrøm mads.lindstr...@gmail.com writes: But that would be an API change. It is of cause a question of how strict we want to be. I have seen several times that commercial software developers denies changes bugs,

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-24 Thread Ross Paterson
On Sat, Apr 24, 2010 at 08:48:07PM +1000, Ivan Lazar Miljenovic wrote: Ross Paterson r...@soi.city.ac.uk writes: Same major version: any code using fully explicit imports that worked with the old version will work with the new version, in the same way. By this you mean that additions have

Re: [Haskell-cafe] The instability of Haskell libraries

2010-04-25 Thread Ross Paterson
On Mon, Apr 26, 2010 at 06:47:27AM +1000, Ivan Lazar Miljenovic wrote: My main problem with this is if you want a custom variant of that instance. Let's take FGL graphs for example with instances for QuickCheck's Arbitrary class. Maybe you want arbitrary graphs that are simple, or maybe

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ross Paterson
On Sat, May 08, 2010 at 07:49:57AM +1000, Ivan Lazar Miljenovic wrote: Limestraël limestr...@gmail.com writes: 2010/5/1 John Millikin jmilli...@gmail.com You might want to make a local version of ErrorT in your library, to avoid the silly 'Error' class restriction. This is pretty easy;

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ross Paterson
On Sat, May 08, 2010 at 01:54:21AM +0200, Limestraël wrote: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. It was introduced to implement pattern match failure in

Re: [Haskell-cafe] Call for comments: neither package

2010-06-29 Thread Ross Paterson
On Tue, Jun 29, 2010 at 02:56:18PM -0500, Jeremy Shaw wrote: On Jun 29, 2010, at 6:02 AM, Stephen Tetley wrote: The Applicative Programming with Effects Paper has the monodial accumulating applicative instance on a sum type Conor McBride and Ross Paterson call Except: data Except err a = OK

Re: [Haskell-cafe] Type classes

2010-07-04 Thread Ross Paterson
On Sun, Jul 04, 2010 at 09:55:53PM +1000, Ivan Lazar Miljenovic wrote: Andrew Coppin andrewcop...@btinternet.com writes: In summary, I think we need to devise a way of better-documenting class instances. Haddock 2.7 supports documenting instance implementations; I don't know how this

Re: [Haskell-cafe] Type classes

2010-07-04 Thread Ross Paterson
On Sun, Jul 04, 2010 at 02:32:35PM +0200, Daniel Fischer wrote: On Sunday 04 July 2010 14:07:03, Ivan Lazar Miljenovic wrote: Ross Paterson r...@soi.city.ac.uk writes: Hmm, it seems only partial: documentation attached to an instance is shown in the list of instances under a type

Re: [Haskell-cafe] Build problems on Hackage server

2010-07-08 Thread Ross Paterson
On Wed, Jul 07, 2010 at 10:22:25AM +0200, Emil Axelsson wrote: Last week I uploaded new versions of feldspar-language and feldspar-compiler. Both packages build just fine on our local machines with GHC 6.10 and 6.12. But Hackage reports the following build failure: cabal: dependencies

Re: [Haskell-cafe] Re: Transformers versus monadLib versus...

2010-07-09 Thread Ross Paterson
On Fri, Jul 09, 2010 at 03:13:19PM -0400, Edward Kmett wrote: On Thu, Jul 8, 2010 at 12:37 PM, Yitzchak Gale g...@sefer.org wrote: btw, does this overhaul include adding Applicative instances, perchance? They are already part of monads-fd and would, I presume, come along for the

Re: [Haskell-cafe] cabal, Setup.lhs example

2010-07-22 Thread Ross Paterson
On Wed, Jul 21, 2010 at 09:43:16AM -0700, Rogan Creswick wrote: On Wed, Jul 21, 2010 at 3:00 AM, Magnus Therning mag...@therning.org wrote: I am successfully using hooks with the following in my .cabal file:    Build-Type    : Simple I've been unable to reproduce this -- flipping the

Re: [Haskell-cafe] cabal, Setup.lhs example

2010-07-22 Thread Ross Paterson
On Thu, Jul 22, 2010 at 11:31:21AM +0100, Magnus Therning wrote: On Thu, Jul 22, 2010 at 10:59, Ross Paterson r...@soi.city.ac.uk wrote: Magnus is building by directly running the Setup.hs himself, which ignores the Build-Type.  To get cabal-install to use his Setup.hs, the Build-Type must

Re: [Haskell-cafe] Weird behavior with arrow commands

2010-07-24 Thread Ross Paterson
On Sat, Jul 24, 2010 at 01:10:56PM +0200, Jürgen Doser wrote: This seems to be a bug in ghc. First, let's fix bar to give the full three arguments (Int, Float, Double) to g: bar f g = proc x - do (f - x) `foo` (\n m k - g - (n,m,k)) ghc infers the type: bar :: (t - String) -

Re: [Haskell-cafe] dear traversable

2010-07-31 Thread Ross Paterson
On Fri, Jul 30, 2010 at 08:13:43PM -0700, Ben wrote: dear traversable geniuses -- i am looking for better implementations of unzipMap :: M.Map a (b, c) - (M.Map a b, M.Map a c) unzipMap m = (M.map fst m, M.map snd m) unliftMap :: (Ord a) = M.Map a (b - c) - M.Map a b - M.Map a c

Re: [Haskell-cafe] Monad transformers, design

2010-07-31 Thread Ross Paterson
On Sat, Jul 31, 2010 at 10:56:31PM +1000, Tony Morris wrote: -- Suppose some data type newtype Inter a = Inter (Int - a) -- and a monad transformer for that data type. newtype InterT m a = InterT (m (Inter a)) The monad transformer should be Inter (m a).

Re: [Haskell-cafe] Simple matrix

2006-06-22 Thread Ross Paterson
On Thu, Jun 22, 2006 at 11:57:37AM +0200, Udo Stenzel wrote: instance Num a = Num [[a]] where (+) = zipWith (zipWith (+)) (-) = zipWith (zipWith (-)) negate = map (map negate) fromInteger x = fix (((x : repeat 0) :) . map (0:)) m * n = [ [ sum $ zipWith (*) v w

Re: [Haskell-cafe] Functional progr., images, laziness and all the rest

2006-06-22 Thread Ross Paterson
On Thu, Jun 22, 2006 at 01:24:32PM +0200, Jerzy Karczmarczuk wrote: I believe that ways of producing intricate streams by such languages or Lustre are somehow based on continuation mechanisms. The paper on Esterel, etc. : ftp://ftp-sop.inria.fr/esterel/pub/papers/foundations.pdf gives you

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Ross Paterson
On Thu, Jun 22, 2006 at 11:06:38AM -0400, Robert Dockins wrote: aside Every few months a discussion arises about induction and Haskell datatypes, and I feel compelled to trot out this oft-misunderstood fact about Haskell: 'data' declarations in Haskell introduce co- inductive

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-23 Thread Ross Paterson
On Thu, Jun 22, 2006 at 05:44:58PM +0100, I wrote: It works because Haskell 'data' definitions yield both an initial fixed point (with respect to strict functions) and a terminal fixed point (with respect to arbitrary functions), and moreover these are usually the same. The former is

Re: [Haskell-cafe] Cabal question, adding data files

2006-08-23 Thread Ross Paterson
On Wed, Aug 23, 2006 at 10:42:54PM +0100, Neil Mitchell wrote: I have a cabal executable, which requires additional data files. How do I do this in Cabal? I have seen extra-source-files, but they are not added at install time to the destination directory, which doesn't help me. The field you

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Ross Paterson
On Tue, Sep 05, 2006 at 12:55:48PM +0200, Udo Stenzel wrote: IMHO all accumulating functions, especially foldl, State.update, Map.insertWith, accumArray, absolutely need a strict version, because the strictness cannot be recovered by the library's user. We already have foldl'. Here's a strict

Re: [Haskell-cafe] Re: map (-2) [1..5]

2006-09-09 Thread Ross Paterson
On Sat, Sep 09, 2006 at 12:57:56AM -0400, Cale Gibbard wrote: Num itself needs to be split, but we can't do it sanely without something like class aliases. I think that a finer grain numeric hierarchy, while retaining Num, etc, is feasible without changing the language: unlike the case of

[Haskell-cafe] Re: Numeric type classes (Was: map (-2) [1..5])

2006-09-11 Thread Ross Paterson
On Mon, Sep 11, 2006 at 04:26:30PM +0200, Henning Thielemann wrote: On Sat, 9 Sep 2006, Ross Paterson wrote: I think that a finer grain numeric hierarchy, while retaining Num, etc, is feasible without changing the language: unlike the case of monads, the people who will be defining

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-13 Thread Ross Paterson
On Tue, Sep 12, 2006 at 08:59:30PM -0400, [EMAIL PROTECTED] wrote: One of the proposals that comes up every so often is to allow the declaration of a typeclass instance to automatically declare instances for all superclasses. So, for example: class (Functor m) = Monad m where

Re: [Haskell-cafe] Re: Numeric type classes

2006-09-14 Thread Ross Paterson
On Thu, Sep 14, 2006 at 01:11:56AM -0400, David Menendez wrote: Ross Paterson writes: I've collected some notes on these issues at http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/StandardClasses Coincidentally, I spent some time last week thinking about a replacement

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Ross Paterson
Here's my attempt, also using the quicksort idea, but using two passes instead of tying the knot: import Data.Set hiding (map) First a binary search tree, with a lookup function: data Tree k v = Node (Tree k v) k v (Tree k v) get :: Ord a = a - Tree a b - b get a (Node l k v r) = case

Re: [Haskell-cafe] Optimization problem

2006-09-14 Thread Ross Paterson
On Thu, Sep 14, 2006 at 05:22:05PM +0200, Bertram Felgenhauer wrote: [much subtle code] We can now build the splitStream function, using the following helper function: splitSeq' :: Ord a = Map a () - [(a,b)] - ([(a,[b])], Map a [b]) This works for infinite lists if there is no balancing,

Re: [Haskell-cafe] Optimization problem

2006-09-15 Thread Ross Paterson
On Fri, Sep 15, 2006 at 05:13:29AM +0200, Bertram Felgenhauer wrote: Just to prove the point, here's the same code with balancing: How embarrassing. Still, your code is quite subtle. As penance, here's my explanation, separating the main idea from the knot-tying. The ingredients are a map

Re: [Haskell-cafe] Re: Optimization problem

2006-09-17 Thread Ross Paterson
On Thu, Sep 14, 2006 at 07:51:59PM +0200, Bertram Felgenhauer wrote: It's a result of thinking about lazy evaluation, and especially lazy patterns (and let bindings) for some time. A wiki article that helped me a lot to understand these is http://www.haskell.org/hawiki/TyingTheKnot I'd

Re: [Haskell-cafe] Re: Optimization problem

2006-09-18 Thread Ross Paterson
On Sun, Sep 17, 2006 at 01:08:04PM +0200, [EMAIL PROTECTED] wrote: Ross Paterson wrote: It's interesting that these composed transformations don't seem to cost too much. That the composed transformations are indeed cheap is not necessarily disturbing. I meant the composition

Re: [Haskell-cafe] Re: Optimization problem

2006-09-18 Thread Ross Paterson
On Mon, Sep 18, 2006 at 12:23:11AM +0100, Ross Paterson wrote: To prove that (even for partial and infinite lists ps) splitSeq ps = [(a, seconds a ps) | a - nub ps] [...] we can establish, by induction on the input list, (1) fst (splitSeq' s ps) = [(a, seconds a ps

Re: [Haskell-cafe] Re: Optimization problem

2006-09-19 Thread Ross Paterson
On Tue, Sep 19, 2006 at 01:41:51PM +0200, [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? Not GADTs, but existential types (whether done with GADTs or not). They can't be analysed with irrefutable patterns, of which let bindings are a special case:

Re: [Haskell-cafe] Re: Optimization problem

2006-09-20 Thread Ross Paterson
On Tue, Sep 19, 2006 at 08:06:07PM +0200, [EMAIL PROTECTED] wrote: For our optimization problem, it's only a matter of constructors on the right hand side. They should pop out before do not look on any arguments, so it's safe to cry so you just know, i'm a Just. It seems the appropriate

Re: [Haskell-cafe] what is a difference between existential quantification and polymorhic field?

2006-09-21 Thread Ross Paterson
[apologies to Bulat for the repeat posting] On Thu, Sep 21, 2006 at 12:05:23PM +0400, Bulat Ziganshin wrote: now i'm reading Haskell' proposals and found that these two things considered as different: http://hackage.haskell.org/trac/haskell-prime/wiki/ExistentialQuantification

Re: [Haskell-cafe] Re: Optimization problem

2006-09-28 Thread Ross Paterson
On Tue, Sep 19, 2006 at 01:52:02PM +0100, Conor McBride wrote: [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? Just imagine data Eq a b where Refl :: Eq a a coerce :: Eq a b - a - b coerce ~Refl a = a coerce undefined True :: String Bang you're

Re: [Haskell-cafe] Re: Optimization problem

2006-09-28 Thread Ross Paterson
On Thu, Sep 28, 2006 at 03:22:25PM +0100, Simon Peyton-Jones wrote: | Does anything go wrong with irrefutable patterns for existential types? Try giving the translation into System F. Hmm, that's not quite as satisfying as Conor's answer for GADTs.

[Haskell-cafe] existential types (was Re: Optimization problem)

2006-09-29 Thread Ross Paterson
On Thu, Sep 28, 2006 at 03:22:25PM +0100, Simon Peyton-Jones wrote: | Does anything go wrong with irrefutable patterns for existential types? Try giving the translation into System F. I'm a bit puzzled about this. A declaration data Foo = forall a. MkFoo a (a - Bool) is equivalent

Re: [Haskell-cafe] existential types (was Re: Optimization problem)

2006-09-29 Thread Ross Paterson
On Fri, Sep 29, 2006 at 11:19:26AM +0100, Simon Peyton-Jones wrote: I must be missing your point. Newtype is just type isomorphism; a new name for an existing type. But there is not existing type exists x. T(x). So it's not surprising that newtype doesn't support existentials. And yet

[Haskell-cafe] Re: Problematic irrefutable pattern matching of existentials

2006-10-02 Thread Ross Paterson
On Sun, Oct 01, 2006 at 08:05:15PM -0700, [EMAIL PROTECTED] wrote: I have come to realize that irrefutable pattern matching of existentials may indeed be problematic. Let us consider the following existential data type data FE = forall a. Typeable a = Foo a | forall a. Typeable a =

Re: [Haskell-cafe] Either as a Monad instance

2006-10-03 Thread Ross Paterson
On Tue, Oct 03, 2006 at 07:52:54AM -0400, Lennart Augustsson wrote: Yes, having fail in the Monad is a horrible wart. And like some other warts in Haskell it was added to cure the symptom rather than the disease. :( Switching metaphors, what do you see as the disease in this case? (As far as

Re: [Haskell-cafe] beginner's problem about lists

2006-10-11 Thread Ross Paterson
On Wed, Oct 11, 2006 at 11:04:49AM -0400, Robert Dockins wrote: let q = seq q (FinCons 3 q) in q(beta) We have (from section 6.2): seq _|_ y = _|_ seq x y = yiff x /= _|_ Now, here we have an interesting dilemma. The meaning of a recursive definition is the

Re: [Haskell-cafe] Re: Re: Read a single char

2006-10-25 Thread Ross Paterson
On Wed, Oct 25, 2006 at 06:57:38PM +0200, Hans van Thiel wrote: Yes, but the problem is with two subsequent runs of main. I'd have thought the buffer would flush automatically and the second run would start with an empty buffer. Now I enter 'b', then press

Re: [Haskell-cafe] mapAccumL - find max in-sequence subsequence

2006-10-30 Thread Ross Paterson
It's a pity that groupBy isn't defined a little differently: -- @'groupBy' rel xs@ returns the shortest list of lists such that -- -- * the concatenation of the lists is @xs@, and -- -- * @rel@ is 'True' for each consecutive pair of elements in a sublist. -- groupBy :: (a - a -

Re: [Haskell-cafe] Guidelines for proposing library changes

2006-10-31 Thread Ross Paterson
On Wed, Oct 25, 2006 at 11:58:59AM +1000, Donald Bruce Stewart wrote: After some discussion on the libraries list, I've put up the suggested 'best practice' for proposing library changes, here: http://haskell.org/haskellwiki/Library_submissions The idea is to reduce the number of

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

2006-11-15 Thread Ross Paterson
On Wed, Nov 15, 2006 at 09:04:01AM +, Simon Peyton-Jones wrote: I don't agree. My programs have invariants that I can't always express in a way that the type system can understand. E.g. I know that a variable is in scope, so searching for it in an environment can't fail: head [ v

Re: [Haskell-cafe] Haskell Debugging

2006-11-15 Thread Ross Paterson
On Mon, Nov 13, 2006 at 04:32:34PM +0100, Valentin Gjorgjioski wrote: import Hugs.Observe ex8 :: [Float] ex8 = (observe after reverse ) reverse [10.0,7.0,3.0,0.0,4.0] gives me ex8 [4.0,0.0,3.0,7.0,10.0] Observations after reverse { \ ($-990871 : $-990888 : $-990905 :

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

2006-11-19 Thread Ross Paterson
On Sun, Nov 19, 2006 at 03:41:29PM +1100, Donald Bruce Stewart wrote: http://haskell.org/haskellwiki/How_to_write_a_Haskell_program Feedback welcome! There is inconsistent advice regarding Setup.hs/Setup.lhs. (#! in .hs files seems to be a feature of GHC Haskell.) For releases, another

Re: [Haskell-cafe] Priority Queue?

2006-11-26 Thread Ross Paterson
On Sun, Nov 26, 2006 at 04:58:13PM -0500, Ken Takusagawa wrote: Is there a Haskell implementation of an efficient priority queue (probably heap-based) out there that I can use? I do not see it in the GHC libraries. As already mentioned, there are several in Edison. If you want to roll your

Re: [solved] Re: [Haskell-cafe] c2hs and cabal?

2006-11-29 Thread Ross Paterson
On Wed, Nov 29, 2006 at 01:12:50PM +, Duncan Coutts wrote: http://www.haskell.org/cabal/release/latest/doc/users-guide/x30.html#buildinfo Section 2.1.4, though I do notice that the link to the full list of extensions is broken. This version works (and looks better too):

Re: [Haskell-cafe] known, I know: class contexts and mutual recursion

2006-12-04 Thread Ross Paterson
On Mon, Dec 04, 2006 at 05:21:15PM +, Ian Lynagh wrote: On Wed, Nov 29, 2006 at 06:14:56PM +, Conor McBride wrote: Mmm.lhs:15:1: Contexts differ in length When matching the contexts of the signatures for foo :: forall (m :: * - *). (Monad m) = Thing - m Int goo ::

Re: [Haskell-cafe] Download locations for former-base libraries?

2006-12-05 Thread Ross Paterson
On Tue, Dec 05, 2006 at 12:18:25PM -0600, John Goerzen wrote: For each such library, I need to be able to tell users where they can go to download the dependency. But I'm having a lot of trouble finding canonical download locations. For instance, the homepage of regex-compat, according to

Re: [Haskell-cafe] Re: Download locations for former-base libraries?

2006-12-05 Thread Ross Paterson
On Tue, Dec 05, 2006 at 02:57:36PM -0600, John Goerzen wrote: Ross Paterson wrote: You could direct them to http://hackage.haskell.org/packages/unstable/ Is that site guaranteed to have the same packages/versions as the ghc extralibs has? For the extralibs, those version numbers

Re: [Haskell-cafe] Building the community

2006-12-14 Thread Ross Paterson
On Thu, Dec 14, 2006 at 10:16:10AM +, Neil Mitchell wrote: I'd say our worst feature is tending to give solutions which are not simple Haskell, but make use of advanced features. When a beginner asks a question, sometimes the answer requires GADT's, Template Haskell, rank-2 types etc.

Re: [Haskell-cafe] Re: Versioning

2006-12-20 Thread Ross Paterson
On Wed, Dec 20, 2006 at 07:30:02PM +0100, Joachim Durchholz wrote: Neil Mitchell schrieb: You seem to be describing SYB and not knowing it: http://homepages.cwi.nl/~ralf/syb1/ That basically does exactly what you've requested, in terms of traversing all items when only one matters. Yup,

Re: [Haskell-cafe] Shrinking the Prelude: The categorical approach

2006-12-21 Thread Ross Paterson
On Thu, Dec 21, 2006 at 07:16:16PM +0100, Henning Thielemann wrote: About the question, whether functions should be provided in the most general context, I refer to http://www.haskell.org/haskellwiki/Slim_instance_declaration Certainly we all agree that a module that defines instances

Re: [Haskell-cafe] Re: partial functions / failure, Maybe and MonadError and good style

2006-12-22 Thread Ross Paterson
On Fri, Dec 22, 2006 at 08:37:05PM -0500, Steve Downey wrote: On 12/22/06, Stefan O'Rear [EMAIL PROTECTED] wrote: All monads provide a fail operation, and any function that uses fail will be able to work with any monad's error handling mechanism. * Maybe - fail msg is Nothing (ignores

Re: [Haskell-cafe] trouble installing greencard -- -fno-prune-tydecls flag ( was Re: trivial function application question )

2007-01-06 Thread Ross Paterson
On Sun, Jan 07, 2007 at 12:44:46PM +1100, Donald Bruce Stewart wrote: dmhouse: On 06/01/07, Chris Kuklewicz [EMAIL PROTECTED] wrote: Running --configure notices that many things are not installed, but this is just noise from Cabal. This is the second time I've seen someone get

Re: [Haskell-cafe] State monad strictness - how?

2007-01-10 Thread Ross Paterson
On Wed, Jan 10, 2007 at 10:02:36AM -0800, Iavor Diatchki wrote: [Yitzchak Gale:] Unfortunately, the current situation is that State is only available as a lazy monad, and StateT is only available as a strict monad. There is no such distinction in monadLib. The state transformer inherits

Re: [Haskell-cafe] mtl tweaks

2007-01-21 Thread Ross Paterson
On Sun, Jan 21, 2007 at 12:37:02PM -0600, Nicolas Frisby wrote: I have another small mtl complaint: ReaderT, for example, requires the base type to be a Monad in order to make it a Functor. So it's Monad m = Functor (ReaderT r m) instead of Functor f = Functor (ReaderT r f), which is what's

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-29 Thread Ross Paterson
On Fri, Jan 26, 2007 at 01:51:01PM +1100, Donald Bruce Stewart wrote: Binary: high performance, pure binary serialisation for Haskell -- The Binary Strike Team is pleased to announce the release of a new,

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-30 Thread Ross Paterson
On Tue, Jan 30, 2007 at 09:52:01AM +1100, Donald Bruce Stewart wrote: ross: why do you need a Put monad, which always seems to have the argument type ()? Monoids really are underappreciated. For the syntax, and So that people can directly port their code from NewBinary. (The instances

Re: [Haskell-cafe] ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-30 Thread Ross Paterson
On Tue, Jan 30, 2007 at 10:22:58AM +, Duncan Coutts wrote: Ross, you need to make a monoid transformer library (at least reader and state) and campaign for ++ to be redefined as mappend, then everyone will want to use it since it'll be so neat and convenient! :-) Reader is already there.

Re: [Haskell-cafe] Declaring variance of class parameters?

2007-02-27 Thread Ross Paterson
On Tue, Feb 27, 2007 at 02:00:29PM -0500, Jacques Carette wrote: If I have a class, say class Symantics repr where int:: Int - repr Int and so on, I would like to *require* that 'repr' be covariant. Is there any way to do that? class Functor repr = Symantics repr would be

Re: [Haskell-cafe] Literate haskell format unclear (implementation and specification inconsistencies)

2007-03-03 Thread Ross Paterson
On Fri, Mar 02, 2007 at 01:46:38AM +, Ian Lynagh wrote: On Wed, Feb 28, 2007 at 05:48:09PM -0500, Isaac Dupree wrote: Trying to implement literate haskell[*], I realized several ways in which the correct behavior for unliterating (especially with regard to errors) was unclear. I have

Re: [Haskell-cafe] Haskell Weekly News - February 10, 2008

2008-02-11 Thread Ross Paterson
On Mon, Feb 11, 2008 at 02:24:19PM +0100, Wolfgang Jeltsch wrote: Am Montag, 11. Februar 2008 02:09 schrieb Don Stewart: [???] * Imlib 0.1.1. Uploaded by Cale Gibbard. [120]Imlib: Added by CaleGibbard, Sun Jan 13 22:26:59 PST 2008.. [???] * haddock 2.0.0.0.

Re: [Haskell-cafe] Arrows: definition of pure arr

2008-02-17 Thread Ross Paterson
On Sun, Feb 17, 2008 at 12:00:43AM -0800, Jonathan Cast wrote: arr = pure pure = arr [...] This example is admittedly kind of silly, but I'm sure someone has a passionate attachment to one or both names, so requiring definitions to use one or the other would be

Re: [Haskell-cafe] The Proliferation of List-Like Types

2008-02-20 Thread Ross Paterson
On Wed, Feb 20, 2008 at 08:39:13AM -0600, John Goerzen wrote: I am concerned that the same thing is happening in Haskell. We now have three common list-like types: the regular list, strict ByteString, and lazy ByteString. This has created some annoying situations. For instance, a

Re: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-20 Thread Ross Paterson
On Wed, Feb 20, 2008 at 09:22:58PM +, Steve Lihn wrote: I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not! Currently it only includes GHC 6.8 core library. If

Re: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-21 Thread Ross Paterson
On Wed, Feb 20, 2008 at 09:22:58PM +, Steve Lihn wrote: I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not! Currently it only includes GHC 6.8 core library. If

Re: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-23 Thread Ross Paterson
On Sat, Feb 23, 2008 at 10:59:40AM -0500, Steve Lihn wrote: I parsed through all the hackagedb modules. I also added the display of repository source (ghc, hdb) and package source. HackageDB is 3-4 times bigger than GHC core. The result is interesting, looking at the most used modules move up

Re: [Haskell-cafe] cabal errors

2008-02-29 Thread Ross Paterson
On Thu, Feb 28, 2008 at 07:10:03AM -0500, Kristofer Buffington wrote: I installed ghc 6.8 from source and I've been installing packages from hackage. I'm not sure when the problem started, but I've been getting this error trying to install any cabal package.. accept apparently, Cabal itself.

Re: [Haskell-cafe] looking for examples of non-full Functional Dependencies

2008-04-16 Thread Ross Paterson
On Wed, Apr 16, 2008 at 04:30:27PM +0200, Tom Schrijvers wrote: I'm looking for practical examples of non-full functional dependencies and would be grateful if anyone could show me some or point to applications using them. A non-full functional dependency is one involves only part of the

Re: [Haskell-cafe] Hackage Haddock fails where local succeeds

2008-04-17 Thread Ross Paterson
On Thu, Apr 17, 2008 at 06:45:40AM -0500, John Goerzen wrote: My local haddock, 0.8, parses this file fine. Is Hackage running and older version? Could it be upgraded? Or is there something else going on here? No, it's running haddock 2.1.0, which understands all the GHC extensions, but is

Re: [Haskell-cafe] Problems with Bananas

2008-04-19 Thread Ross Paterson
On Sat, Apr 19, 2008 at 07:37:50PM -0500, Creighton Hogg wrote: This isn't about Haskell per se, but I was reading the old Meijer et al. paper Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire I think there's a notational pun that's really confusing me. On page 12 we

Re: [Haskell-cafe] List concat

2008-05-10 Thread Ross Paterson
On Fri, May 09, 2008 at 11:04:26PM +0100, Lennart Augustsson wrote: There are many implementations of such things. Data.Sequence is one. You can also make an implementation that has O(1) cons, snoc, and append, but that's rather tricky and has a large constant factor. It's also rather

Re: [Haskell-cafe] elem of infinite set of tuple

2008-05-16 Thread Ross Paterson
On Fri, May 16, 2008 at 07:58:40AM -0400, Dan Doel wrote: On Friday 16 May 2008, leledumbo wrote: I don't know how Haskell should behave on this. Consider this function: elemOf (x,y) = (x,y) `elem` [ (a,b) | a - [0..], b - [0..] ] FYI: The control-monad-omega package on hackage.haskell.org

  1   2   3   4   >