Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] type matching
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-17 (14:55)
From: Flávio Leonardo Cavalcanti de Moura <flavio@m...>
Subject: [Caml-list] type matching
Hi there, 

I am trying to build a normalisation function for lambda terms which
uses the leftmost strategy. Since the function is not working properly,
I decided to try it at the top level. So after loading some cmo and cma
bytecodes I got:

# let beta_normout l_upl = 
  let new_l_upl = ref l_upl in 
  let exp = ref (Common.first(List.hd !new_l_upl)) in 
    while (Common.pos_leftBR !exp <> [3]) do 
      new_l_upl := reduce_pure !exp 1 (Common.pos_leftBR !exp)
      exp := (left_normal_lse !exp (Common.pos_leftBR !exp))
              val beta_normout :
  (Setypes.exlambda * int * int list * string) list ->
  (Setypes.exlambda * int * int list * string) list = <fun>

Then, when I try to run an example, I get:

# beta_normout [((A(L(DB 1),DB 2)),0,[],"")];;
Characters 14-41:
  beta_normout [((A(L(DB 1),DB 2)),0,[],"")];;
This expression has type exlambda * int * 'a list * string
but is here used with type Setypes.exlambda * int * int list * string

My dout is: shouldn't the type exlambda match with the type
Setypes.exlambda as well as 'a list with int list in the two last line

Why Ocaml differ between the types Setypes.exlambda and exlambda?

I will be very happy if someone could help me.

best regards, 


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: