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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 63E1A7F1C3 for ; Fri, 23 Nov 2012 13:04:15 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of cyocum@gmail.com) identity=pra; client-ip=209.85.212.194; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="cyocum@gmail.com"; x-sender="cyocum@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of cyocum@gmail.com designates 209.85.212.194 as permitted sender) identity=mailfrom; client-ip=209.85.212.194; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="cyocum@gmail.com"; x-sender="cyocum@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wi0-f194.google.com) identity=helo; client-ip=209.85.212.194; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="cyocum@gmail.com"; x-sender="postmaster@mail-wi0-f194.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar8EADdlr1DRVdTCZWdsb2JhbABEFsAXCBYODQoKBxQGI4IeAQEDAQFAARsdAQMBCwYFCw0uFA0CEQEFASITCYdxAQMJBgygP4wzgniEVQoZJw1ZiHUBBQyLQmkFg1thA5JPgV2BVAGBHIoWgzA/hBA X-IronPort-AV: E=Sophos;i="4.83,307,1352070000"; d="asc'?scan'208";a="163558664" Received: from mail-wi0-f194.google.com ([209.85.212.194]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Nov 2012 13:04:14 +0100 Received: by mail-wi0-f194.google.com with SMTP id hq12so446271wib.9 for ; Fri, 23 Nov 2012 04:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=WG1q/Z1+pdHlV3l4siVw6bITZNV3Gf5CUoxps5a3hZg=; b=e1TSvAHnJ0WN+xHedYiCMXD9JXXUBm5AZ3SZeQdZM5cbaovTCQ7uszHoWbzz1vyu3p 1u10oR1QdlFygjQAvoa4bikbHqanQgNiKle177aRMaRku3IBtd9hn/B0dqiOGhTNm8gd 5D3UxZzjoDaRzt+WBKcPs8Mk1TRK7VHIrbXmzcrE2UmdGlJxDopXHIq7NwUPOONzAKoG qNeNI1W6m/Vrmj7+M1XRstIjlZMGzr4jvVeE61nijSp8YsRFpDFdSsONl4hVsX1+bvXy 4Doe7XwAXPGbHSq/Et0Pubjr7a6uvDBAjpPCMgptVj9pNx8xP/46o3fiF7LtXn4PC8B/ 4f7g== Received: by 10.180.7.197 with SMTP id l5mr9284797wia.13.1353672253492; Fri, 23 Nov 2012 04:04:13 -0800 (PST) Received: from localhost (dlib-yocum.ucs.ed.ac.uk. [129.215.169.90]) by mx.google.com with ESMTPS id ec3sm8271556wib.10.2012.11.23.04.04.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 04:04:13 -0800 (PST) Date: Fri, 23 Nov 2012 12:05:14 +0000 From: Chris Yocum To: Wojciech Meyer Cc: Caml List Message-ID: <20121123120514.GE31371@gmail.com> References: <20121123114328.GD31371@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5xSkJheCpeK0RUEJ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Monad Library? --5xSkJheCpeK0RUEJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 23, 2012 at 11:54:40AM +0000, Wojciech Meyer wrote: > On Fri, Nov 23, 2012 at 11:43 AM, Chris Yocum wrote: > > I was looking into using Monads in my programs but I am slightly at a > > loss as to what library is in general use. There is pa_monad but that >=20 > pa_monad is really useful and nice, I think the updated library is > available as pa_monad_custom OPAM package. >=20 Yeah, I saw that. I will install it and have a look. > > seems to be a ocamlp4 exention and not a library. There is > > http://lambda.jimpryor.net/monad_library/ but that doesn't seem to be > > in opam or in godi so I am unsure as to its status. > > > > Does anyone have any suggestion for a well supported monad library for > > Ocaml? >=20 > First I would need to find an answer what do you mean by a monad library. >=20 > Monads is a general abstraction with a very simple interface. so they > don't require library as such. >=20 > However I agree it would be good to have some library that provides a > monadic interface to some common functionality found maybe in std > libraries, also some way of composing monads would be good having > monad transformers along. Batteries included offer monadic interface > to some common data types like list, bool, option. >=20 Ok, I had only seen the Monad module in batteries. Also, I tend not to like batteries as it bloats the executable size; I get something like a 5MB executable for a small amount of code. In general, what I would like in a "monad library" would be a collection of "standard monads". I am using scarequotes because I don't know what all of this means. Looking at the Haskell Wiki (http://www.haskell.org/haskellwiki/Monad#Common_monads) lists the common monads as "Maybe, List, State, Reader, and IO". I would assume that a monad library would have these and a method for building new ones. > You could look at Xavier Leroy's lectures here [1] to see the > excellent examples of using monads in OCaml. >=20 > For somewhat advanced type system trickery to use generic interface > for monads you can look at this excellent post [2]. Great. Thanks for the info! Chris >=20 > -Wojciech >=20 > [1] http://gallium.inria.fr/~xleroy/mpri/progfunc/monads.2up.pdf > [2] http://alaska-kamtchatka.blogspot.co.uk/2011/09/higher-order-fun.html > [3] http://batteries.forge.ocamlcore.org/ --5xSkJheCpeK0RUEJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iF4EAREIAAYFAlCvZnoACgkQDjE+CSbP7HoYewEAl1T/zB68BmYhZ8tCHxp8FIIE CIQcKQ3IeB60najP52sA/3pv9Y4eYdQJisPyG4QpH1q74Edr9CjF39vvBx3CUdtz =hrj+ -----END PGP SIGNATURE----- --5xSkJheCpeK0RUEJ--