caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Guichard <alphablock@orange.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] problem with generalisation
Date: Sat, 23 Sep 2017 22:40:00 +0200	[thread overview]
Message-ID: <5da48da9-43db-701e-6e72-52daec319183@orange.fr> (raw)
In-Reply-To: <20170923174705.wkdryyzkixlroqdw@delli7.univ-savoie.fr>


Hi Christophe,

Given the types, the only thing i can do is to promote an iterator :

let promote i = {f = fun x -> i.f x}

I can't do anything else and i eagerly wait the whole scholar answer.

Regards,

- Damien Guichard


Christophe Raffalli a écrit :
> Hello,
>
> I am blocked by this case not working (I reported on Mantis ...
> https://caml.inria.fr/mantis/view.php?id=7636)
>
> Any hint on how to make it works, apart fomr Obj.magic ?
>
> I can not change the types, they come from a functor.
>
> ====================================================
> type ('a, 'b) elt = 'a
>
> type 'a iter = { f : 'b.('a, 'b) elt -> unit }
>
> let promote f : 'a -> unit =
>    let f : 'b.('a, 'b) elt -> unit = fun x -> f x in
>      { f }
> ====================================================
>
> Cheers,
> Christophe


  reply	other threads:[~2017-09-23 20:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-23 17:47 Christophe Raffalli
2017-09-23 20:40 ` Damien Guichard [this message]
2017-09-23 21:04 ` Markus Mottl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5da48da9-43db-701e-6e72-52daec319183@orange.fr \
    --to=alphablock@orange.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).