Hi,
I checked the current Fibonacci Queue in Hackage DB:
http://hackage.haskell.org/packages/archive/pqueue-mtl/1.0.7/doc/html/src/Data-Queue-FibQueue.html#FQueue
And a history email for Okasaki in 1995:
http://darcs.haskell.org/nofib/gc/fibheaps/orig
The hardest part is how to consolidate all
Hi,
In CLRS, there are algorithms about DECREASE-KEY and DELETE-NODE.
However, in the Functional approach, I didn't find corresponding solution.
One approach may just mark the node as `deleted' and when pops the top
element from the heap, we repeat it until find a unmarked node.
--
LIU
On 30 Dec 2010, at 03:05, Mark Spezzano wrote:
... regarding formal definitions of FREE and BOUND variables he
gives Defn 5.2 as
It is the occurrence of a variable that is free or bound. An
occurrence of a variable is bound if it is in the scope of something
that binds it; otherwise it
Hi,
the definition in the book is a syntactic one, you are not allowed to
beta-reduce when applying the definition.
In particular
E = E1 E2 = (\x.xy)(\z.z)
The definition speaks about the term
(\x.xy)(\z.z) and not about (\z.z)y
and the definition does not speak about occurences of
On Thu, Dec 30, 2010 at 02:20:34PM +1030, Mark Spezzano wrote:
5.3 BOUND:
=
If E1 = \x.xy then x is bound
If E2 = \z.z then is not even mentioned
So E = E1 E2 = (\x.xy)(\z.z) = (\z.z)y -- Error: x is not bound but
should be by the rule of 5.3
Your final = here is beta equality.
2010/12/30 Andreas Baldeau andr...@baldeau.net:
instance Ord TypeRep where
compare t1 t2 =
compare
(unsafePerformIO (typeRepKey t1))
(unsafePerformIO (typeRepKey t2))
I think it would suffice. Thank you for a tip.
Leon Smith wrote:
Ok, after mulling over the issues that Will Ness has brought up in
the last few days [1], I think I have a partial explanation for the
apparent tension between Will's observations and Heinrich Apfelmus's
Implicit Heaps article [2], which both concern the implementation of
William Murphy wrote:
I've spent a lot of time trying to write a version of concat, which
concatenates lists of any depth:
It is a little bit more involved, but quite possible. The code is not
much longer than the one you wrote (essentially, three lines: one
class and two instance
On Wed, 29 Dec 2010, william murphy wrote:
Hi All,
I've spent a lot of time trying to write a version of concat, which
concatenates lists of any
depth:
So:
concat'' [[[1,2],[3,4]],[[5]]] would return: [1,2,3,4,5]
You can nicely solve this problem in Haskell 98 using a Tree
On 12/29/10 22:40, Daryoush Mehrtash wrote:
Why do people put ; in do {}, or , in data fields, at the
beginning of the line?
--
It reflects the parse tree better by putting the
combining operators (e.g. ';' and ',') at the left
and their operands (or combined subtrees) indented
to the
On Thu, 30 Dec 2010, Antoine Latter wrote:
I started for cleaner diffs and easier editing - I can add/remove a
line at the end without editing any other line. Eventually I grew to
like the look of it.
That's not true. As long as the comma is used as separator one line can
affect an adjacent
On Thu, Dec 30, 2010 at 07:04:11AM -0600, Larry Evans wrote:
On 12/29/10 22:40, Daryoush Mehrtash wrote:
Why do people put ; in do {}, or , in data fields, at the
beginning of the line?
--
It reflects the parse tree better by putting the
combining operators (e.g. ';' and ',') at the
On Thu, 30 Dec 2010, Lauri Alanko wrote:
Even nowadays, Haddock deliberately generates the following layout for
long function types:
openTempFile
:: FilePath
- String
- IO (FilePath, Handle)
The layout draws special attention to the first argument type, whereas
the other argument
On Thu, Dec 30, 2010 at 8:15 AM, Henning Thielemann
lemm...@henning-thielemann.de wrote:
On Thu, 30 Dec 2010, Antoine Latter wrote:
I started for cleaner diffs and easier editing - I can add/remove a
line at the end without editing any other line. Eventually I grew to
like the look of it.
On Thu, Dec 30, 2010 at 8:33 AM, Lauri Alanko l...@iki.fi wrote:
On Thu, Dec 30, 2010 at 07:04:11AM -0600, Larry Evans wrote:
On 12/29/10 22:40, Daryoush Mehrtash wrote:
Why do people put ; in do {}, or , in data fields, at the
beginning of the line?
--
It reflects the parse tree
Hi
Thus invoked...
On 28 Dec 2010, at 23:29, Luke Palmer wrote:
Eta conversion corresponds to extensionality; i.e. there is nothing
more to a function than what it does to its argument.
Suppose f x = g x for all x. Then using eta conversion:
f = (\x. f x) = (\x. g x) = g
Without eta this
On 30 December 2010 15:44, Antoine Latter aslat...@gmail.com wrote:
On Thu, Dec 30, 2010 at 8:33 AM, Lauri Alanko l...@iki.fi wrote:
Even nowadays, Haddock deliberately generates the following layout for
long function types:
openTempFile
:: FilePath
- String
- IO
Not sure what's going on here. Doesn't like line 5, the type statement. And
what's with the semicolons in that line and in function main?
Michael
=
From:
http://www.haskell.org/ghc/docs/6.10.3/html/libraries/mtl/Control-Monad-Reader.html
import Control.Monad.Reader
import qualified
That i18n is a fantastic argument - and one that really means cmdargs
has no choice but to support all the attributes on help/version.
Is it possible to change the groupname for the implicit help and version
options? I have defined some options with groupname development flags, but I
would
Because Data.Map is imported qualified, any symbols in it (including
Map) needs to be qualified:
type Bindings = Map.Map String Int
A standard idiom is to do import like so:
import qualified Data.Map as Map
import Map (Map)
so that the Map symbol itself does not need qualification.
Eric
On Thu, 30 Dec 2010 08:01:01 -0800 (PST)
michael rice nowg...@yahoo.com wrote:
Not sure what's going on here. Doesn't like line 5, the type
statement. And what's with the semicolons in that line and in
function main?
import Control.Monad.Reader
import qualified Data.Map as Map
import
On 12/30/10 08:17, Henning Thielemann wrote:
On Thu, 30 Dec 2010, Lauri Alanko wrote:
Even nowadays, Haddock deliberately generates the following layout for
long function types:
openTempFile
:: FilePath
- String
- IO (FilePath, Handle)
The layout draws special attention to the
Thanks, all.
Just tried
type Bindings = Map.Map String Int
and it also seems to work.
Michael
--- On Thu, 12/30/10, Pedro Vasconcelos p...@dcc.fc.up.pt wrote:
From: Pedro Vasconcelos p...@dcc.fc.up.pt
Subject: Re: [Haskell-cafe] Not in scope: type constructor or class `Map'
To:
On 10-12-29 11:40 PM, Daryoush Mehrtash wrote:
Why do people put ; in do {}, or , in data fields, at the
beginning of the line?
There was a time I did this to help the auto-indenter.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Given a Haskell record type :-
data Test
= Test {
name :: String,
value :: Int
}
test = Test {
name = test,
value = 1
}
main :: IO ()
main = do
putStrLn (name test)
Are name and value in the global name
Hi Sönke,
helpArg [groupname Something] should work, but it sounds like it
doesn't. I've raised a bug:
http://code.google.com/p/ndmitchell/issues/detail?id=392
I'll probably have this fixed in about a week.
Thanks, Neil
On Thu, Dec 30, 2010 at 4:05 PM, Sönke Hahn sh...@cs.tu-berlin.de wrote:
Yes, they are in the global scope, and from what I gather: they are just
regular functions, created by special syntax.
There are a few obvious solutions (some of which you might have thought
yourself :-):
- rename the accessor or the other function, or
- put the data declaration or the other
On 30 December 2010 17:23, Markus Läll markus.l...@gmail.com wrote:
Yes, they are in the global scope, and from what I gather: they are just
regular functions, created by special syntax.
There are a few obvious solutions (some of which you might have thought
yourself :-):
- rename the
I don't think record field disambiguation what you're after. My apologies.
-deech
On Thu, Dec 30, 2010 at 11:20 AM, aditya siram aditya.si...@gmail.com wrote:
Take a look at the record field disambiguation [1] extension to GHC.
It sounds like what you're looking for.
-deech
[1]
On Thu, Dec 30, 2010 at 10:39:29AM -0600, Larry Evans wrote:
Lauri, I assume then that you want to draw special attention to
the return type instead of the first argument type.
Only to the fact that the return type is of a different nature than
the argument types, and that all the argument
Take a look at the record field disambiguation [1] extension to GHC.
It sounds like what you're looking for.
-deech
[1]
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/syntax-extns.html#disambiguate-fields
On Thu, Dec 30, 2010 at 11:01 AM, Aaron Gray aaronngray.li...@gmail.com wrote:
Hi Sönke,
I've just released cmdargs-0.6.6 which supports helpArgs [groupname Something]
Thanks, Neil
On Thu, Dec 30, 2010 at 5:09 PM, Neil Mitchell ndmitch...@gmail.com wrote:
Hi Sönke,
helpArg [groupname Something] should work, but it sounds like it
doesn't. I've raised a bug:
On 30 December 2010 17:29, aditya siram aditya.si...@gmail.com wrote:
I don't think record field disambiguation what you're after. My apologies.
-deech
Interesting never the less.
Thanks,
Aaron
On Thu, Dec 30, 2010 at 11:20 AM, aditya siram aditya.si...@gmail.com
wrote:
Take a look
Antoine Latter aslat...@gmail.com writes:
openTempFile
:: FilePath
- String
- IO (FilePath, Handle)
My main discomfort with this is not the result type, but that the first
argument appears different from the rest. I much prefer having the ::
be attached to the identifier. FWIW.
-k
On Thu, 30 Dec 2010, Lauri Alanko wrote:
Except that it falsely suggests that the last argument types are of a
similar nature as the return type. Here's what went in my head when I
first read Haskell code:
openTempFile ::
FilePath -- All right, this first part is probably the argument.
Hi,
Sorry for there is a bug in my previous post.
The example consolidate function for number should be like this:
consolidate xs = foldl meld [] xs where
meld [] x = [x]
meld (x':xs) x | x == x' = meld xs (x+x')
| x x' = x:x':xs
| otherwise = x':
Heinrich Apfelmus apfelmus at quantentunnel.de writes:
Leon Smith wrote:
[1] http://permalink.gmane.org/gmane.comp.lang.haskell.cafe/84666
[2] http://apfelmus.nfshost.com/articles/implicit-heaps.html
[3]
http://hackage.haskell.org/packages/archive/data-ordlist/0.4.4/doc/html/Data-
Lauri Alanko l...@iki.fi wrote in article
20101230133355.gb...@melkinpaasi.cs.helsinki.fi in
gmane.comp.lang.haskell.cafe:
The following is much clearer:
openTempFile ::
FilePath -
String -
IO (FilePath, Handle)
(Possibly with the arrows aligned.)
I can't understand
38 matches
Mail list logo