Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ocaml function declaration simplification

18 views
Skip to first unread message

tmp123

unread,
Nov 1, 2006, 11:12:41 AM11/1/06
to
Hello,

Thanks for your time.

I've a long function declaration like:

let re_seq
( p1 : 'a #lst->('b*('a #lst)) option )
( p2 : 'a #lst->('c*('a #lst)) option )
( l : 'a #lst) :
( ('b*'c)*('a #lst)) option =
....

where "lst" is a polymorphic class "class ['a] lst = ...."

I like to simplify it. No success in all my tries around things like:

type 'a re_input = 'a #lst;;
type ('a,'b) re_res = ('b*'a #lst) option;;
type ('a,'b) re_exp = 'a lst -> ('a,'b) re_res;;

in order to reduce the declaration to:

let re_seq
( p1:('a,'b) re_exp )
( p2:('a,'b) re_exp )
( l:'a re_input ) :
( 'a,('b,'c) ) re_res =
....

Has someone any sugestion?

Thanks a lot.

0 new messages