flux__ changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
Captain_Fourier has joined #ocaml
<Captain_Fourier> howdy
WhatTheDeuce has joined #ocaml
<Captain_Fourier> ?
Captain_Fourier has left #ocaml []
flux__ has quit [Remote closed the connection]
flux__ has joined #ocaml
EsotericMoniker has left #ocaml []
sieni_ has joined #ocaml
sieni has quit [Read error: 110 (Connection timed out)]
gim_ has quit []
khaladan has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
mikeX has quit ["zz"]
khaladan has joined #ocaml
CosmicRay has quit ["Client exiting"]
Demitar_ has quit [Read error: 104 (Connection reset by peer)]
Demitar has joined #ocaml
Captain_Fourier has joined #ocaml
<Captain_Fourier> hello
<ketty> hello
<Captain_Fourier> i am having trouble writing a recursive function
<ketty> yes?
<Captain_Fourier> let rec fringe_c t c =
<Captain_Fourier> match t with
<Captain_Fourier> | Leaf n -> (n, c)
<Captain_Fourier> | Node (left, right) ->
<Captain_Fourier> fringe_c left (fun a -> fringe_c right c)
<Captain_Fourier> im trying to figure out what i am doing wrong
<Captain_Fourier> c's type is recursively defined
<ketty> can you give me the type of c?
<ketty> this looks weird: "(fun a -> fringe_c right c)"
<Captain_Fourier> is a lambda that delays the eval of fringe_c right
<ketty> the return type of fringe_c is (type_of_c * type_of_c) ?
<Captain_Fourier> no (Leaf n * type_of_c)
<ketty> are t and c of the same type?
<Captain_Fourier> no
<Captain_Fourier> t is a Tree datatype
<ketty> so type of fringe_c is: t -> type_of_c -> (??? * type_of_c)
<ketty> is "Leaf n" really a type?
<ketty> looks more like a value to me..
<Captain_Fourier> oops sorry
<Captain_Fourier> type 'a tree =
<Captain_Fourier> | Leaf of 'a
<Captain_Fourier> | Node of 'a tree * 'a tree
<ketty> so: type_of_c tree -> type_of_c -> (type_of_c tree * type_of_c)
<ketty> ?
<Captain_Fourier> hmm
<Captain_Fourier> yes
<ketty> in that case: (fun a -> fringe_c right c) has the type " 'a -> (type_of_c tree * type_of_c) "
<ketty> which is not the same as "type_of_c"
<ketty> (probably)
<Captain_Fourier> is there anyway for them to be equal
<Captain_Fourier> since type_of_c is only defined in that manner
<ketty> does the evaluation have to be delayed?
<Captain_Fourier> yes
<ketty> why?
<Captain_Fourier> the tree might be very large
<Captain_Fourier> and i dont want to process all of it
<ketty> and by delaying evaluation, in what way do you not process all of it?
<ketty> note that you can only delay evaluation until the value is needed...
<ketty> which is probably in the next recursion of fringe_c
<Captain_Fourier> right
<Captain_Fourier> the idea is to have this chain of anonymous functions
<Captain_Fourier> and as they are evaluated they reveal the value within them
<ketty> so, something like: unit -> (value * (unit -> value * (unit -> value * ( ... ))))
<ketty> ?
<Captain_Fourier> right
<ketty> that would make the exact return type of fringe_c undecidable, right?
<ketty> hmm... type returntype = unit -> (value * returntype option)
<ketty> this ok?
<Captain_Fourier> yes
<ketty> ok, than we just need to rewrite the function a bit :)
<Captain_Fourier> oh so what i want to do is possible in ocaml!
<ketty> | Leaf n -> fun () -> (n * None)
<ketty> hmm...
<ketty> Nodes hove no value attached to them?
<Captain_Fourier> nope
<Captain_Fourier> nodes just hold 2 more nodes
<ketty> hmm...
<Captain_Fourier> erm trees
<ketty> a little complicated maybe :)
dark_light has quit [No route to host]
<Captain_Fourier> hmm
<ketty> but very possible :)
<ketty> does they have to be returned in a particular order?
<Captain_Fourier> not particularly
<Captain_Fourier> so the issue is a tuple is returned or a function
<ketty> hmm..?
<ketty> probably you want to return a tuple with a value and a function..
<Captain_Fourier> right
<Captain_Fourier> my mistake
Demitar has quit ["Ex-Chat"]
WhatTheDeuce has quit ["Download Gaim: http://gaim.sourceforge.net/"]
<ketty> Captain_Fourier: .. ocaml does not allow some cyclic types by default ..
<ketty> so: type 'a return = ('a * unit -> ('a return) option))
<ketty> would be rejected...
<ketty> there is a switch to allow such types...
<ketty> ocaml -rectypes ...
<ketty> and an other workaround is to use records or variants, because there cyclic types are allowed by default...
Smerdyakov has quit ["Leaving"]
<Captain_Fourier> ok
<Captain_Fourier> ill use that
<Captain_Fourier> thanks
tristram has joined #ocaml
Captain_Fourier has left #ocaml []
Snark has joined #ocaml
Snark has quit ["Leaving"]
pango is now known as pangoafk
rovar has joined #ocaml
pangoafk is now known as pango
love-pingoo has joined #ocaml
slipstream has joined #ocaml
Sir_Diddymus has joined #ocaml
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
slipstream has quit [Read error: 104 (Connection reset by peer)]
rovar has quit ["Connection reset by pier"]
slipstream has joined #ocaml
<ski> ketty : hm .. it looked like Captain_Fourier wanted to return a stream .. i wonder if the standard streams could be used for this ?
* ketty has never used streams :)
* ski has never used OCaml's standard streams
<ski> (btw, i assume s/he was trying to convert an example from a dynamically checked language (e.g. Scheme) .. possibly from SICP or one of the Lambda papers)
<ketty> possible..
<ketty> writing a function that returned an optional new function wasn't very hard...
* ski wonders whether single-variant types, with function-constructor, is optimised to not include a tag, in OCaml
<ketty> hmm...
<ski> i.e.
<ketty> i understand..
<ski> ok
<ketty> feels like they should be optimized :)
<ski> yes .. either that, or an alternative which was guarranteed to be optimised, should be provided
<ski> (this is what haskell does .. for reasons related to laziness)
<ketty> i can't see any reason not to optimize it..
kral has joined #ocaml
Revision17 has joined #ocaml
mikeX has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
kral has quit ["Live fast, die young."]
szloto has quit [Read error: 104 (Connection reset by peer)]
Schmurtz has quit [Read error: 104 (Connection reset by peer)]
kral has joined #ocaml
szloto has joined #ocaml
slipstream-- has joined #ocaml
kral has quit ["Lunch"]
slipstream has quit [Read error: 110 (Connection timed out)]
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
ketty has quit [Remote closed the connection]
Tachyon76 has joined #ocaml
mikeX_ has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
mikeX has joined #ocaml
mikeX_ has quit [Client Quit]
mikeX has quit [Client Quit]
mikeX has joined #ocaml
CosmicRay has joined #ocaml
CosmicRay has quit [Connection timed out]
bluestorm has joined #ocaml
CosmicRay has joined #ocaml
<love-pingoo> is there still a need for function inliners for better efficiency ? any link to an inliner ?
<love-pingoo> s/function/functor/ sorry
<mattam> there was one "defunctorizer", google for Julien Signoles. I think its outdated though
<mattam> that can help performance a bit yes, he made measurements IIRC.
<love-pingoo> (\x y -> x.y@lri.fr) Julien Signoles
<love-pingoo> hihi
<mattam> he did it too!
<love-pingoo> OK the tool is named ocamldefun, and hasn't moved since 2003
<love-pingoo> I'm afraid it might not work with 3.09
<love-pingoo> I'll check that
<mattam> that's what i meant
<mattam> Julien is actually finishing his thesis, so i guess he won't update it any time soon.
Demitar has joined #ocaml
mikeX_ has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
mikeX_ is now known as mikeX
CosmicRay has quit [Connection timed out]
kral has joined #ocaml
ketty has joined #ocaml
chessguy has joined #ocaml
CosmicRay has joined #ocaml
Smerdyakov has joined #ocaml
love-pingoo has quit ["Leaving"]
CosmicRay has quit [Connection timed out]
Tachyon76 has quit ["Leaving"]
Schmurtz has joined #ocaml
Amorphous has quit ["arg... must... shutdown... computer burnin..."]
Amorphous has joined #ocaml
khaladan has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
Sir_Diddymus has quit [Read error: 110 (Connection timed out)]
CosmicRay has quit [Connection timed out]
kral has quit ["Live fast, die young."]
EsotericMoniker has joined #ocaml
CosmicRay has joined #ocaml
pango is now known as pangoafk
love-pingoo has joined #ocaml
pangoafk is now known as pango
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
finelemo1 has joined #ocaml
finelemo2 has joined #ocaml
khaladan has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
Boojum has joined #ocaml
Boojum is now known as Snark
finelemo1 has quit [Read error: 110 (Connection timed out)]
CosmicRay has quit ["Client exiting"]
__DL__ has joined #ocaml
rillig_ has joined #ocaml
kral has joined #ocaml
rillig has quit [Read error: 110 (Connection timed out)]
Snark has quit ["Leaving"]
mikeX_ has joined #ocaml
love-pingoo has quit ["Connection reset by by pear"]
mikeX has quit [Read error: 110 (Connection timed out)]
jcreigh has joined #ocaml
carrumba has joined #ocaml
romildo has joined #ocaml
<romildo> Hi.
<dylan> 'ello
<romildo> Is it possible to get a stack trace when an unhandled exception is thrown?
<pango> in bytecode easily, OCAMLRUNPARAM="b", from memory
<pango> in native mode, it requires a patch that's in bug tracker... and then you get a function calls trace, not a stack trace (slightly different)
jcreigh has quit ["Do androids dream of electric sheep?"]
<romildo> pango: thanks for the tip. I am just going to rebuild ocaml with this patch. I hope it will be useful to me while developing with OCaml.
tristram has quit [Connection timed out]
kral has quit ["ERC Version 5.1.2 (IRC client for Emacs)"]
Schmurtz has quit [Read error: 104 (Connection reset by peer)]
romildo has quit ["Leaving"]
Schmurtz has joined #ocaml
mikeX_ is now known as mikeX
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- 100,000+ downloads can't be wrong"]
mikeX_ has joined #ocaml
rillig_ has quit ["exit(EXIT_SUCCESS)"]
carrumba has left #ocaml []
mikeX has quit [Read error: 110 (Connection timed out)]
mikeX_ is now known as mikeX
CosmicRay has joined #ocaml
jcreigh has joined #ocaml
__DL__ has quit ["Bye Bye"]
dylan_ has joined #ocaml
dylan has quit [Read error: 104 (Connection reset by peer)]
Nargg_ has joined #ocaml
Nargg has quit [Read error: 110 (Connection timed out)]
jcreigh has quit ["Do androids dream of electric sheep?"]