Monads?

Antonio Eduardo Costa Pereira costa@ufu.br
Wed, 26 Jul 2000 13:48:21 -0300


Dear Ted.
I think that the best way to learn monads is to examine a reasonably
large program that exemplify this paradigm. When I tried to learn
monads myself, I fished for such a program in the Internet. I found
a Java disassembler written in Clean among the functional miniatures of
late professor Natanael Quest. It is an old program, written for an
old version of the Clean compiler, and that works only for the Java VM 1.1.
However, since the functional miniatures are not available anymore in the
Net,
I am sending the disasm to you as it is (i.e. for the old version of Clean).
Since I think that nobody else in the Clean list are interested in the
program, I am sending it directly to you as an attachment to a letter
that follows this one. I guess that the only thing that you need to change,
in order to modernize the program, is the Start node. Here is the new Start
node:

Start world
  # (console, world)= stdio world
   console = fwrites  "\nInput File? " console
   (s1, console)= freadline console
   console= fwrites "\nOutputFile? " console
   (s2, console)= freadline console
   (ok, file, world)= fopen  (stripNewLine s1)  FReadText  world
   (contents, file)= freads file 2000
   (ok, file, world)= fopen (stripNewLine s2)  FWriteText world
   (ok, file)= writeAsm contents  file
   (ok, world)= fclose file world
 =  world

The rest of the program you should leave as it is. Good luck
in your study of monads.

Eduardo Costa




----- Original Message -----
From: Ted Goranson <tedg@sirius-beta.com>
To: <clean-list@cs.kun.nl>
Sent: Sunday, July 23, 2000 3:57 AM
Subject: Monads?


> Hello--
>
> A newbee question. Are there pointers to Clean and monads?
>
> Best, Ted
> _____________
> Ted Goranson
> fusecap and Sirius-Beta, Virginia Beach USA
> 757/426-6704
> tedg@sirius-beta.com
> Symmetry Conference: http://www.isis-s.unsw.edu.au
>