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
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
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
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]'
|
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
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
{-# 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
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
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:
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
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
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
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
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
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
15 matches
Mail list logo