RE: [Haskell-cafe] wxhaskell package for ubuntu feisty, amd64

2007-09-14 Thread José Miguel Vilaça
Hi Iván,

Try this:

* install GHC and darcs:
sudo apt-get install ghc6
sudo apt-get install darcs
* install WxWidgets 2.6
sudo apt-get install libwxgtk2.6-dev
sudo apt-get install freeglut3-dev
sudo apt-get install g++
* install wxHaskell
darcs get http://darcs.haskell.org/wxhaskell
cd wxhaskell
chmod u+x configure
./configure --with-opengl
make
sudo make install
make wx
sudo make wx-install
cd ..
* test wxhaskell with ghc
ghci -package wx

It's working in my laptop!

Best
Miguel

P.S. This link could be helpful:
http://wiki.loria.fr/wiki/GenI/Getting_GenI/Instructions_for_Ubuntu_Linux 

-Mensagem original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Em nome de Iván Pérez Domínguez
Enviada: sexta-feira, 14 de Setembro de 2007 11:36
Para: haskell-cafe@haskell.org
Assunto: [Haskell-cafe] wxhaskell package for ubuntu feisty, amd64

I'm trying to install wxhaskell in ubuntu feisty,  with ghc-6.6.

After several days of trial and error and a few hours trying to
change all types in my program to gtk2hs types, I'm tired.

Does anyone have a .deb for wxhaskell that works with ghc-6.6?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] compiler implementation details

2007-06-05 Thread José Miguel Vilaça
Hi,

 

I’m curious about how the Haskell compilers nowadays take care of a simple
function definition like append

 

append [] l = l

append (h:t) l = h: (append t l)

 

 

Do they take a rewriting way like

 

append [1,2] [3,4]   ==> 1: (append [2] [3,4])

 ==> 1: (2 : (append [] [3,4]) )

 ==> 1 : (2: [3,4])

 ==> [1,2,3,4]

 

Or do they converte the append definintion to some lambda-calculus flavour
language

 

append = Y (\f -> \l1 l2 -> case l1 of  

 [] -> l2

 (h:t) -> h: (f t l2))

 

And then apply this converted definition to the arguments?

 

Best

Miguel

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Module dependency graph generator

2007-05-18 Thread José Miguel Vilaça

Take a look to HaSlicer
(http://labdotnet.di.uminho.pt/HaSlicer/HaSlicer.aspx).
It can do that.

Best
Miguel Vilaça


-Mensagem original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Em nome de Alfonso Acosta
Enviada: sexta-feira, 18 de Maio de 2007 12:11
Para: Haskell-cafe
Assunto: [Haskell-cafe] Module dependency graph generator

Hi all,

I'm searching for a tool which generates a module dependency graph (a
graphviz backend would be more than enough).

Does anybody know a tool with such functionality?

Cheers,

Fons
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] built-in lists vs inductively defined list

2007-05-09 Thread José Miguel Vilaça
Hi again,

IMHO for what concerns to the language they only differ in syntax. They are
equal up to constructor names.

What could be the case is that some compiler could do some optimizations
that end up with better performance in time and space when using lists.
But for what people gently ask me, the optimizations are in the functions
over list and not in the data structure itself.

Do you know something about an implementation that does something about the
data structure itself?

Best
Miguel Vilaça


-Mensagem original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Em nome de Tomasz Zielonka
Enviada: quarta-feira, 9 de Maio de 2007 16:13
Para: Haskell Cafe
Assunto: Re: [Haskell-cafe] built-in lists vs inductively defined list

On Wed, May 09, 2007 at 04:11:40PM +0200, Nils Anders Danielsson wrote:
> On Wed, 09 May 2007, Stefan O'Rear <[EMAIL PROTECTED]> wrote:
> 
> > To the best of my knowledge, there are no optimizations specific to []
> > in the compiler proper.
> >
> > However, the standard library has a *lot* of speed hacks you will need
> > to duplicate!
> 
> Some of which are not expressible in "ordinary" Haskell (rewrite rules
> used for short-cut deforestation).

I just want to note that no particular compiler was named so far
in this thread and this is a very compiler specific area.

To OP: are you asking about the language or some particular
implementation?

Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] built-in lists vs inductively defined list

2007-05-09 Thread José Miguel Vilaça
Hi,

 

Can someone tell me if would be any difference (beside syntax) between the
built-in Haskell list with [] and : and lists given by a inductive datatype
definition like

 

data List a = Nil | Cons a (List a)

 

This is, is any of the compilers doing some special optimizations for the
built-in lists?

 

Best

Miguel Vilaça

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] outputing .hs file without comments

2007-05-03 Thread José Miguel Vilaça
Hi all,

 

Is there a simple tool or command to remove all comments from a Haskell
file, i.e. something that outputs the input file but without any comments on
it?

 

Best

Miguel Vilaça 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] What is the best way to understand large programs?

2007-01-29 Thread José Miguel Vilaça

Hi

> Some sort of module dependancy graph would also be handy, but I'm not
> sure any program can yet produce that kind of information.

Take a look to HaSlicer
(http://labdotnet.di.uminho.pt/HaSlicer/HaSlicer.aspx )

Currently it is only available online but if you want it to run locally in
your machine you can email the author and ask for the source code.

Best
Miguel Vilaça


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] type and class problems compiling code on GHC 6.6

2007-01-17 Thread José Miguel Vilaça
Dear Haskellers,

 

I had used some code which worked fine on GHC 6.4 and now it don’t compile
on GHC 6.6.

Can anyone please give me some workarounds and/or explanations about these 2
errors?

 

instance InfoKind a b => InfoKind (Maybe a) b where

blank = Nothing

check n _ Nothing  = ["No info value stored with "++n]

check n g (Just a) = check n g a

 

GHC complains that

Illegal instance declaration for `InfoKind (Maybe a) b'

(the Coverage Condition fails for one of the functional
dependencies)

In the instance declaration for `InfoKind (Maybe a) b'

 

 

multiListViewGetTSelections :: MultiListView x () -> IO [x]

multiListViewGetTSelections multiListView =

 do { Just ((model, _) :: (Var [x], x -> String)) <-
unsafeObjectGetClientData multiListView

; -- more and more code

}

 

GHC complains that

A pattern type signature cannot bind scoped type variables `x'

  unless the pattern has a rigid type context

In the pattern: (model, _) :: (Var [x], x -> String)

 

I would really appreciate some help.

 

Best regards

Miguel Vilaça

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] different code in different platforms

2006-03-15 Thread José Miguel Vilaça








Sorry. In the previous email I forgot the subject.

 

Hi

 

I’m having a small problem with the portability
of my Haskell code. My code uses wxHaskell and the library for which this one
is the Haskell interface (that is called wxWidgets) doesn’t work in the
same away in Windows and Linux.

 

Now I now which code run in Linux and in Windows but
I don’t want to have to manually change the file in each platform.

I tried a solution using the C pre-processor but I
getting in trouble.

 

I use code like:

 

#ifdef __WIN32__

    (Windows code)

#else

    (Linux code)

#endif

 

I also add the --cpp
to the ghc and it works for me in
Linux but give me linking errors in Windows.

 

Does someone have any hints on how to have different
code in Windows and Linux?

 

I would be thankful in some help.

 

Best regards

 

Miguel Vilaça

 






___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] (no subject)

2006-03-15 Thread José Miguel Vilaça








Hi

 

I’m having a small problem with the portability
of my Haskell code. My code uses wxHaskell and the library for which this one
is the Haskell interface (that is called wxWidgets) doesn’t work in the
same away in Windows and Linux.

 

Now I now which code run in Linux and in Windows but
I don’t want to have to manually change the file in each platform.

I tried a solution using the C pre-processor but I
getting in trouble.

 

I use code like:

 

#ifdef __WIN32__

    (Windows code)

#else

    (Linux code)

#endif

 

I also add the --cpp
to the ghc and it works for me in
Linux but give me linking errors in Windows.

 

Does someone have any hints on how to have different
code in Windows and Linux?

 

I would be thankful in some help.

 

Best regards

 

Miguel Vilaça






___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Intersection types for Haskell?

2006-01-10 Thread José Miguel Vilaça
Hi

If I understand your problem than the following is a solution:

--

{-# OPTIONS -fglasgow-exts #-}

class Foo a b where 
   g :: a -> b

type A = {- change the following -} Int
type B = {- change the following -} Char
   
instance Foo A B where
   g a = {- change the following -} ' '
   
type C = {- change the following -} Float
type D = {- change the following -} String

instance Foo C D where
   g c = {- change the following -} ""
  
 
f :: (Foo a b, Foo c d) => a -> c -> (b, d)  
f x y = (g x, g y)

-

Simply create a class an give instances for the wanted types.

The code above is also in a file in attachment.


cheers

José Miguel Vilaça 
Departamento de Informática - Universidade do Minho 
[EMAIL PROTECTED]

 
-Mensagem original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Em nome de Brian Hulley
Enviada: terça-feira, 10 de Janeiro de 2006 18:01
Para: Haskell-cafe
Assunto: [Haskell-cafe] Intersection types for Haskell?

Hi -
I'm wondering if there is any possiblility of getting intersection types 
into Haskell. For example, at the moment there is no (proper) typing for:

f g x y = (g x, g y)

Ideally, I'd like to be able to write:

f:: (a -> b & c -> d) -> a -> c -> (b,d)

or

f :: (a -> b a) -> c -> d -> (b c, b d)

which is perhaps clearer and prevents bad types such as (Int -> String & 
Int -> Char) by construction.

While it may be impossible (?) to infer such a type for f, would it be 
possible to make use of such an annotation (esp since Haskell with GHC 
extensions already has arbitary rank polymorphism)?

Also, as a second point, could functional dependencies in type classes be 
written using a similar syntax eg instead of

class Insert t c a | c a -> t where
insert :: t -> c a -> c a

we could write:

class Insert (h (c a)) c a where
insert :: h (c a) -> c a -> c a

or
class Insert t@(h (c a)) c a where   -- re-using as-pattern syntax
insert :: t -> c a -> c a

to avoid having to have a special syntax just for functional dependencies 
and/or to be able to write more complicated fundeps more succinctly?

Regards,
Brian Hulley 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


tep.hs
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe