On Wed, 12 Dec 2007, Bill Wood wrote:
On Wed, 2007-12-12 at 11:19 +, Andrew Coppin wrote:
. . .
...and normal programmers care about the Fibonacci numbers because...?
Seriously, there are many, many programmers who don't even know what
Fibonacci numbers *are*. And even I can't
On Fri, 14 Dec 2007, Henning Thielemann wrote:
Worst case analysis of AVL trees also leads to Fibonacci numbers, as far
as I remember.
The number of possibilities to arrange bricks of a certain width is also
Fibonacci number. In general I think that Fibonacci numbers serve as
simple
On Wed, 12 Dec 2007, Don Stewart wrote:
ndmitchell:
A much simpler version:
main = print . length . words = getContents
Beautiful, specification orientated, composed of abstract components.
My thoughts too when reading the initial post was that it was all very
low level
Evan Laforge wrote:
it seems that script may be not terminated if its output isn't read, so
better code should be
(_, h, g, _) - runInteractiveCommand script params
result - hGetLine h
hGetContents h = evaluate.length
hGetContents g = evaluate.length
Tangent here, but does anyone else think
Hello Jules,
Friday, December 14, 2007, 12:21:30 PM, you wrote:
PS we could give it a nice sensible name like hGetContents. We could
renaming the existing hGetContents to
hUnsafeGetContentsDontUseThisUnlessYouHaveSpentThreeMonthsLearningGHCsExecutionSemanticsOrYouWillRegretIt
i have more
Hi all,
I'm working on a type-based side effect analysis for a Haskell-like
language, and need to test it against some more higher order functions.
The situation is a bit icky because it uses bounded quantification
and various related issues (ie covariance vs contravariance) only
come into play
Dan Weston wrote:
apfelmus wrote:
Luke Palmer wrote:
Isn't a type which is both a Monad and a Comonad just Identity?
(I'm actually not sure, I'm just conjecting)
Good idea, but it's not the case.
data L a = One a | Cons a (L a) -- non-empty list
Maybe I can entice you to elaborate
Maurício wrote:
I see in the documentation and in many
messages in this list that, if you want
multithreading in your program, you
need to use -threaded in ghc.
Concurrency is supported just fine without -threaded. You need -threaded
if you want to:
1) make foreign calls that do not
Hi
Hi. Sorry, I should have put the question differently -- is there
sometimes a need to escape hoogle input (i.e. so I could confirm there
were no results, rather than getting an error)?
The only one I'm aware of is that searching for any operator such as
(+) needs to be done without
Simon Marlow [EMAIL PROTECTED] writes:
Concurrency is supported just fine without -threaded. You need
-threaded if you want to:
:
3) write a multithreaded Haskell library or DLL
I thought -threaded (A.K.A. -smp, no?) only affected which runtime was
used, and thus was a linking option. I
Ben Lippmeier wrote:
I vaguely remember a paper called something like Is there any use
for a seventh order function?, but I forget why they were used, and
I can't find it on Google, or ACM or any of the other likely places.
Does anyone have any examples of code (in whatever language) which
I'd like to define several instances of the same type class with the
same type variable instance. Only method instances differ. How can I do
this without writing copies of the type class?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Dec 14, 2007 12:14 AM, Duncan Coutts [EMAIL PROTECTED] wrote:
On Mon, 2007-11-26 at 22:48 +, Magnus Therning wrote:
I've followed the instructions at [1] to create a .deb of vty[2]. It
seems the helper scripts for Debian passes `--enable-split-obj' when
running `./Setup.lhs
Hi
http://haskell.org/hoogle/?q=typeOf
C:\ghci
GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude :m Data.Typeable
Prelude Data.Typeable typeOf neil
[Char]
Another great thing is that this bit also works in Hugs, while the
Peter Padawitz wrote:
I'd like to define several instances of the same type class with the
same type variable instance. Only method instances differ. How can I do
this without writing copies of the type class?
newtypes and modules have both been suggested.
I have another suggestion:
Don't!
Ketil Malde wrote:
Simon Marlow [EMAIL PROTECTED] writes:
Concurrency is supported just fine without -threaded. You need
-threaded if you want to:
:
3) write a multithreaded Haskell library or DLL
I thought -threaded (A.K.A. -smp, no?) only affected which runtime was
used, and thus was
I've been learning/playing with Data.Generics a bit, and have a how-to
question...
If I say
dataTypeOf
then I get
DataType {tycon = Prelude.[], datarep = AlgRep [[],(:)]}
No surprises there. But I'd really like to know that I have a String,
or [Char]. How do I get the name of the concrete
Lutz Donnerhacke [EMAIL PROTECTED] writes:
* Peter Padawitz wrote:
I'd like to define several instances of the same type class with the
same type variable instance. Only method instances differ. How can I do
this without writing copies of the type class?
Define the type class in a module
On 14/12/2007, Neil Mitchell [EMAIL PROTECTED] wrote:
http://haskell.org/hoogle/?q=typeOf
Another great thing is that this bit also works in Hugs, while the
Data.Generics stuff is GHC only.
Great, thanks. Didn't occur to me to look further up the class hierarchy :-)
Alistair
Hi Alistair,
http://haskell.org/hoogle/?q=typeOf
C:\ghci
GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude :m Data.Typeable
Prelude Data.Typeable typeOf neil
[Char]
Thanks
Neil
On 12/14/07, Alistair Bayley [EMAIL PROTECTED]
* Peter Padawitz wrote:
I'd like to define several instances of the same type class with the
same type variable instance. Only method instances differ. How can I do
this without writing copies of the type class?
Define the type class in a module named MyClass. Define the each instance
in a
I have just successfully built Gtk2Hs against the native Mac OS X port
of Gtk at:
http://developer.imendio.com/projects/gtk-macosx
This implies we can now use Gtk2Hs on the Mac without X11. The sample
apps still look rather alien compared to normal Mac apps, but they are
a big
While trying to make Regex.TDFA 0.91 install on 6.8.2
I got
[10 of 21] Compiling Text.Regex.TDFA.RunMutState (
Text/Regex/TDFA/RunMutState.\
hs, dist\build/Text/Regex/TDFA/RunMutState.o )
Text/Regex/TDFA/RunMutState.hs:601:9:
Constructor `STUArray' should have 4 arguments, but has been
Here at Haskell.org we know you have a choice in programming languages,
and a choice in evaluation strategies.
To help make your decision easier, I'm pleased to announce an update to
the 'strict' package providing strict file IO for Strings.
You can now choose when and where to evaluate your
On Dec 14, 2007 5:14 AM, Jules Bean [EMAIL PROTECTED] wrote:
There are two standard ways to decompose a monad into two adjoint
functors: the Kleisli decomposition and the Eilenberg-Moore decomposition.
However, neither of these categories is a subcategory of Hask in an
obvious way, so I
I just tried HDBC-ODBC on 6.8.2, but it still crashes. Works on 6.6.1.
thomas.
Thomas Hartman [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
11/19/2007 12:05 PM
To
haskell-cafe@haskell.org
cc
Subject
[Haskell-cafe] HDBC-ODBC crashes on ghc 6.8
This minimal program below fails
On 14 Dec 2007, [EMAIL PROTECTED] wrote:
but I got stuck fixing it because the array documentation isn't there
http://www.haskell.org/ghc/docs/latest/html/libraries/haskell98/Array.html
Try the hierarchical library docs:
I'm working through the interesting paper Data type à la carte and
am confused by the Functor instance for Val. I think this stems from
some confusion of mine regarding the Functor class in general.
The Functor instance I'm confused about is:
instance Functor Val where
fmap f (Val x )
Hello Happy Haskellers,
I had to abandon improving my newbie Haskell skills the past weeks; I was
busy creating a new startup company and finalizing financial funding for a
cool project related to realtime 2D/3D animation and games.
As I'm the CTO of this new company, and since I kinda
On Dec 14, 2007 11:44 AM, Corey O'Connor [EMAIL PROTECTED] wrote:
I'm working through the interesting paper Data type à la carte and
am confused by the Functor instance for Val. I think this stems from
some confusion of mine regarding the Functor class in general.
I'll try to explain, but I
Many people have written words to the effect that the #haskell IRC
channel is just bursting with helpful Haskellers who are endlessly
friendly and seemingly able to help solve any problem. Personally, this
has never been my experience. (More like there's 300 people idling and
nobody ever
Hi Corey,
On Dec 14, 2007 8:44 PM, Corey O'Connor [EMAIL PROTECTED] wrote:
The reason I find all this odd is because I'm not sure how the type
class Functor relates to the category theory concept of a functor. How
does declaring a type constructor to be an instance of the Functor
class relate
On Dec 14, 2007 12:12 PM, Andrew Coppin [EMAIL PROTECTED] wrote:
Today, with a few import statements and compiler switches, the
exact same code takes 0.05 seconds. Tomorrow, who knows? Maybe I'm being
overly optimistic, but... ;-)
There have been some great improvements in array handling
On Dec 14, 2007 6:37 PM, Benja Fallenstein [EMAIL PROTECTED] wrote:
such that the following two properties hold:
* F(idX) = idF(X) for every object X in C
* F(g . f) = F(g) . F(f) for all morphisms f:X - Y and g:Y - Z.
Should we write
instance Functor Val where
fmap = undefined
Hello Andrew,
Friday, December 14, 2007, 11:12:18 PM, you wrote:
So it seems even with ByteStrings and stream fusion, we're still 10x
slower than naive C. :-( You can console yourself that maybe 5
in the ByteString paper and in Parallel Arrays paper you can find that
difference between
Hello Dan,
Friday, December 14, 2007, 11:57:38 PM, you wrote:
to allocate registers do exist. So I'm looking forward to the next
version of GHC matching C's performance for inner loops of array
manipulation code :-)
with support of loop unrolling, smart register allocation, strength
reducing
On Dec 15, 2007 12:00 AM, David Menendez [EMAIL PROTECTED] wrote:
These can (and, if Val is a newtype, will) be compiled to the same code, but
they don't have the same type. In particular, there is no way to unify a -
a with f a - f b for any f.
Thanks for noticing that! I hadn't seen before
On 12/14/07, David Menendez [EMAIL PROTECTED] wrote:
And yes, I'm pretty sure that's the only possible implementation for that
type which satisfies the functor laws.
Lets just prove it, then; I'm pretty sure it comes pretty easily from the
free theorem for the type of fmap.
data Val a =
On Dec 15, 2007 3:44 AM, Benja Fallenstein [EMAIL PROTECTED] wrote:
Hmmm. Something about that ticks off my don't play fast and loose
with bottom detector.
I should add that I do think you're correct if you ignore the
existence of bottom, and I'm pretty sure that you're correct if you
allow
On Dec 14, 2007 10:38 AM, Bulat Ziganshin [EMAIL PROTECTED] wrote:
hUnsafeGetContentsDontUseThisUnlessYouHaveSpentThreeMonthsLearningGHCsExecutionSemanticsOrYouWillRegretIt
i have more advanced proposal - we should include in its name whole
paper on its semantics so anyone using it will be
On Dec 14, 2007 9:29 AM, Henning Thielemann
[EMAIL PROTECTED] wrote:
I remember there was a discussion about how to implement full 'wc' in an
elegant but maximally lazy form, that is counting bytes, words and lines
in one go. Did someone have a nice idea of how to compose the three
counters
On 12/14/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Well anyway, a few years ago we didn't have fusion,
This is not true. Shortcut deforestation (fusion) has been in GHC for
at least fourteen years:
http://citeseer.ist.psu.edu/gill93short.html
It's true that we didn't have stream fusion a few
On 12/14/07, Bulat Ziganshin [EMAIL PROTECTED] wrote:
Hello Dan,
Friday, December 14, 2007, 11:57:38 PM, you wrote:
to allocate registers do exist. So I'm looking forward to the next
version of GHC matching C's performance for inner loops of array
manipulation code :-)
with support of
On 12/14/07, Dan Piponi [EMAIL PROTECTED] wrote:
There have been some great improvements in array handling recently. I
decided to have a look at the assembly language generated by some
simple array manipulation code and understand why C is at least twice
as fast as ghc 6.8.1. One the one hand
On Dec 14, 2007 9:44 PM, Benja Fallenstein [EMAIL PROTECTED]
wrote:
data Val a = Val Int
instance Functor Val where
fmap f (Val x) = f `seq` Val x
Ah, good old seq. How I loathe it.
Seriously, though, good catch. I always forget about seq when I'm doing
stuff like this.
--
Dave
Hello Tim,
Saturday, December 15, 2007, 7:10:26 AM, you wrote:
with support of loop unrolling,
GHC calls this inlining.
1. loop unrolling means generating several iterations of loop body,
so that, say, 100 iterations of *p++=*q++ becomes 25 iterations of
*p++=*q++; *p++=*q++; *p++=*q++;
46 matches
Mail list logo