<sepp2k>
Does it say what r x shall contain/what their type is supposed to be?
<sepp2k>
*r and x
<sepp2k>
Because I don't see why the function takes three arguments (instead of just the predicate and the list)
<mikeK_>
ah I figured it out
<mikeK_>
let all_pred_rec p r x = if ( p x ) then r else false;;
<sepp2k>
Ah, right, all_pred_rec was supposed to be the argument to fold_left, not the function invoking fold_left.
<sepp2k>
Though in that case it's even more stupidly named...
julm has quit [Ping timeout: 265 seconds]
fremo__ has quit [Ping timeout: 265 seconds]
fremo__ has joined #ocaml
<mikeK_>
yea :/
julm has joined #ocaml
mjonsson has joined #ocaml
Edward has quit []
aj2009 has joined #ocaml
mikeK_ has quit [Quit: Page closed]
ccasin has quit [Quit: Leaving]
tautologico has quit [Quit: Leaving]
tab has quit [Ping timeout: 264 seconds]
tab has joined #ocaml
_unK has quit [Remote host closed the connection]
valross has joined #ocaml
rks has quit [Ping timeout: 245 seconds]
rks has joined #ocaml
yangsx has left #ocaml []
jakedouglas has quit [Quit: Leaving.]
aj2009 has quit [Quit: Leaving]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 252 seconds]
LionMadeOfLions has joined #ocaml
valross has quit [Ping timeout: 272 seconds]
valross has joined #ocaml
ulfdoz has joined #ocaml
joewilliams is now known as joewilliams_away
Modius has quit [Read error: Connection reset by peer]
Modius has joined #ocaml
mjonsson has quit [Ping timeout: 240 seconds]
jakedouglas has joined #ocaml
ikaros has joined #ocaml
ikaros has quit [Client Quit]
ikaros has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
jakedouglas has quit [Quit: Leaving.]
sepp2k has quit [Quit: sepp2k]
ftrvxmtrx has quit [Quit: Leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
ygrek has joined #ocaml
asmanur has quit [Read error: Operation timed out]
asmanur has joined #ocaml
ViciousPlant has joined #ocaml
Amorphous has quit [Ping timeout: 276 seconds]
Amorphous has joined #ocaml
joewilliams_away is now known as joewilliams
ftrvxmtrx has joined #ocaml
boscop_ has quit [Quit: OutOfTimeException: Allocation of TimeFrame failed due to lack of time. Terminating...]
boscop has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
joewilliams is now known as joewilliams_away
avsm has joined #ocaml
joewilliams_away is now known as joewilliams
barismetin has joined #ocaml
_unK has joined #ocaml
avsm has quit [Quit: Leaving.]
joewilliams is now known as joewilliams_away
rgrig has joined #ocaml
<rgrig>
Is there a way to make "let f g = f 1; f 'x' in f ignore" type check?
<flux>
module rec Foo : sig val f : 'a -> unit end = struct let f g = Foo.f 1; Foo.f 'x' end
<flux>
(and then: Foo.f ignore)
<flux>
afaik 3.12 can express that without recursive modules
<rgrig>
thanks!
ViciousPlant has quit [Read error: Operation timed out]
ygrek has joined #ocaml
_andre has joined #ocaml
th5 has joined #ocaml
ttamttam has joined #ocaml
valross has quit [Quit: Ex-Chat]
snarkyboojum has joined #ocaml
chee has quit [Ping timeout: 245 seconds]
komar_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
avsm has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
komar_ has quit [Ping timeout: 240 seconds]
mjonsson has joined #ocaml
mjonsson has quit [Ping timeout: 255 seconds]
sepp2k has joined #ocaml
jakedouglas has joined #ocaml
ccasin has joined #ocaml
barismetin has quit [Remote host closed the connection]
grettke has joined #ocaml
joewilliams_away is now known as joewilliams
CoryDambach has joined #ocaml
avsm has quit [Ping timeout: 276 seconds]
init1 has joined #ocaml
rgrig has quit [Quit: Leaving]
joewilliams is now known as joewilliams_away
avsm has joined #ocaml
joewilliams_away is now known as joewilliams
komar_ has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ttamttam has left #ocaml []
avsm has quit [Quit: Leaving.]
komar_ has quit [Ping timeout: 240 seconds]
komar_ has joined #ocaml
ikaros has joined #ocaml
ftrvxmtrx has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
chee has joined #ocaml
Edward__ has joined #ocaml
komar_ has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
ygrek has joined #ocaml
th5 has quit [Ping timeout: 276 seconds]
Yoric has quit [Quit: Yoric]
komar_ has joined #ocaml
Edward__ has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Read error: Connection reset by peer]
Edward_ has joined #ocaml
ftrvxmtrx has joined #ocaml
init1 has quit [Quit: Quitte]
oriba has joined #ocaml
jakedouglas has quit [Ping timeout: 240 seconds]
komar_ has quit [Quit: leaving]
uho has joined #ocaml
<uho>
I can't figure out why this keeps returning an empty list, any ideas? http://pastie.org/1158946
<uho>
im trying to learn continuation passing style btw
<flux>
well, what else can it return but an empty list?
<flux>
if the list is empty, it returns an empty list
<sgnb>
uho: you can trivally prove by induction on the first argument that it always returns the empty list
<flux>
otherwise it calls itself with a list that has the first argument removed
<flux>
eventually the list becomes empty
<sgnb>
uho: you should call your continuation in the [] case!
<sgnb>
(as in f [] )
<adrien>
"execute" your code on paper with a 1-element list ;-)
<flux>
wish ocaml #trace provided more output
<flux>
but in principle it should be a great tool for this kind of situation :)
<uho>
sgnb, that worked. I'm trying to figure out why. Basically right now, my thought process is that the empty list returns to (fun a -> f ... and toPolar gets added to it, and then passed to the next call and so forth.
<uho>
but this is obviously wrong, what am I misunderstanding about my structure?
<sgnb>
the skeleton is right, but you are completely forgetting the continuation in the nil case
<sgnb>
when you program in CPS style, you should always either call a CPS style function, or call a continuation
<flux>
uho, perhaps it's helpful to look at the signature of the function
<sgnb>
think of your continutation as "return" in C
<uho>
thanks, ill try to see if i can figure it out
gene9 has joined #ocaml
gene9 is now known as as
as has quit [Quit: Leaving]
oriba has quit [Remote host closed the connection]