Re: Feedback request: priority queues in containers

2010-03-16 Thread Jim Apple
 Specifically, we use a binomial heap, which offers O(log n) worst-case union O(log n) worst-case extract (this in particular was a key objective of ours) amortized O(1), worst-case O(log n) insertion. (In a persistent context, the amortized performance bound does not necessarily hold.) Why

Re: Feedback request: priority queues in containers

2010-03-16 Thread Jim Apple
I wrote a pretty efficient skew binomial heap implementation -- the first step of Okasaki's approach -- and found it was already slower than the optimized binomial heap. I'm not sure whether or not I uploaded that benchmark, though. I'll do that at some point today, just to keep everyone

Re: Rank-2 polymorphism and pattern matching

2008-01-07 Thread Jim Apple
On Jan 7, 2008 1:37 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote: Sadly, it's not true in Haskell, is it? (error urk) : [] also has type (forall a. [a]). It is a bit sad, but I think that's The Curse of The _|_, which infects any attempt to add static assurance. It's nicer if

Re: Rank-2 polymorphism and pattern matching

2008-01-06 Thread Jim Apple
On Jan 4, 2008 5:15 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote: | The following won't compile for me | | isnull :: (forall a . [a]) - Bool | isnull ([] :: forall b . [b]) = True | | Couldn't match expected type `forall b. [b]' | against inferred type `[a]' |

Rank-2 polymorphism and pattern matching

2007-12-28 Thread Jim Apple
The following won't compile for me isnull :: (forall a . [a]) - Bool isnull ([] :: forall b . [b]) = True Couldn't match expected type `forall b. [b]' against inferred type `[a]' In the pattern: [] Wrapping it in a constructor doesn't help, though I can define a null: data

Re: cvs commit: fptools/libraries/base/Data IntMap.hs Map.hs Sequence.hs Set.hs fptools/libraries/base/Data/Generics Instances.hs Twins.hs

2006-01-08 Thread Jim Apple
Simon Peyton Jones wrote: simonpj 2006/01/06 07:51:23 PST Modified files: libraries/base/Data IntMap.hs Map.hs Sequence.hs Set.hs libraries/base/Data/Generics Instances.hs Twins.hs Log: Eta-expand some higher-rank functions. GHC is about to move to *invariant* rather

Data.Typeable and default instances

2005-12-04 Thread Jim Apple
{-# OPTIONS -fglasgow-exts #-} import Maybe import Data.Typeable data Nil = Nil deriving (Eq,Typeable,Show) class (Typeable t) = List a t where init :: (t - b) - (forall y . (List a y) = y - b) init f z = fromJust $ do x - cast z return $ f x

Re: Associated types in 6.6?

2005-11-28 Thread Jim Apple
Simon Peyton-Jones wrote: The trick lies in coming up with a suitable typed intermediate representation for the program -- System F isn't enough. Is that because GHC's TIL is not exactly System F? As ever, we tend to work harder on things that folk appear to want; Unrelated question: will

Rebindable monads?

2005-11-26 Thread Jim Apple
Where is there documentation for rebindable syntax for monads with class constraints: (=) :: (Foo m, Baz a) = m a - (a - m b) - m b http://article.gmane.org/gmane.comp.lang.haskell.cvs.ghc/9447/match=syntax The users guide seems to disallow such type signatures:

Associated types in 6.6?

2005-11-26 Thread Jim Apple
I see that associated types is already in CVS: http://article.gmane.org/gmane.comp.lang.haskell.cvs.all/19423/match=associated Will it be in 6.6? Jim ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org

GHC 6.6

2005-11-23 Thread Jim Apple
Help build the anticipation: http://haskell.org/hawiki/GHC_206_2e6 Present text: GHC 6.6: Will be out before May 2006. Included: * Parallel GHC * Associated types with class Maybe: * Impredicativity * GADT Typeclass interaction * Data types as kinds No: Jim

Re: ANNOUNCE: GHC survey results

2005-06-28 Thread Jim Apple
Some people would like features removed (implicit parameters was mentioned a couple of times). Linear implicit parameters is a clear candidate for removal. I don't understand the motivation for this. Implicit parameters do weird things with the monomorphism restriction, but when I'm worried

Re: cvs commit: fptools/ghc/compiler/hsSyn HsUtils.lhs fptools/ghc/compiler/typecheck TcRnDriver.lhs TcRnMonad.lhs TcUnify.lhs

2005-05-22 Thread Jim Apple
Simon Peyton Jones wrote: - For command-line 'let' and 'x-e' forms, if exactly one variable is bound, we print its value if it is Showable and not () prompt let x = 4 4 prompt x - return 5 5 prompt let ones = [1:x] What am I to do if I want ones set, but

Re: gfindtype type

2005-01-28 Thread Jim Apple
Let me restate: gfindtype's declaration should be gfindtype :: (Data x, Typeable y) = x - Maybe y Jim ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

gfindtype type

2005-01-26 Thread Jim Apple
Why is gfindtype :: (Data x, Data y) = x - Maybe y and not gfindtype :: (Data x, Typeable y) = x - Maybe y ? Jim Apple ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users