Jose Emilio Labra Gayo | 11 Feb 2003 20:19
Picon

Disjoint type classes

I have a large program where I would like to include disjoint type classes
into a new type class.

My problem can be reduced to the following example (taken from [1]):

> class Num a => Dividable a
>   where dividedBy :: a -> a -> a

> instance Fractional a => Dividable a where
> dividedBy = (/)

> instance Integral a => Dividable a where
>   dividedBy = div

Which doesn't work because Haskell doesn't detect that
"Integral" and "Fractional" are disjoint.

Is there a way to implement these type classes with current Haskell
implementations?

[1] K. Glynn, M. Sulzmann,  P.J. Stuckey
    Type Classes and Constraint Handling Rules
    http://www.cs.mu.oz.au/tr_submit/test/cover_db/mu_TR_2000_7.html

Best regards, Jose Labra

Samuel E. Moelius III | 11 Feb 2003 20:32
Picon

Re: beginner's questions - fix f

> Function fix is a so-called fixpoint operator. Theory says that you can
> formulate any computable function using only non-recursive definitions
> plus fix.

Could someone point me toward a proof of this?

Furthermore, can any computable function be expressed in this form:

fix u

where u is some non-recursive term?

Sam Moelius

International Symposium on Information and Communication Technologies

This is a one time only posting. Apologies if you receive unwanted or
multiple copies of this message.

               Call for Workshops / Call for Papers

         ISICT 03  International Symposium on Information 
                and Communication Technologies

                  Trinity College Dublin, Ireland
                       September 24-26, 2003

The purpose of ISICT 03 is to provide an international forum for
discussion between theoreticians and practitioners and to promote an
inter disciplinary exchange of research ideas. We invite papers
exploring all aspects of Computer and Communication
Technologies. Topics of interest include, but are not limited to:

       *   Computer Science 
       *   Information Technology and Systems 
       *   Communication Technology 
       *   Networks, Control Systems 
       *   Image, Acoustic, Speech and Signal Processing 
       *   Experience and Applications 

     There are two principal modes of paper submission: 

          MODE I : Invited Workshop Organization

To chair and organize a workshop at ISICT03 send an email to
workshops <at> isict.org with the title, a description of the topic of your
(Continue reading)

Richard Uhtenwoldt | 2 Feb 2003 15:46
Picon

ANNOUNCE: Helium, for learning Haskell

Instructions for installing Helium 1.0 on Debian GNU/Linux.
I'm on version 3.0 of Debian, a.k.a, Woody. 
I'm just a user of, not an expert on Debian.

    1. apt-get install ghc5 libreadline4 libreadline4-dev
       # Optionally, get some documentation for GHC; libsrc is source code
       # for the libraries, which are useful documentation:
       apt-get install ghc5-doc ghc5-libsrc 
    2. Download and unpack helium.tar.gz (640Kb)
    3. cd lvm/src
       ./configure
       cd ../..
       cd heliumNT
       ./configure
       cd src
       make depend
       make
       # Now, become root somehow.
       make install
    4. Add the following lines to your ~/.profile file:
       export TEMP=/tmp
       export LVMPATH=/usr/local/helium/lib
       PATH="/usr/local/bin:$PATH"
    5. Test the installation as follows:
       # To put into effect the changes to your ~/.profile, start a new
       # shell or issue the following command in an existing shell:
       exec bash --login
       cd /usr/local/helium/demo
       helium Calendar.hs
       lvmrun Calendar.lvm
(Continue reading)

Simon Peyton-Jones | 3 Feb 2003 11:06
Picon
Favicon
Gravatar

RE: time since the epoch


| the haskell 98 time library is horribly broken, if you are using ghc,
| you can deconstruct the time constructor which has an Integer
containing
| the number of seconds since epoch... otherwise you can use
| 
...
| I dont supose this could be considered a typo in the haskell 98
report?
| it is an embarasing thing for a language to not be able to do...

Alas, no.  CUP is, even as I type, printing the Haskell 98 Report.

We'll have to think about how to accumulate further bugs/suggestions for
H98.

Meanwhile, I suspect there's an opportunity for someone (or a small
group) to suggest a new Time library that really does the business, and
provide an implementation.  If it's sufficiently persuasive, all the
implementations will adopt it and it can become a de-facto standard.
The implementation is important because Time is a weird enough thing
that only an expert can implement the spec!  

I think the current Time library suffered because no one who Really
Cared about time was involved in its design or implementation.

Simon
Andres Loeh | 3 Feb 2003 13:56
Picon

Re: ANNOUNCE: Helium, for learning Haskell

> Unfortunately, readline history and line-editing commands
> do not work at the /usr/local/bin/hi prompt.  
> One would think they would because before I had readline-dev installed
> Helium refused to build.  Oh well!

This can hopefully be fixed by applying the simple patch that I
have attached.

Directly after unpacking the .tar.gz archive, say

  patch -p0 < helium-1.0-readline.patch

I have not thoroughly tested it, but it should work ...

Best,
  Andres

diff -Naur helium-1.0.old/heliumNT/src/Makefile.in helium-1.0/heliumNT/src/Makefile.in
--- helium-1.0.old/heliumNT/src/Makefile.in	2003-01-21 16:06:01.000000000 +0000
+++ helium-1.0/heliumNT/src/Makefile.in	2003-02-03 12:37:54.000000000 +0000
 <at>  <at>  -181,7 +181,7  <at>  <at> 

 hi: interpreter/Main.hs utils/OSSpecific.hs
 	# GHC HeliumInterpreter
-	$(HC) --make -iutils -o $(HELIUMBINDIR)/hi$(EXE) interpreter/Main.hs 
+	$(HC) --make -package util -iutils -o $(HELIUMBINDIR)/hi$(EXE) interpreter/Main.hs 
 	$(STRIP) $(HELIUMBINDIR)/hi$(EXE)

(Continue reading)

Johan Jeuring | 3 Feb 2003 16:30
Picon

Haskell Workshop 2003

               ACM SIGPLAN 2003 Haskell Workshop
              Uppsala, Sweden, End of August 2003
                       pending approval

http://www.functional-programming.org/HaskellWorkshop/cfp03.html

                      Call For Papers

The Haskell Workshop forms part of the PLI 2003 colloquium on Principles,
Logics, and Implementations of high-level programming languages, which
comprises the ICFP and PPDP conferences as well as associated
workshops.  Previous Haskell Workshops have been held in La Jolla (1995),
Amsterdam (1997), Paris (1999), Montreal (2000), Firenze (2001), and
Pittsburgh (2002).

*********************         Deadlines         *********************

Deadline for submission:    May 22, 2003
Notification of acceptance: June 23, 2003
Final submission due:       July 3, 2003
Haskell Workshop:           End of August 2003

*********************         Topics            *********************

The purpose of the Haskell Workshop is to discuss experience with 
Haskell,
and possible future developments for the language.  The scope of the
workshop includes all aspects of the design, semantics, theory, 
application,
implementation, and teaching of Haskell.  Topics of interest include, but
(Continue reading)

George Russell | 3 Feb 2003 18:18
Picon
Favicon

RE: time since the epoch

Simon PJ wrote (snipped)
> Meanwhile, I suspect there's an opportunity for someone (or a small
> group) to suggest a new Time library that really does the business, and
> provide an implementation.  If it's sufficiently persuasive, all the
> implementations will adopt it and it can become a de-facto standard.
I already have written a TimeExts library which is in fact bundled with GHC,
namely in -package lang.  What I ought to do, I
suppose, is fishify the comments so Haddock can produce something useful.

Basically it allows you to add a time difference to a ClockTime value to
get another ClockTime value, or subtract two ClockTime values to get a time
difference.  The time difference can be a number of picoseconds, seconds,
minutes, hours, days, months or years.

For all but seconds and picoseconds, it does this by converting to CalendarTime
(using toUTCTime), doing complicated Gregorian calendar calculations (I am
not proud of the code here), and then converting back using toClockTime.
This is probably not a very good way of doing it but at least no-one has
complained about it so far.  Which means either it's perfect or no-one uses
it, I fear the latter.

At least it might be a good idea to start with something like this code,
rather than reinventing the wheel.

Things you need to watch out for are (a) leap seconds; (b) time zones.
I didn't really address the time zone problem, instead doing everything in
UTC.  For us Europeans, it doesn't normally make any difference whether
you use local or UTC time when you ask for the date one month from now.
Hal Daume III | 4 Feb 2003 01:01
Picon
Favicon

[OT] Teaching Haskell in High School

Hi all,

Before getting in to this, let me preface my question(s) with a note that
I have checked through the Haskell in Education web page and have found
various links off there of interest (and I've googled, etc.  In
short: I've done my homework).

That said, I've been in rather close correspondence with my math/computer
science teacher from high school.  When I first took CS there, they taught
Pascal (a year early they had been teaching Scheme).  They switched over
to VB (alas) recently and have been teaching that for a few years now.

The teacher really wants to get away from VB, but is having a somewhat
difficult time deciding what to go to.  The two most promising options are
Haskell and Java.

Aside from hype, etc., the primary advantage to Java is that the Advanced
Placement (AP) tests are in Java.  For those of you unfamiliar with these,
high school students can take AP tests and then (typically) skip out of
first semester college courses.  They're essentially proficiency exams.

The way the computer science curriculum is set up at my old school is
essentially as either (a) an elective or (b) a replacement for senior year
math.  The students in the course are usually about 2/3 juniors (16 year
olds) taking it as an elective and 1/3 seniors who want to get our of
senior year math :).  Either way, they've both taken differential
calculus, algebra, etc.  Note, however, that high school math in the
states is very rudimentary when it comes to things like "induction" and
"proofs" and things of this sort.

(Continue reading)

Wolfgang Jeltsch | 4 Feb 2003 03:03

Re: [OT] Teaching Haskell in High School

On Tuesday, 2003-02-04, 01:01, CET, Hal Daume wrote:
> [...]

> However, I'm also well aware that Haskell is very difficult to learn (and,
> I'd imagine, to teach).

Hi,

I wouldn't claim that Haskell is very difficult to learn. I think, people 
often have problems with learning Haskell because they know imperative 
programming and try to apply their imperative thinking to programming in 
Haskell.

Some months ago, a first year student told me that she liked Haskell very much 
and that she didn't find it very difficult. I asked her if she had had 
experiences with other programming languages before learning Haskell. She 
answered: "No."

> [...]

Wolfgang

Gmane