From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id CC6C8BC37 for ; Thu, 11 Feb 2010 12:05:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au0AAGdzc0uLEwExgGdsb2JhbACbDwEBCwsKBRUFHq5kAY1VBYRW X-IronPort-AV: E=Sophos;i="4.49,451,1262559600"; d="scan'208";a="56855923" Received: from infao0809.mpi-sb.mpg.de (HELO hera.mpi-sb.mpg.de) ([139.19.1.49]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 11 Feb 2010 12:05:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=Message-ID:In-Reply-To: References:Date:Subject:From:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=Wq+G0peEWEgfGtqFhagpd/Kvs4+FC9XtlI 8VAEYS3Jc=; b=vPsspp3tE/q3bKmB6xniLDrBotCMuw/Rs7/9tA3YeQuhOCe7S8 /BQOjZ8yIzBkXxAILIpf8tHtchdCeaw19DuOlDvDponisJaM6Or9XhNhHyX+lN1o roo3vS2WhmQEt+4RKaNTq9J8dIspAnJHf5xjM2U9UskbZYYGxV/BBffoA= Received: from newzak.mpi-sb.mpg.de ([139.19.1.28]:35964) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1NfWrh-0000O1-RF; Thu, 11 Feb 2010 12:05:48 +0100 Received: from www-data by newzak.mpi-sb.mpg.de with local (Exim 4.63) (envelope-from ) id 1NfWrh-0002Yq-Gw; Thu, 11 Feb 2010 12:05:45 +0100 Received: from 80.146.185.83 (SquirrelMail authenticated user rossberg) by mail.mpi-sws.org with HTTP; Thu, 11 Feb 2010 12:05:45 +0100 (CET) Message-ID: <923d63e1a659ace0fee3550f81944e28.squirrel@mail.mpi-sws.org> In-Reply-To: <4b39c80a1002110239i2fc1f555if642ed6a589d5b66@mail.gmail.com> References: <14cf844b1002081907y2900c313q97ae0cb6f4c92394@mail.gmail.com> <891bd3391002081959i4f9b70d4re1914ad7e439b5e3@mail.gmail.com> <4b39c80a1002110239i2fc1f555if642ed6a589d5b66@mail.gmail.com> Date: Thu, 11 Feb 2010 12:05:45 +0100 (CET) Subject: Re: [Caml-list] Preventing values from escaping a context From: rossberg@mpi-sws.org To: "Alexey Rodriguez" Cc: caml-list@inria.fr User-Agent: SquirrelMail/1.4.15 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam: no; 0.00; rossberg:01 monads:01 ocaml:01 fwiw:01 ocaml:01 wrote:01 exception:01 andreas:01 caml-list:01 problem:05 problem:05 context:06 thread:06 trick:06 sufficient:08 "Alexey Rodriguez" wrote: > > On whether monads can solve the problem in this thread, yes they can. Not in OCaml. In the presence of unrestricted side effects, the ST monad trick is no longer sufficient because a resource can leak through a reference or an exception without that showing up in the type. > But for this you need support from the type system (rank-2 universal > quantification). FWIW, OCaml can express that, but it doesn't help the problem. /Andreas