Kinners has quit [Read error: 110 (Connection timed out)]
mr_jim has joined #ocaml
cjohnson has quit ["Drawn beyond the lines of reason"]
Hipo_ has joined #ocaml
DiabloEMN has quit [brunner.freenode.net irc.freenode.net]
reltuk has quit [brunner.freenode.net irc.freenode.net]
buggs^z has quit [brunner.freenode.net irc.freenode.net]
themus has quit [brunner.freenode.net irc.freenode.net]
gim has quit [brunner.freenode.net irc.freenode.net]
Hipo has quit [brunner.freenode.net irc.freenode.net]
xaroby has joined #ocaml
themus has joined #ocaml
reltuk has joined #ocaml
buggs^z has joined #ocaml
isomorphic has joined #ocaml
mr_jim has left #ocaml []
isomorphic has left #ocaml []
xaos has joined #ocaml
<xaos>
stupid newbie question: i have " type 'a free_tree = Leaf of 'a | Tree of 'a free_tree list;; type node = { tree: node free_tree ; ...} ;;" -- the compiler doesn't like it
<xaos>
I'm trying to make a tree of strings/objects i can hang width/depth information off of. I think i'm just stuck in a C-mindset =)
xaos is now known as jbm____
<jbm____>
err, wait, nevermind. i'm just a moron
jbm____ has quit ["there _is_ such a thing as a stupid question. doh."]
<pattern>
is it possible to use map to perform the logical OR operation on a list of booleans? (i don't want to know the actual code to do this, just if it's possible)
<pattern>
there should be no postprocessing of the list after the map function is done
<pattern>
so, the result of "map f [true;false]" should be true, somehow, for some mysterious function f
<pattern>
even though map returns a list
<pattern>
doesn't sound possible to me, unless f itself contains some sort of private variable that gets updated when it evaluates its argument as true
<pattern>
or something
<DiabloEMN>
hum, doesn't applies just on each element of the list?
<DiabloEMN>
you should use a folder
<pattern>
map does indeed apply on each element of hte list
<pattern>
yeah, but the problem is to use map
<pattern>
it's an exercise
<mellum>
Considering the type of map, it's obviously not possible.
<pattern>
and i think the author must have not explained what he meant correctly, or somehting
<pattern>
mellum, well, it's clearly not possible to change its return type... i thought it might be possible as a side-effect, though
<pattern>
it's either that or it's not possible at all, from where i'm sitting
<mellum>
pattern: That's possible, but it doesn't make a lot of sense.
<pattern>
no, it doesn't, does it?
<pattern>
oh, wait!
<pattern>
i misread the exercise... it was to use a fold like function after all
<pattern>
bleh, it's late
<DiabloEMN>
well, with fold it makes much more sense...
<pattern>
well, it was fun trying to figure that out
<pattern>
yeah
<pattern>
with fold it's obvious
<karryall>
pattern: the "problem" with fold is that you're going to scan all the list whereas you might want to stop as soon as you encounter a true value
Tamagucci has joined #ocaml
smklsmkl is now known as smkl
cjohnson has joined #ocaml
cjohnson has quit [Client Quit]
cjohnson has joined #ocaml
cjohnson has quit ["Drawn beyond the lines of reason"]