[Haskell-cafe] lhaskell.vim syntax highlighting script

2004-07-29 Thread Andrew Pimlott
haskell-cafe, you are listed as the maintainer of the vim haskell syntax
highlighting script.  :-)

lhaskell.vim uses the tex.vim syntax script, which does "set
iskeyword-=_".  This makes editing haskell rather uncomfortable (eg, the
'*' command doesn't work right).  I don't know what breaks if you "set
iskeyword+=_", but getting tex highlighting right is less important than
haskell editing, so I suggest this patch.

Andrew

--- lhaskell.vim.orig   2004-07-29 16:48:39.0 -0700
+++ lhaskell.vim2004-07-29 16:50:16.0 -0700
@@ -86,6 +86,8 @@
runtime! syntax/tex.vim
unlet b:current_syntax
 endif
+" This messes up tex a bit, but is better for Haskell.
+set isk+=_
 endif
 
 " Literate Haskell is Haskell in between text, so at least read Haskell

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] optimising for vector units

2004-07-29 Thread Jan-Willem Maessen - Sun Labs East
Ronny Wichers Schreur wrote:
Jan-Willem Maessen writes (in the Haskell Cafe):
My ultimate goal was parallelization.  However, I'm now convinced it 
would take about 2-3 programmer-years more of effort to realize that 
goal.  Parallel garbage collection (which is *not* optional on a 
parallel Haskell implementation, as our experience with pH 
demonstrated) and very fine-grained thunk-update protocols are both 
tricky technical challenges.  And that leaves aside the question of 
whether there's enough coarse-grained work buried among all that 
fine-grained work to make it all worthwhile. 

I'm not sure how to interpret this. Will you also have solved
the granularity problem in these two to three years?
Probably not.  One might hope to do well by choosing an appropriate 
schedule (favor leaves locally, roots when work is moved between 
processors).  But there's no evidence generating the work lazily would 
even leave enough work to be done.

There's a difference between a system that would work (and probably 
work OK for 2-4 processors) and a system that would scale.  The latter 
would also require some hard thought by the application programmer, as 
well.

-Jan-Willem Maessen
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] why is Prelude.^ so convoluted?

2004-07-29 Thread Ronny Wichers Schreur
Brandon Beck wrote:
[..] I suspect the justification is because the version in the
prelude is tail recursive while yours isn't. 
It also performs fewer negativity and zero tests and it builds
fewer closures.
So the tail recursive version should run a bit faster when n
is large.
From the intro of the Haskell'98 prelude
:
   "It constitutes a specification for the Prelude. Many of the
definitions are written with clarity rather than efficiency
in mind"
The power function is not an example of this.
Cheers,
Ronny Wichers Schreur
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Typeclass problem

2004-07-29 Thread Mark T.B. Carroll
On Thu, 29 Jul 2004, Bjorn Bringert wrote:
(snip)
> You could use asTypeOf from the Prelude:
>
>   let foo = maxBound `asTypeOf` x

Ah. I should re-read the Prelude every couple of months. (-: Thanks!

> Also, Hugs and GHC both support an extension which lets you put type
> annotations in patterns:
>
> showThings (x::c) =
>   let foo = maxBound :: c
>in (show x, show foo)

That's cool. Is it something that's likely to be in the next standard,
then? Or does it make more sense to have the type variables in the
function's type signature be in scope in the function definition itself?

-- Mark
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Typeclass problem

2004-07-29 Thread Bjorn Bringert
Mark T.B. Carroll wrote:
I have a little programme that doesn't compile:
module Example where
class (Show c, Ord c, Bounded c) => MyClass c
showThings :: MyClass c => c -> (String, String)
showThings x =
let foo = maxBound :: c
 in (show x, show foo)
If I change that second-to-last line to,
let foo = max x maxBound
then it compiles. However, it's clearly silly to use "max" just to make
the type of the maxBound be the same type as the x. (I'm assuming that the
Ord and the Bounded instances of the type are sensibly consistent.)
What should I be writing if I want foo to be the maxBound applied to the
type that x is?
You could use asTypeOf from the Prelude:
 let foo = maxBound `asTypeOf` x
-- asTypeOf is a type-restricted version of const.  It is usually used
-- as an infix operator, and its typing forces its first argument
-- (which is usually overloaded) to have the same type as the second.
asTypeOf :: a -> a -> a
asTypeOf =  const
Also, Hugs and GHC both support an extension which lets you put type 
annotations in patterns:

showThings (x::c) =
let foo = maxBound :: c
 in (show x, show foo)
/Bjorn
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Typeclass problem

2004-07-29 Thread Mark T.B. Carroll
I have a little programme that doesn't compile:

module Example where

class (Show c, Ord c, Bounded c) => MyClass c

showThings :: MyClass c => c -> (String, String)

showThings x =
let foo = maxBound :: c
 in (show x, show foo)

If I change that second-to-last line to,

let foo = max x maxBound

then it compiles. However, it's clearly silly to use "max" just to make
the type of the maxBound be the same type as the x. (I'm assuming that the
Ord and the Bounded instances of the type are sensibly consistent.)

What should I be writing if I want foo to be the maxBound applied to the
type that x is?

-- Mark
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] why is Prelude.^ so convoluted?

2004-07-29 Thread Brandon Beck
I'm far from an expert in Haskell, but I suspect the justification is
because the version in the prelude is tail recursive while yours
isn't.  So the tail recursive version should run a bit faster when n
is large.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hello and help request

2004-07-29 Thread Graham Klyne
At 14:50 29/07/04 +0200, [EMAIL PROTECTED] wrote:
Are type classes different from Java classes? I think so, but I guess this
means that one should ask different things to type classes, respect to what
is being asked to Java classes.
It is this difference that's unclear to me.
I made some notes about this, but they're in no sense authoritative:
  http://www.ninebynine.org/Software/Learning-Haskell-Notes.html#type-class-misuse
There was also a little discussion of these notes, starting around:
  http://www.haskell.org//pipermail/haskell/2003-December/013269.html
and subsequently transferring to Haskell-cafe.  There was some discussion 
of classes and their relation to OO style, but that seems to have been 
off-list.  Some of the comments received have been added to my notes.

#g

Graham Klyne
For email:
http://www.ninebynine.org/#Contact
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hello and help request

2004-07-29 Thread enrico . santoemma
>To put it another way, they're closer to Java interfaces - though type
>classes are a more general idea, as demonstrated by the multi-parameter
>type classes supported by ghc et al. You can think of them as a predicate
>- "this type has implementations for these overloaded functions".

Ok, very clear.
This should mean that I must concentrate on data/newtype, right?
So, if I've understood well,  adds parameters (with pattern matching?)
and recursion to structure definition. Still right?

Enrico

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hello and help request

2004-07-29 Thread Philippa Cowderoy
On Thu, 29 Jul 2004, Henning Thielemann wrote:

>
> On Thu, 29 Jul 2004 [EMAIL PROTECTED] wrote:
>
> > I'm very fresh on Haskell. Exactly... chapter 13 of SOE :)
> > Are type classes different from Java classes?
>
> Type classes are a static issue. They are roughly speaking bundles of
> functions that can be overloaded.
>

To put it another way, they're closer to Java interfaces - though type
classes are a more general idea, as demonstrated by the multi-parameter
type classes supported by ghc et al. You can think of them as a predicate
- "this type has implementations for these overloaded functions".

-- 
[EMAIL PROTECTED]
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] why is Prelude.^ so convoluted?

2004-07-29 Thread blaetterrascheln
> x ^ n = if even n then y*y else y*y*x where y = x ^ (n `quot` 2)
x ^ n | n>0 = if even n then y*y else y*y*x where y = x ^ (n `quot` 2)


Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] why is Prelude.^ so convoluted?

2004-07-29 Thread blaetterrascheln
{-
(^):: (Num a, Integral b) => a -> b -> a
x ^ 0   = 1
x ^ n  | n > 0  = f x (n-1) x
  where f _ 0 y = y
f x n y = g x n where
  g x n | even n= g (x*x) (n`quot`2)
| otherwise = f x (n-1) (x*y)
_ ^ _   = error "Prelude.^: negative exponent"
-}

-- Is
(^):: (Num a, Integral b) => a -> b -> a
x ^ 0 = 1
x ^ n = if even n then y*y else y*y*x where y = x ^ (n `quot` 2)
_ ^ _ = error "negative exponent"
-- not good enough?


Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hello and help request

2004-07-29 Thread Henning Thielemann

On Thu, 29 Jul 2004 [EMAIL PROTECTED] wrote:

> I'm very fresh on Haskell. Exactly... chapter 13 of SOE :)
> Are type classes different from Java classes?

Type classes are a static issue. They are roughly speaking bundles of
functions that can be overloaded.


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] not getting most general type - is this a bug in hugs?

2004-07-29 Thread Andreas Rossberg
[EMAIL PROTECTED] wrote:
rep0' :: [Integer]-- WHAT??
You just have made first contact with the Dreaded Monorphism Restriction.
--
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of those possible thingies!  -- TB
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] not getting most general type - is this a bug in hugs?

2004-07-29 Thread blaetterrascheln
$ cat x.hs
rep0 :: Num a => [a]
rep0 = repeat 0
rep0' = repeat 0
$ hugs x.hs
...
Main> :t rep0
rep0 :: Num a => [a]
Main> :t repeat 0
repeat 0 :: Num a => [a]
Main> :t rep0'
rep0' :: [Integer]-- WHAT??
Main> :version
-- Hugs Version Nov 2002


Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Hello and help request

2004-07-29 Thread enrico . santoemma
Hello to everyone :)
My name is Enrico, 40, and I write software for the industry at Beta 80
Group.

After this short introduction, here is the help request:
I'm managing the rewrite of an application, to port it to the 'classic'
Java three-tiers architecture.
Before I begin to feed the team, I want to see a fully functional prototype
of the problem. I mean the app's functions, not the graphic. What I imagine
is a data base of types and groups of functions. The idea is to study the
problem, inject new functions while checking their coerence with the existing
type infrastructure, and so on.

In plain Java, I'd have wrote the Business Idea in informal language, extracted
the types from it, assigned methods to types and then glued things together
in some way.
In Haskell I (should) have the opportunity to stay on the problem, decomposing
it into sub-problems until I come to the soil.
What I ask to this list is if and where Haskell is different from the object
oriented way to decompose the problem.

I'm very fresh on Haskell. Exactly... chapter 13 of SOE :)
Are type classes different from Java classes? I think so, but I guess this
means that one should ask different things to type classes, respect to what
is being asked to Java classes.
It is this difference that's unclear to me.

Any help would be very appreciated
Enrico

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] optimising for vector units

2004-07-29 Thread Ronny Wichers Schreur
Jan-Willem Maessen writes (in the Haskell Cafe):
My ultimate goal was parallelization.  However, I'm now convinced it 
would take about 2-3 programmer-years more of effort to realize that 
goal.  Parallel garbage collection (which is *not* optional on a 
parallel Haskell implementation, as our experience with pH demonstrated) 
and very fine-grained thunk-update protocols are both tricky technical 
challenges.  And that leaves aside the question of whether there's 
enough coarse-grained work buried among all that fine-grained work to 
make it all worthwhile. 
I'm not sure how to interpret this. Will you also have solved
the granularity problem in these two to three years?
Cheers,
Ronny Wichers Schreur
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] What versions do I need to compile the fptools?

2004-07-29 Thread Ron de Bruijn
I want to compile all of the fptools. This is what I
did:

I got all files via CVS. And I did 
autoreconf
./configure
make

But with the make step gcc crashes with an internal
error on Syntax.hi. I already filled in a bug report
(not the most clear of them).  I especially installed
an "old" version of gcc (3.3.3)(I had gcc 3.4.1-2) to
be able to compile the C Macro's correctly. 

For the Haskell compilation I used ghc-6.2.1.
I think there is somewhere somebody that can compile
it, but I need the *exact* versions of the software
needed to do it. 

Is there anyone that *can* compile all of the fptools
successfully?

Regards, 
  Ron






__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe