Hi,
I was refactoring code today and hit a typing error that I couldn't
explain. I eventually tracked it down to the following:
let f () ?a () =
print_endline bouh!
let h f =
f () ()
let () = h f;; (* error is for f here *)
Error: This expression has type unit - ?a:'a - unit
(sorry for any double-posting)
The problem is that in your declaration of h, the inferred type for f
is of the form (unit - unit - ...), and you use it with the
different type (unit - ?a:'a - unit - ...).
Changing ?a to be the first parameter of f change f's type to (?a:'a
- unit - unit - ...).
hi
I'm a Ocaml n00b (without any degree). Therefore I have a faible for
everything that makes Ocamls syntax more algol/imperative like [1]. An
example would be an extension like 'newref'
(http://bitbucket.org/johannes/newref/wiki/Home), which turns:
print_int !i into print_int $i
On 23/09/2010, bluestorm bluestorm.d...@gmail.com wrote:
(sorry for any double-posting)
The problem is that in your declaration of h, the inferred type for f
is of the form (unit - unit - ...), and you use it with the
different type (unit - ?a:'a - unit - ...).
Changing ?a to be the first
Hello,
2010/9/23 ben kuin benk...@gmail.com:
I'm a Ocaml n00b (without any degree). Therefore I have a faible for
everything that makes Ocamls syntax more algol/imperative like [1].
If you are new to OCaml, I strongly advise you to learn it the way it
is, with its syntax (somewhat quirky[1], I
Could someone give any idea how I can begin to understand how to write
simple camlp4 extensions?
For an accessible introduction to modern (= 3.10) Camlp4, you may be
interested in Jake Donham's blog post series Reading Camlp4 :
http://ambassadortothecomputers.blogspot.com/search/label/camlp4
On Thu, Sep 23, 2010 at 8:25 AM, bluestorm bluestorm.d...@gmail.com wrote:
For an accessible introduction to modern (= 3.10) Camlp4, you may be
interested in Jake Donham's blog post series Reading Camlp4 :
http://ambassadortothecomputers.blogspot.com/search/label/camlp4
You can also see the
On Thu, 2010-09-23 at 16:56 +0200, ben kuin wrote:
Could someone give any idea how I can begin to understand how to write
simple camlp4 extensions?
Shameless self-plug, but I wrote a blog post this summer about my
experience figuring out how to do it. I provide a walk-through and
explanation
On 23-09-2010, ben kuin benk...@gmail.com wrote:
Could someone give any idea how I can begin to understand how to write
simple camlp4 extensions?
If you consider yourself as a n00b, don't start by camlp4. This is
probably the most difficult part of OCaml -- and to program camlp4 you
need to
thanks a lot for this information and the links, this is very helpful
On Thu, Sep 23, 2010 at 6:26 PM, Michael Ekstrand mich...@elehack.net wrote:
On Thu, 2010-09-23 at 16:56 +0200, ben kuin wrote:
Could someone give any idea how I can begin to understand how to write
simple camlp4 extensions?
thanks Jake, after browsing through those articles I came to the
conclusion that for understanding and using camlp4 the notion of
quotations and antiquotations is fundamental. My absolute lack of
knowledge in this area might be a reason why I can't figure out how
camlp4 works.
On Thu, Sep 23,
On Thu, Sep 23, 2010 at 11:49 AM, ben kuin benk...@gmail.com wrote:
thanks Jake, after browsing through those articles I came to the
conclusion that for understanding and using camlp4 the notion of
quotations and antiquotations is fundamental. My absolute lack of
knowledge in this area might
On Sep 23, 2010, at 11:49 AM, ben kuin wrote:
thanks Jake, after browsing through those articles I came to the
conclusion that for understanding and using camlp4 the notion of
quotations and antiquotations is fundamental. My absolute lack of
knowledge in this area might be a reason why I
If you are new to OCaml,
I'm not actually new to OCaml, but although I've read every notable
book about OCaml and a lot of good code of other OCaml programs, OCaml
is still very foreign and counter-intuitive too me.
I know what you're might thinking now: why the hell does he still bother?
The
2010/9/23 ben kuin benk...@gmail.com:
[1] Compared to other programming languages. I know the syntax is the way
it is for precise reasons (currying, closer to mathematical
notation, ...).
Would you mind to list a few mathematical subjects that help me to
understand OCamls syntax?
I
On 2010/09/24, at 0:05, Adrien wrote:
On 23/09/2010, bluestorm bluestorm.d...@gmail.com wrote:
(sorry for any double-posting)
The problem is that in your declaration of h, the inferred type for f
is of the form (unit - unit - ...), and you use it with the
different type (unit - ?a:'a - unit
16 matches
Mail list logo