Browse thread
type abbreviation is cyclic
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Dmitri Boulytchev <db@t...> |
| Subject: | Re: [Caml-list] type abbreviation is cyclic |
As far as I remember you need atleast one constructor in order to
declare recursive type:
type b = X of (int -> b -> int)
BTW, you have that in your first example.
Best regards,
Dmitri Boulytchev,
St.Petersburg State University.
> I wonder whether this error is an example of the language being
> defined more restrictively than required. What is the reason that I
> get these results?
>
> type a = int -> one -> int and one = Unused | One of a;;
> type b = int -> b -> int
>
> type a is accepted while type b is not. (b gives "The type
> abbreviation b is cyclic" However, in the uses that I intended, there
> won't be any actual difference between the two.
>
> I'd appreciate an explanation about why there is difference between a
> and b.
>
> Thanks
>
> Bill Smith
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Caml-list mailing list. Subscription management:
>http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>Archives: http://caml.inria.fr
>Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>