caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: Malcolm Matalka <mmatalka@gmail.com>
Cc: Christopher Zimmermann <christopher@gmerlin.de>, caml-list@inria.fr
Subject: Re: [Caml-list] 'b t doesn't equal '_b t?
Date: Mon, 8 Aug 2016 12:06:36 +0200	[thread overview]
Message-ID: <20160808100635.GB11261@frosties> (raw)
In-Reply-To: <8660ru83s2.fsf@gmail.com>

On Mon, Jul 25, 2016 at 09:29:01AM +0000, Malcolm Matalka wrote:
> Christopher Zimmermann <christopher@gmerlin.de> writes:
> 
> > '_b t is just not polymorphic. It just means the compiler could not yet
> > figure out the monomorphic type of '_b. It will be bound to a
> > monomorphic type later on.
> 
> How does one track down and why this is happening?  I tried adding some
> typo annotations, but no luck.  Maybe I didn't add them in the right
> place or I added the wrong annotations?
> 
> Any tips for handling this situation?
> 
> >
> >
> > On 2016-07-24 Malcolm Matalka <mmatalka@gmail.com> wrote:
> >> I have the following error and I don't understand what the compiler is
> >> trying to tell me.  Any hints?
> >> 
> >> Error: The implementation abb_fut.ml
> >>        does not match the interface abb_fut.cmi:
> >>        Values do not match:
> >>          val bind : 'a t -> ('a -> '_b t) -> '_b t
> >>        is not included in
> >>          val bind : 'a t -> ('a -> 'b t) -> 'b t
> >>        File "abb_fut.ml", line 118, characters 4-8: Actual declaration
> >> 

You can not annotate a function to be more polymorphic, only less.
It's basically just a lower limit. So if you annotate a type as "'a t"
that means the type must be some t, but 'a can still be infered to be
not prolymorphic. This makes it hard to find cases where the infering
gets too specific for your taste.

MfG
	Goswin

  parent reply	other threads:[~2016-08-08 10:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24 16:48 Malcolm Matalka
2016-07-24 19:17 ` Christopher Zimmermann
2016-07-25  9:29   ` Malcolm Matalka
2016-07-25  9:36     ` Rodolphe Lepigre
2016-08-08 10:06     ` Goswin von Brederlow [this message]
2016-08-08 14:35       ` Malcolm Matalka

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=20160808100635.GB11261@frosties \
    --to=goswin-v-b@web.de \
    --cc=caml-list@inria.fr \
    --cc=christopher@gmerlin.de \
    --cc=mmatalka@gmail.com \
    /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).