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 04C667F1C3 for ; Sat, 24 Nov 2012 17:34:09 +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=74.125.82.42; 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 74.125.82.42 as permitted sender) identity=mailfrom; client-ip=74.125.82.42; 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-wg0-f42.google.com) identity=helo; client-ip=74.125.82.42; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="cyocum@gmail.com"; x-sender="postmaster@mail-wg0-f42.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AusBANL1sFBKfVIqjWdsb2JhbABEhii6DQgWDgEBAQEJCRQSBiOCHgEBBSMEGQEbHQEDDAYFCw0qAgIUDQIRAQUBIhOHegEDDwQIoC+LZE+CeIQlChknDVmIdQEFDItCaYMuMmEDlCyBVAGBHIoYgzA/hBA X-IronPort-AV: E=Sophos;i="4.83,313,1352070000"; d="asc'?scan'208";a="163659169" Received: from mail-wg0-f42.google.com ([74.125.82.42]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 24 Nov 2012 17:34:08 +0100 Received: by mail-wg0-f42.google.com with SMTP id dr1so1359497wgb.3 for ; Sat, 24 Nov 2012 08:34:08 -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=fUfhJytZV3BspCFgrp2Hp8nd108R3F5fy/0sm+9Wq8s=; b=NJl/diU+Iv2Nkh29rHqYANCxP4RMYi1cJ9L8D+HZJodUXfR00qisQWd+gqvNPKxWN6 y6zwGtCss6uws0Devf38Ai4eIM6lp/9JJtpwXlBHNX/sfwhg0fVyC0tQzKC5Ys9wi3FQ jnUWsPM6linfem+ScZfYX+l2Ce3LW3zBWmcT74mCj66cEiuaumiSb3OthKxrlbZfmiDL i/efSYqefqnBHzpeSbmLIecBUDtqIt/uEymQd/p/Bo4Dg35Sl5GxsXVXGIyASxnKe6X4 ayXkf+hSokrrRuymKLfIYfxKQrj8vsngIpTIGrtpDHmu/NAzpL67IVPRvfT+z3FLEEYp ezMQ== Received: by 10.216.209.70 with SMTP id r48mr2776710weo.196.1353774847958; Sat, 24 Nov 2012 08:34:07 -0800 (PST) Received: from localhost (gilbertsed.plus.com. [81.174.226.62]) by mx.google.com with ESMTPS id bz12sm14996681wib.5.2012.11.24.08.34.07 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Nov 2012 08:34:07 -0800 (PST) Date: Sat, 24 Nov 2012 16:34:06 +0000 From: Chris Yocum To: =?utf-8?Q?Micha=C5=82?= Kurcewicz Cc: caml-list@inria.fr Message-ID: <20121124163405.GA2158@gmail.com> References: <20121123114328.GD31371@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="M9NhX3UHpAaciwkO" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Monad Library? --M9NhX3UHpAaciwkO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thanks everyone, So basically from what I understand this is kind of like a StateMonad. It seems to me that the state monad (hiding state in the type system) would be a large boon. So, for instance, module type MONAD =3D sig type 'a t val return : 'a -> 'a t val bind : 'a t -> ('a -> 'b t) -> 'b t end module StateMonad : MONAD =3D struct type 'a t =3D Store of 'a let return x =3D Store(x) let bind s f =3D match s with | Store(x) -> f x let access =3D function Store(x) -> x end This is a very, very basic implementation of a state monad? Thanks again. Chris On Fri, Nov 23, 2012 at 09:59:30PM +0100, Micha=C5=82 Kurcewicz wrote: > If Core is too complex for you then you may take a look at spotlib - a > small and elegant library written by Jun Furuse: >=20 > https://bitbucket.org/camlspotter/spotlib >=20 > I use it together with pa_monad_custom for all my monad needs. >=20 > Best, >=20 > --mk >=20 > On Fri, Nov 23, 2012 at 12:43 PM, Chris Yocum wrote: > > Hi, > > > > 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 > > 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? > > > > All the best, > > Chris --M9NhX3UHpAaciwkO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iF4EAREIAAYFAlCw9v0ACgkQDjE+CSbP7HrXBgD8DBQr01eukZIUJszgUj3cLNbr 4mA+xZbLvVmHkP3hwyYA/2WUFvlSh17bFgtyiKuszzUcCNWrxpfywIPadCkCE2O2 =faj/ -----END PGP SIGNATURE----- --M9NhX3UHpAaciwkO--