College Student

2002-03-08 Thread mary lee


To : Mr. Frank A.
Chrishtoph<[EMAIL PROTECTED]>

I am recently doing my assignment on Haskell at my
college.  I am just new on Haskell programming. I
would like to request if you can teach me for just few
programming rules on Haskell.  It is my most
appreciation to learn from you.

My assignment title is INTERNATIONAL AIRLINES SYSTEM.

May i know how to open file, put record entry and just
read it from its database.  How to do a simple input
and output for acquire user options using functional
programming.  It is very important for me to learn
Haskell in a proper way.  It will lead me to write a
good documentation.  A good understanding on
programming is good.  I am good in Visual Basic,
Pascal, Cobol, C++ and also JAVA.  But facing
functional programming is a real problem for me.  

Now i have doing a simple Haskell programming on the
way.  I just know how to import file, declare types
and display output.

Your help and guidelines is most appreciated.

From,
Lee Ling Ling


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



HGL ang GHC on Win32

2002-03-08 Thread Hal Daume III

When I compile a program using GHC 5.02.2 on Windows 200 using HGL, using
the following command line:

> ghc --make HelloWorld.hs -o HelloWorld.exe -package concurrent -package
win32 -ic:\GraphicsLibrary\lib\win32

it compiles fine, but then when I run the exe, the window starts out
initially as wide as my screen and only as tall as the title bar,
regardless of what is passed as the dimensions to openWindow.  What
gives?  If I resize the window everything works fine, but in my own
application resizing the window causes it to report some error about
arithmetic being bigger than 32 bits...

Any ideas?


 - Hal

--
Hal Daume III

 "Computer science is no more about computers| [EMAIL PROTECTED]
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume

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



RE: first-class polymorphism beats rank-2 polymorphism

2002-03-08 Thread Ralf . Laemmel

Simon Peyton-Jones wrote:

> In fact GHC does "forall-lifting" on type signatures to bring the
> foralls to the front.  But there's a bug in 5.02's forall-lifting...
> ...
> Perhaps you can try the 5.03 snapshot release?

Certain things work there.
In fact, it is fascinating.

But now I did a new experiment ... 
It seems that forall-lifting does not work 
as expected for type synonyms in 5.03.

Here is an example
from my upcoming ICFP submission :-)

Here is an innocent type synonym for generic 
functions with three parameters of kind * -> *:

type Generic i o m = forall x. i x -> m (o x)

This is a good candidate for all the parameters:

type Id x = x

Now I tried to define sequential composition.
In fact, the following type deals with a very
restricted case for simplicity:

sequ :: forall t.
(Generic t t Id)
 -> (Generic t t Id)   
 -> (Generic t t Id)   
sequ f g = undefined

Looking at the type of sequ,
the foralls for t end up at the top.
Hence, I have no chance to define sequential
composition.

Main> :t sequ
forall t x1 x11 x.
(t x1 -> Id (t x1)) -> (t x11 -> Id (t x11)) -> t x -> Id (t x)
Main>

Please let me know if this is a bug.
Please don't fix it too soon :-) because otherwise
I had to rewrite some material which is now based
on first-class polymorphism and datatypes for i, o, and m.
Such code will probably look better in proper rank-2
style with type synonyms for type constructor parameters.

I just realized that type synonyms in GHC seem to be valid
arguments even when not completely instantiated? This is
wonderful. It is not supported in hugs. How difficult is
it to cope with this? Does it make a real difference for the
type system?

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



[E-CFP] WFLP2002 - deadline is approaching

2002-03-08 Thread Marco Comini
Title: [E-CFP] WFLP2002 - deadline is
approaching


Dear Colleague

I would like to remind you that the WFLP 2002 paper submission
deadline is
approaching.  WFLP 2002 is the 11th
international workshop on functional and (constraint) logic
programming.  WFLP 2002 aims to bring together researchers
interested in functional programming, (constraint) logic programming,
as well as their integration.  For further details about the
workshop please visit the web site
http://www.dimi.uniud.it/~wflp2002/

Papers are due by March 20,
2002

You can sumbit papers following the electronic sumbission process
at:

http://www.dimi.uniud.it/~wflp2002/submit/

We hope  that this  "Call For  Papers"
will be  useful for  your work.
Please  forward  the  following  to 
anybody  who  you  think  may  be
interested.  Our apologies if you received multiple copy of
this.
-- 

Marco.



Re: pattern-matching with labelled types

2002-03-08 Thread Jorge Adriano

On Friday 08 March 2002 01:52, you wrote:
> Andre W B Furtado writes:
>  | Of course, it is possible to do something like
>  |
>  | > update :: MyType -> Int -> MyType
>  | > update mt newValue = MT {x = newValue, y = oldValue}
>  | > where oldValue = y mt
>  |
>  | but this really annoys me when MyType has too many fields. Suggestions?
>
> update mt newValue = mt {x = newValue}

Since we are on the subject, I have some questions about labeled datatypes 
updates.
You can in deed update like that "mt {x = newValue}", but whenever I use 
labeled datatypes I always end up with Andres problem, having to define not 
only an 'update' function but also an 'apply' function for every field.
I need them becouse I want to pass them as arguments to other funtions.

This happens to me all the time, but one very good example IMO is having a 
STRef to a labeled data type. Now you want to update some field and you want 
to to be able to use,
modifySTRef (updField1 3)
or
modifySTRef (appField1 (+1))

It would be extremely usefull IMO to have not only field projection funtions, 
but also apply and update funtions. That, and not beeing possible to specify 
contexts partialy, makes it particulary complicated for me to follow John 
Hughes strategy to simulate global variables in haskell 
(http://www.cs.chalmers.se/~rjmh/Globals.ps)

J.A.
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



RE: rank-n polymorphism

2002-03-08 Thread Simon Peyton-Jones

Mark Shields and I are writing a paper.  The technical
basis is in "Putting type annotations to work" Odersky/Laufer,
POPL'96.

Simon

| -Original Message-
| From: Artem S Alimarine [mailto:[EMAIL PROTECTED]] 
| Sent: 07 March 2002 16:27
| To: [EMAIL PROTECTED]
| Subject: rank-n polymorphism
| 
| 
| Dear all,
| 
| GHC 5.0.3 supports  rank-n polymorphism.
| Could anyone please point me to a paper that describes type 
| inference algorithm used.
| 
| Thanks in advance
| Artem Alimarine
| 
| ___
| Haskell mailing list
| [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
| 

<>

RE: first-class polymorphism beats rank-2 polymorphism

2002-03-08 Thread Simon Peyton-Jones

| So I would claim that these two types are the same:
| 
|   forall x. Class x => (forall y. Class y => y -> y) -> x -> x
|   (forall y. Class y => y -> y) -> (forall x. Class x => x -> x)
| 
| ...so you should be able to do this:
| 
|   combinator :: (forall y. Class y => y -> y) -> (forall x. 
| Class x => x  -> x)
|   combinator f x = combinator' f x
| 
| but for some reason GHC 5.02.2 complains. I think this is a bug. 

Indeed the two types are the same.  In fact GHC does "forall-lifting"
on type signatures to bring the foralls to the front.  But there's a bug
in 5.02's forall-lifting... it doesn't bring the constraints to the
front too.

I fixed this in 5.03 a while ago, but didn't back-propagate the fix to 
5.02.  And indeed, 5.03 is happy with the pure rank-2 program.

class Class x where
 combinator' :: (forall y. Class y => y -> y) -> x -> x

combinator :: (forall y. Class y => y -> y)
   -> (forall x. Class x => x -> x)
combinator f = combinator' f


It's quite a bit of extra work propagating fixes into the 5.02 branch,
so I probably won't do so for this one, since only a small minority
of people will trip over it.   Perhaps you can try the 5.03 snapshot
release?

Simon

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



Re: rank-n polymorphism

2002-03-08 Thread Ronny Wichers Schreur

Artem Alimarine asks:

>GHC 5.0.3 supports  rank-n polymorphism.
>Could anyone please point me to a paper that describes type inference
>algorithm used.

"Putting Type Annotations To Work", Martin Odersky and Konstantin Läufer.
In Proceedings, 23rd ACM Symposium on Principles of Programming Languages,
St. Petersburg, Florida, January 1996. 

Available from .



Cheers,

Ronny Wichers Schreur

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