[bitc-dev] FN keyword

Jonathan S. Shapiro shap at eros-os.org
Tue Aug 10 16:01:02 PDT 2010

Bah. I remembered why the darned FN keyword is in there. The full production
for function types is:

   fntype: [effects] fn ( argType [, argType]* ) -> resultType

The problem is that effects are optional, so if we remove the "fn" there is
an abiguity between:

  type: [effects] fn ( argType [, argType]* ) -> resultType
  type: ( type )

>From a readability perspective, I don't really want to put the effect on the
arrow itself, and we can't treat this as a type class. There are a couple of
options here:

  1. I can probably jigger the productions around to make this okay
      if we have to, giving:

        'a -> 'b
        noalloc 'a -> 'b

  2. Failing that, we can use the FN keyword only when an effect
      is present on the type, giving:

        'a -> 'b
        noalloc fn 'a -> 'b

>From an english-language readability perspective I almost prefer "noalloc fn
'a -> 'b", but I have no strong preference.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.coyotos.org/pipermail/bitc-dev/attachments/20100810/6d1c6497/attachment.html 

More information about the bitc-dev mailing list