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
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]
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
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:
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 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 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
39 matches
Mail list logo