Hi John,
I'm vaguely curious, and have next week off, so if you can provide the
code, and directions for running in both variants and the test case,
I'll take a look. Please email me at ndmitchell -AT- gmail.com though,
as I loose this email address at 11pm tonight :-)
Thanks
Neil
I was noticing recently that there seems to be a problem
with Hoogle
and Haddock. In particular, I just hoogled bracket and got the
following result:
bracket :: IO a - a - IO b - a - IO c - IO c
Clearly this is the
wrong type, as it should be
bracket :: IO a - (a - IO
Hi,
Floating point numbers are just inaccurate, so the results you see aren't too
surprisingly.
Interestingly enough, using Hugs, I get the right answer in both cases - so its
possible it's a bug, but unlikely.
If you do want exact floating point manipulation then use rational numbers
Hi
I have the same experience with Windows XP and getContents, so I think
it's the entire IO layer on Windows, rather than just getLine on Vista.
This is being tracked here
http://hackage.haskell.org/trac/ghc/ticket/2758
Thanks
Neil
I've had the same experience with runghc in GHC 6.10.1 on
I guess one drawback compared to Neil's suggested use of any (and
staying with a separate isTypeB) is that your solution will iterate
over the entire list, regardless of an early hit.
Nope, it will stop on the first one - Haskell is lazy like that :-)
Thanks, Neil
It's possible that there's some more direct approach that
represents types as some kind of runtime values, but nobody
(to my knowledge) has done that.
It don't think its possible - I tried it and failed.
Consider:
show (f [])
Where f has the semantics of id, but has either the return
containsTypeB ts = not $ null [x | (B x) - ts]
No need for the brackets on the left of the -:
not $ null [x | B x - ts]
findBs ts = [b | b@(B _) - ts]
or
findBs ts = [B x | (B x) - ts]
both of them compile but the first is ugly and the second is
inefficient (Tags a new T for
Hi Paul,
maybe False (\x - True) (find isTypeB ts)
This can be more neatly expressed as:
isJust (find isTypeB ts)
But your entire thing can be expressed as:
containsTypeB ts = any isTypeB ts
I recommend reading through the Prelude interface and the List
interface, it has many useful
Hi
The one way to test this is to benchmark, everything else will just be
peoples random guesses.
As for my random guess, eval should be significantly faster than peval
in Hugs, and probably slightly faster than peval in GHC. I don't see why
you think peval is efficient - monads /= efficiency,
Generalised? Heck, I don't use list comprehension at all! :-P
Perhaps you should! :-)
You definitely should! Take a look at the Uniplate paper for some
wonderful concise uses of list comprehensions for abstract syntax tree
traversals. If you use a language like F# they become even more
System.Info is broken. os has the wrong type.
And the wrong value!
I have not installed mingw32 on this machine, mingw32 isn't even an
os...
/me has goal of having os on Linux report wine1.1.7
Thanks
Neil
==
Please
Hi Martijn,
It's not that tricky if you do a regular expression state machine yourself, but
that's probably a bit too much work. One way to get a speed up might be to take
the regular expressions a,b,c,d and generate a regex a+b+c+d, and one a+b. You
can then check any string s against
I think using Template Haskell for your work would fit very
nicely, so
is a good choice to learn :-)
I already got used to TH a bit, but I am not sure if it is
appropriate for my purpose, or at least not completely.
I want to load Haskell code into my program at runtime in an
Duncan,
I believe the major darcs issue is the changed GADT implementation
between 6.6, so that neither 6.6 or 6.8 is a superset/subset of the
other - leading to a situation where they have to use a common subset of
both.
Thanks
Neil
-Original Message-
From: [EMAIL PROTECTED]
Hi,
That is a fairly standard implementation of rounding for financial
institutions. Consider
sum . map round
Over the list [3.5,2.5]
With rounding to the nearest even integer for 0.5's you get 6, otherwise
if you always round up you get 7. If you bias towards rounding up you
get a general
Redirected to haskell-cafe, since that's where all discussions should go
(haskell = announcments only)
Does some one have made performance tests on the different XML
libraries for Haskell? I have a 20MB xml file that I want
to read. I
remember from my earlier experiments (years ago)
Hi Alberto,
Take a look at ESC/Haskell and Sound Haskell, which provide mechanisms for
doing some of the things you want. I don't think they integrate with type
classes in the way you mention, but I think that is just a question of syntax.
http://www.cl.cam.ac.uk/~nx200/
Thanks
Neil
We try to learn functional programs from examples, but our
system is
not yet ported to Haskell, though we are working on it. However, we
thought about using TH.
Do you have any pointers to papers, etc. ? You'll find our project,
system and papers here:
Hi Larry,
There is already an abstraction for this, its called transform, and it
resides in the Uniplate library:
http://www-users.cs.york.ac.uk/~ndm/uniplate/
I have no idea what it is, or if it exists in the algebra library!
Thanks
Neil
-Original Message-
From: [EMAIL PROTECTED]
Hi
See: http://hackage.haskell.org/trac/ghc/ticket/2585
The solution is to grab a version of GHC 6.8 and copy its windres.exe
into the GHC 6.10 bin directory.
This will be fixed before release.
Thanks
Neil
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Yes, hbc had existential types around 1993.
I've used an encoding of existentials in O'Caml (well F#),
and it works, but I find it painful.
And when a very smart but non-CS person saw it his mind
boggled, whereas he understood the existential version just fine.
I'm a CS person, and when
Hi Malcolm,
The current behaviour does sound like a bug, and the revised behaviour
does sound like a fix - and one that has a sensible explanation if
people trip over it. In general having floating point be a member of
classes such as Eq has some obvious problems, but I realise is a
necessity for
Hi
I didn't understand Monads until I read this:
http://www.haskell.org/haskellwiki/Monads_as_Containers
It took me quite a long time to get them too, but slowly over time it
will sink in.
Thanks
Neil
From: [EMAIL PROTECTED]
[mailto:[EMAIL
Hi Iain,
The wiki page has quite a nice article:
http://www.haskell.org/haskellwiki/Smart_constructors
Thanks
Neil
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Iain Barnett
Sent: 09 October 2008 2:03 pm
To: haskell-cafe@haskell.org
Subject:
Hi Philip,
You might want to take a look at the Safe library, which does pretty close to
what you request.
http://www-users.cs.york.ac.uk/~ndm/safe/
(or cabal install safe)
I would happily accept a patch adding *Fail variants that failed in some
appropriate Monad if that is what you want.
Yes, I've used SSH key. Didn't think it would be different
with a password.
It really is! :-)
Thanks
Neil
On 7 Oct 2008, at 20:19, Mitchell, Neil wrote:
I use darcs on Windows every day and it works well. The
only problem
is that it is not very usable if you access your
Actually, I was thinking more along the lines of
Data.Traversable.sequence, which has
sequence :: (Traversable t, Monad m) = t (m a) - m (t a)
Are you expecting c1 (:: * - * - *) to unify with [] (:: * - *)?
That seems kind incorrect at the very last. Additionally,
those types
I use darcs on Windows every day and it works well. The
only problem
is that it is not very usable if you access your repository via SSH
and the authentication is via password.
Why not? It worked fine for me.
It's never worked for me, I always get a frozen darcs trying to read a
Hi
Try doing a Hoogle search for c1 (c2 x) - c2 (c1 x).
Hoogle correctly states that Data.Traversable.sequence will
do it for you.
Now try doing c1 k (c2 x) - c2 (c1 k x). The 'sequence'
function will also do this, but now Hoogle returns 0 results.
This is puzzling, since AFAIK, the
Hi
You mean shared libraries without the opportunity to
inline library code?
This would result in a huge performance loss, I think.
Usually _mild_ performance loss, in exchange for major code-size
savings, I would think. C obviously has worked quite fine under
exactly this
Quoting Lennart Augustsson [EMAIL PROTECTED]:
But I called it One.
I did a similar one for Yhc, and I think I called it Box. My guess was
that boxing/unboxing wasn't an overloaded enough term :-)
Thanks
Neil
==
Hi
You can translate this step by step.
main = do dc - getDirectoryContents ./foo/
mapM_ putStrLn dc
Translating out the do notation
(http://www.haskell.org/haskellwiki/Keywords#do):
main = getDirectoryContents = \dc -
mapM_ putStrLn dc
Then we can chop out the dc argument,
main = do dc - getDirectoryContents ./foo/
mapM_ putStrLn dc
Translating out the do notation
(http://www.haskell.org/haskellwiki/Keywords#do):
main = getDirectoryContents = \dc -
mapM_ putStrLn dc
Woops, I lost ./foo/ here, but it should be fairly easy to insert
through
The error comes from using QuickCheck 2, which happens to
also use the
operator (). I can see two ways to solve the problem:
(1) Add 2 after QuickCheck in the Wired.cabal file.
(2) Add hiding (()) after import Test.QuickCheck in
Data/Hardware/Internal.hs
Emil,
my
Hi,
For libraries F# is probably superior to all, as it has libraries for
virtually everything, and can interoperate seamlessly with COM and .NET.
I doubt there will be any library functionality that can't be found or
bought.
Thanks
Neil
--
Hello,
Hi
1) Total Functional Programming is great. But a combination of Approve
and Catch gives you termination and pattern-match safety checks for
Haskell, giving you all the advantages of TFP without forcing you to
write total patterns etc. Plus you can use all the Haskell tools.
In reality, neither
For libraries F# is probably superior to all, as it has
libraries for
virtually everything, and can interoperate seamlessly with
COM and .NET.
I doubt there will be any library functionality that can't
be found or
bought.
Libraries for monad transformers
I found lots of stuff
Hi
for little more than personal taste). In particular, I'd like to see
a reasoning framework for partial functions, so you could
state and prove a property like:
length [1..] = _|_
In a compiler, with:
default(Int)
main = print $ length [1..]
Results in 2147483647
I don't think
Hi
I just noticed that newSession has been removed from the GHC API.
Unfortunately, this breaks nearly all examples on the web:
http://www.haskell.org/haskellwiki/GHC/As_a_library
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/API
Could someone fix those up, to show the new style
Hi Tim,
You seem to be duplicating the functionality of Data.Derive to some
extent:
http://www.cs.york.ac.uk/~ndm/derive/
You might find it easier to use that tool, and if it doesn't meet your
needs send in a patch :-)
Thanks
Neil
-Original Message-
From: [EMAIL PROTECTED]
Hi Simon,
http://joyful.com/repos/darcs-sm/api-doc is a mashup of
haddock, hoogle and hscolour (and darcsweb, darcs-graph - see
http://joyful.com/repos).
I can see the Haddock information, but not the Hoogle/HsColour mashup.
I'm using Firefox 3. Am I missing something? How do you get
Hi,
For me, it seems that code.haskell.org is down. Is this the case for
other people as well?
It seems code.haskell.org regularly looses connectivity for me :-(
Thanks
Neil
==
Please access the attached hyperlink
Hi
http://downforeveryoneorjustme.com/code.haskell.org sez:
It's just you. code.haskell.org is up.
Now its up for me as well. It's a little annoying that code.haskell.org
seems so flakey.
(Seriously though, the above site is a great tool for such
circumstances.)
That is a great site,
Hi Serge,
It reports
Configuring happy-1.17...
Setup.lhs: At least the following dependencies are missing:
mtl =1.0
First make mtl, which is avaiable here:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mtl
Thanks
Neil
it).
Thanks
Neil
-Original Message-
From: Simon Peyton-Jones [mailto:[EMAIL PROTECTED]
Sent: 17 September 2008 1:40 pm
To: Mitchell, Neil; Jost Berthold
Cc: glasgow-haskell-users@haskell.org
Subject: RE: Adding (some) libraries to a GHC tree
good stuff -- but with a big
, and then
merged in to the main stuff over time.
Thanks
Neil
-Original Message-
From: Jost Berthold [mailto:[EMAIL PROTECTED]
Sent: 17 September 2008 3:23 pm
To: Simon Peyton-Jones
Cc: Mitchell, Neil; glasgow-haskell-users@haskell.org
Subject: RE: Adding (some) libraries
Hi Henning,
I tend to use openFile, hGetContents, hClose - your initial readFile
like call should be openFile/hGetContents, which gives you a lazy
stream, and on a parse error call hClose.
Thanks
Neil
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
But since GHC does not implement such a function, I was curious to
know why it don't even implement a function that make sure the
temporary file is removed.
Because it is two lines to write, so no one has yet proposed
it for the base library.
Map is 2 lines, but we have that as a
Hi,
I want to build GHC HEAD with the time package. I figured out how to do
it by editing packages and removing the word extralibs, but that doesn't
seem to be the correct way.
I suspected I might be able to get time included by giving some
incantation to ./darcs-all, but I couldn't figure out
Ah -- you used an *existential* there! Yes,
existentially-bound type variables are rigid. They stand for
themselves, as it were.
How should this be clarified?
I'd leave it. I wanted a simple set of rules stating _if_ you provide
the following type signatures your code _will_ compile,
Hi Claus,
For reference, I'm using cygwin bash+mingw gcc on Windows XP, following
your instructions as closely as possible - but with the latest version
of cygwin and mingw.
The biggest niggle for me currently is the lack of the GHC API, which is
built in stage2, but not transferred across to
* The ghc API package hasn't been installed. ghc-pkg list gives:
| Do you have this patch?:
Probably not, I've just pulled and am rebuilding.
Thanks
Neil
==
Please access the attached hyperlink for an important
-Original Message-
From: Ian Lynagh [mailto:[EMAIL PROTECTED]
Sent: 10 September 2008 1:14 pm
To: Mitchell, Neil
Cc: glasgow-haskell-users@haskell.org
Subject: Re: Windows build failure
On Wed, Sep 10, 2008 at 12:26:00PM +0100, Mitchell, Neil wrote:
* The ghc API package hasn't been
Hi Claus,
If I understand the implications correctly, one would need a three
point change to adapt properly:
- sign the setup.ini file with a key, in place
- put up a public key to check against, somewhere else
- point setup.exe to the location of the public key
Given that all we want are
Hi Claus,
I was reading your instructions on the GHC wiki page,
http://hackage.haskell.org/trac/ghc/wiki/Building/Windows, and they are
wonderful - exactly what I wanted. However, they don't work. When
downloading Cygwin you are told to add haskell.org/ghc/cygwin as a path
so it can pick up the
Hi,
Looking at:
http://www.haskell.org/ghc/dist/current/dist/
The latest Windows binary appears to be the 22nd of June, and thus is
before things such as the Control.Exception changes, and will not work
with the current version of Haddock. Is it possible to get an updated
binary?
From what I
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792&quo
63 matches
Mail list logo