Advertisement
Guest User

Untitled

a guest
Oct 30th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.60 KB | None | 0 0
  1. type default_tokenizer = string -> to_tokenize list;;
  2. type lifted_tokenizer = to_tokenize list -> to_tokenize list;;
  3.  
  4. let rec lift (tokenizer:default_tokenizer): lifted_tokenizer = function
  5.   | [] -> []
  6.   | a::b -> match a with
  7.             | `To_Tokenize(s) -> (tokenizer s) @ (lift tokenizer b)
  8.             | `Info_Token(i) -> `Info_Token(i) :: (lift tokenizer b)
  9. ;;
  10.  
  11. Line 7
  12. Error: This pattern matches values of type [? `To_Tokenize of 'a ]
  13.        but a pattern was expected which matches values of type
  14.          to_tokenize =
  15.            [ `Info_Token of info_token | `To_Tokenize of string ] list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement