English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
partial application warning unreliable?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-12-09 (18:51)
From: Andreas Rossberg <AndreasRossberg@w...>
Subject: Re: [Caml-list] partial application warning unreliable?
"skaller" <skaller@users.sourceforge.net> wrote:

> Felix allows
> f: int -> 0
> but not
> g: 0 -> int

Then your "0" is not a proper type in the usual formal sense. Even less is
it the type-theoretic 0.

As Andrej Bauer points out, void vs unit has nothing to do with side
effects. If you want to capture side effects properly in a type system the
known approaches are effect systems or monads. In fact, your 0 looks
somewhat like a monad type with implicit injection and semicolon as a kind
of forgetting bind operator. But it seems sufficiently adhoc to make any
type-theoretic interpretation difficult.

  - Andreas