[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Add 'a shorthand for forall types
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Add 'a shorthand for forall types |
Date: |
Sun, 11 Nov 2018 20:30:33 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Tue, May 29, 2018 at 01:18:02PM +0300, megane wrote:
> Hello,
>
> This adds support for declaring forall types in more compact manner.
>
> It supports syntax like ('a -> 'a) to declare the type
> (forall (a) (a -> a)).
I was about to apply this, but the second example added to the manual
does not make sense to me:
> diff --git a/manual/Types b/manual/Types
> index 6d5de10..cab029d 100644
> --- a/manual/Types
> +++ b/manual/Types
> @@ -158,6 +158,12 @@ or {{:}} should follow the syntax given below:
>
> (*) Note: no type-variables are bound inside {{(not TYPE)}}.
>
> +You can use a shorthand {{'SYMBOL}} for introducing free variables in
> +{{forall}} types, examples:
> +
> + ('a -> 'a) is translated to (forall (a) (a -> a))
> + (forall (a) ('a -> a)) is translated to (forall (a) (a -> a))
> +
> Note that type-variables in {{forall}} types may be given "constraint"
> types, i.e.
>
> (: sort (forall (e (s (or (vector-of e) (list-of e))))
It looks like the example is wrong, but I don't know what it's trying
to say here. Or maybe I just misunderstand it?
Cheers,
Peter
signature.asc
Description: PGP signature
- Re: [Chicken-hackers] [PATCH] Add 'a shorthand for forall types,
Peter Bex <=