From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 453A77EEAF for ; Wed, 23 Jan 2013 18:40:43 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of wojciech.meyer@gmail.com) identity=pra; client-ip=74.125.82.175; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="wojciech.meyer@gmail.com"; x-sender="wojciech.meyer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of wojciech.meyer@gmail.com designates 74.125.82.175 as permitted sender) identity=mailfrom; client-ip=74.125.82.175; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="wojciech.meyer@gmail.com"; x-sender="wojciech.meyer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-we0-f175.google.com) identity=helo; client-ip=74.125.82.175; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="wojciech.meyer@gmail.com"; x-sender="postmaster@mail-we0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsBAOsfAFFKfVKvjmdsb2JhbABEvjEWDgEBAQEJCxISBiOCTBkBGx4DEhAWNAETEQEFAYg8AQMPBAicD4JwjDSCe4UKChknDVmIdgEFDI1+gykDlgyBHI1MP4QX X-IronPort-AV: E=Sophos;i="4.84,523,1355094000"; d="scan'208";a="191291891" Received: from mail-we0-f175.google.com ([74.125.82.175]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Jan 2013 18:40:42 +0100 Received: by mail-we0-f175.google.com with SMTP id z53so2633138wey.34 for ; Wed, 23 Jan 2013 09:40:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:mime-version :content-type; bh=0OO5v3SsllSBxmYfIXV5uh8PAZ0ctNGliXrRgQKfuMM=; b=iKZt1AI1mZThpEBD9XF7OfwRSipf01bgj7cmJd0rzb9Ot+LH5eJWxhgKujhDFEwGYx A2XeikXtgT8RgPELeHCqhaWhiamwUZlH4Crq42NAIP8r8XFIDn0L2h4m7+UcG8Wo1aKN O/3RZ88pHt3FKhPw6GO69855eXJQSJis3EYC9ikPw7ryLiDKBPuwte6GY1q5xip1QqpQ JrkIITi4nxqZCo/HXI+5Lme4g3ovtZy+Ldl9vzfTbn0aIppKWTgJDwGhCTD9RZcdEkZg TilrcTTh88YtngpucYaYhgCct/Z2I9APRwPeQzFM36ToiPHh2pBhRSIh+KqIgYYqUkrv Ig1w== X-Received: by 10.194.143.35 with SMTP id sb3mr4161451wjb.30.1358962842649; Wed, 23 Jan 2013 09:40:42 -0800 (PST) Received: from spec-desktop.danmey.org (cpc1-cmbg12-0-0-cust201.5-4.cable.virginmedia.com. [86.9.116.202]) by mx.google.com with ESMTPS id eo10sm30608944wib.9.2013.01.23.09.40.40 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 09:40:41 -0800 (PST) From: Wojciech Meyer To: caml-list@inria.fr Date: Wed, 23 Jan 2013 17:40:49 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: [Caml-list] [ANN] omonad-0.0.1 Hi, I'm pleased to pre-release a small syntax extension for monadic programming called omonad. The major difference between omonad and pa_monad[_custom] is that omonad does not use Camlp4 and is based on -ppx flag implemented on the current trunk of the toolchain. The monadic code can look like this: let compute c = Exception.(perform begin a <-- return (1+2); b <-- return (a+4); return (b + a * c) end) in let computation = Exception.(perform begin a <-- compute 10; b <-- return (a - 37); c <-- (perform begin d <-- return 1; return (d - 1) end); let divisor = b + c in if divisor = 0 then fail "Division by zero!" else return (80 / divisor); return (a+b) end) in try print_int (Exception.run computation) with Exception.Error str -> Printf.printf "Computation terminated with: '%s'\n" str There is not much syntactical difference between pa_monad[_custom] and omonad, so it brings to a light the same monadic programming convenience and experience. Tarball: http://danmey.org/omonad-0.1.0.tar.gz Git repository: https://github.com/danmey/omonad Issue & features: https://github.com/danmey/omonad/issues OPAM packaging will follow up shortly. Enjoy, -- Wojciech Meyer http://danmey.org