syntax across languages

Jay Cox
Sun, 10 Feb 2002 22:59:16 -0600 (CST)

On 11 Feb 2002, Pixel wrote:

> - the page has now much more entries
> - one can check the missing entries per language at
>   (160KB)
>   see especially the haskell one
> Contributions, suggestions and fixes are welcome.

Some random thoughts....


     * Object Oriented & Reflexivity

       | class             | class declaration |
       | functional syntax | method invocation |

I'm not sure anything under haskell can be considered OO but I'm no
languages expert.

You might could mention something about Type classes. This is the main
(only) method of overloading functions in haskell.

maybe you might make mention of polymorphic type system and how haskell
uses type inferencing to determine the meaning of expressions (relates to
type classes).


data = Foo ...
really should be meantioned as a way to construct new types.
newtype = Foo ... (new type)

type Foo = ...
is only a type synonym. heres an example.
type String = [Char]

Under constrol structure, at least give mention to monads!
Common examples (ST,IO,List,Maybe) and "do notation"

Monads are defined by instanciating them under the Monad type class.
(basically giving definitions for the operators >>= (aka 'bind') and >>

I dont think you give list comprehensions a fair shake either.
(btw, list comprehension is an example of an alternative
syntax for using lists as a monad.)

[f z elem | anylistfromlistoflists <- listoflists,
            elem >= 3,
            z <- someotherlist]

References arent missing.  They are implemented under both the ST and IO

sprintf ... show ?? (still show peruses no format specifiers so it can be
kinda blah.)

(!!) extracts a char from String since type String = [Char]

oh, and it isnt missing those math functions either.  Take another look
at the Prelude (google search it as I'm to lazy to find out url for exact
page in haskell 98 report)


Oops, I see that "missing:" in your page really doesnt mean missing from

A number of the "missing:" things (esp the math) can be had by just
looking at the Haskell Report. a google search "Haskell 98 Report Prelude"
probably gets you there.

You Have quite a list of languages there.  Seems like I've come upon your
page before.   I'm sure there'll be many more to bookmark it and use it.

Jay Cox