Browse thread
[Caml-list] Is arrow programming impossible in ocaml?
[
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: | Nick Name <nick.name@i...> |
| Subject: | [Caml-list] Is arrow programming impossible in ocaml? |
Hi all, I am trying to work on a project where I need ocaml efficiency
with rank-2 polymorphism, if I got it correctly (I am not an expert in
programming language semantics).
Basically I am trying to reproduce FRAN-like usage of arows as in
http://haskell.cs.yale.edu/yampa/AFPLectureNotes.pdf
so I have defined my own arrow module etc, but I faced the rank-1
polymorphism restriction of ocaml. I have cut down my example to:
-
type ('a,'b) t = 'a -> 'b
let rec arr f = f
let a = arr (fun x -> x)
-
and "a" is typed like '_a -> '_a , where I would like it to be typed 'a
-> 'a.
Does anyone think I have other possibilities in writing that kind of
higher-order combinator based code, or is it impossible?
thanks
Vincenzo
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners