mfp has quit [Read error: 60 (Operation timed out)]
cads has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Ched has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
cads has quit [Read error: 113 (No route to host)]
sOpen has quit [Remote closed the connection]
tar_ has joined #ocaml
sgnb has quit [Remote closed the connection]
sgnb has joined #ocaml
tar_ has quit []
bohanlon has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
prime2 has joined #ocaml
prime2 has quit [Client Quit]
<eut>
is it possible to match for (a, b) c?
<thelema>
how is c connected?
<mrvn>
Match (x,y) with (a,b), c)
<mrvn>
+(
<eut>
hmm
<eut>
is there a way to match without putting c in the tuple?
<eut>
is there an equivalent match for: let f (a, b) c = ...;;? something like let f = function ...;;?
<thelema>
no, the function keyword only allows one argument, and let f (a,b) c = ... defines a function with two keywords
verte has joined #ocaml
<eut>
is there another method that can be used to match more than one argument?
<mrvn>
no
<mrvn>
let f (a, b) c = ... also needs let f = function (a, b) -> function c ->
<eut>
ah so i can just chain them together like that
<thelema>
yes, functions that take multiple values are really just functions that return other functions...
<thelema>
i.e. int -> int -> int == int -> (int -> int)
<eut>
ok, that makes more sense
<eut>
i had been told that functions only took one argument but read in some tutorial that they could take multiple ones
<mrvn>
let f x y = or let f = fun x y -> is just syntactic suggar.
<mrvn>
You can even do things like this: # let f = function x -> Printf.printf "x = %d\n" x; function y -> Printf.printf "y = %d\n" y; function z -> Printf.printf "z = %d, sum = %d\n" z (x+y+z);;
<mrvn>
val f : int -> int -> int -> unit = <fun>
<mrvn>
# let g = f 1;;
<mrvn>
# let h = g 2;;
<mrvn>
y = 2
<mrvn>
x = 1
<mrvn>
val g : int -> int -> unit = <fun>
<mrvn>
val h : int -> unit = <fun>
<mrvn>
# h 3;;
<mrvn>
z = 3, sum = 6
<mrvn>
- : unit = ()
<eut>
what is the meaning of the ';' operator in your initial let statement?
<thelema>
eut: it's a sequencing operator -- [x; y] means do x, throw away the result, then do y.
<thelema>
(you'll get a compiler warning if x doesn't return unit)
<eut>
ok that makes sense
<thelema>
There's an implied (and return its value) at the end of that explanation
<eut>
how can i match for a symbol list list?
<eut>
[head]::tail?
<eut>
erm, [head]::tail doesnt seem to work for me
<thelema>
match h::t -> print_int h; foo t
* thelema
unbutchers his syntax
<thelema>
match lst with [] -> () | h::t -> print_int h; loop t
<eut>
print_int?
<thelema>
print_int prints an integer.
<thelema>
ocaml is strongly typed, with no overloading. Thus print_int
<eut>
what if lst = [[1;2;2];[3;3;3];[4;3;2]]?
<thelema>
then you couldn't use print_int, as h would be a list itself.
<thelema>
you could of course, write more code to handle h as a list.
<eut>
match lst with [] -> ( | h::t -> print_int h | [h]::t -> print_int (List.nth h 0); loop t?
<thelema>
no, the head of lst can't be both an int and a list
<eut>
how can you match for both int and list in the same match clause?
<thelema>
It could be a variant type like this: Int of int | IList of int list
<thelema>
match h with Int i -> print_int i | IList [] -> () | IList (h2::_) -> print_int h2
<eut>
hmm
<thelema>
For me, the safety gained by this programming style more than compensates for the ability to just print anything and have it stringify.
<mrvn>
It also speeds up the code a lot.
<mrvn>
and saves ram
<eut>
is there a way to do it without a variant type?
<thelema>
have a list with mixed values in it? Yes, but variants are the simplest and usually best way.
<eut>
function [] -> () | h::t -> print_int h | <something>::t print_int (List.nth h 0)?
<thelema>
eut: nope. Once you have [| h::t -> print_int h], the list is definitely a list of integers.
<mrvn>
thelema: actualy no you can never have a list with different values in it.
<eut>
yeah i see
<eut>
so my question makes no sense
<mrvn>
eut: In ocaml both 0 and [] are stored as 0. How then would ocaml know if you have [1;2;0] or [1;2;[]]?
<eut>
it wouldnt
<mrvn>
(Although the reason 0 and [] are both stored as 0 is that that question can never happen)
<mrvn>
s/are/can be/
<thelema>
mrvn: well, there's a variety of embeddings of the universal type in ocaml, usually with types resembling unit -> unit, but to first approximation you're right
<thelema>
mrvn: actually, they're both stored as 1. :)
<mrvn>
thelema: which means you make the types the same.
<mrvn>
thelema: ups. same difference.
<thelema>
you kind-of have a list with different values in it. It just happens that they're stored as unit->unit closures.
<mrvn>
thelema: no, you have a list of (unit -> unit) closures. All the same type. :)
<mrvn>
You can (and have to) hide different types inside cosures of the same type. That is the trick.
tonasinanton has left #ocaml []
<mrvn>
eut: What you can do is write functions that can handle lists of different types. like List.iter print_int [1;2;3] and List.iter print_float [1.1;2.2;3.3]
<thelema>
we're arguing semantics - you're right that the type of all the elements in a list has to be the same. And I'm right that you can construct a list "with mixed values in it", through hiding the values from the type system.
<eut>
i'm just essentially trying to do a depth first search of a tree in list form
<eut>
or depth first traversal.. not search
<mrvn>
for that you need to know the depth of the tree.
<mrvn>
i.e. how many 'a list list ... list you have.
<eut>
i was thinking its possible to keep expanding as long as the head is a list
<eut>
or not an 'atom' (coming from lisp)
<mrvn>
which can't be typed.
<mrvn>
You can use type tree = Leaf of int list | Node of tree list
<mrvn>
or type tree = Leaf of int ....
willb1 has quit [Read error: 110 (Connection timed out)]
<eut>
type tree = Leaf of int | Branch of int list?
<eut>
what if i wanted to make it of 'a list? would this work: type tree = Leaf of 'a | Branch of 'a list
<mrvn>
let rec traverse = function Leaf x -> print_int x | Branch of list -> List.iter traverse list
<mrvn>
eut: No, Branch of tree list
<eut>
ah i see
<mrvn>
You want to allow for Branch [Branch [Leaf 1; Leaf 2]; Leaf 3]
<mrvn>
for 'a you need type 'a tree = Lead of 'a | Branch of 'a tree
<thelema>
type 'a tree = Leaf of 'a | Branch of 'a tree list
<mrvn>
list
<mrvn>
yes
<eut>
syntax error at 'of' in Branch of
<eut>
in let rec traverse...
<thelema>
no 'of' when doing matching
<mrvn>
-of, sorry.
<eut>
how do i create the tree to pass in?
<mrvn>
Usualy you would have an empty tree and then you insert things.
<mrvn>
let empty = Branch []
<mrvn>
But you can give a tree verbatim like Branch [Branch [Leaf 1; Leaf 2]; Leaf 3]
<eut>
ah
<eut>
its starting to make more sense
<mrvn>
Other people use a treetype like type 'a tree = Nil | Node of 'a tree * 'a * 'a tree.
<mrvn>
That is more like lists where you have [] as end-of-list marker.
<eut>
what about: type ('a, 'b) symbol = B of 'a | L of 'b?
<eut>
where B is branch and L is leaf
<thelema>
what type would the following have: B [ B [ L 1; L 2]; L 3] ?
<mrvn>
no recursion in the type so you end up with a specific type for every tree.
<mrvn>
# B [ B [ L 1; L 2]; L 3];;
<mrvn>
- : ((('a, int) symbol list, int) symbol list, 'b) symbol =
<thelema>
eut: not what you expected, I think.
<mrvn>
type 'a tree = B of 'a tree list | L of 'a
<mrvn>
# B [ B [ L 1; L 2]; L 3];;
<mrvn>
- : int tree = B [B [L 1; L 2]; L 3]
<mrvn>
See the difference?
<eut>
ah yeah right
<mrvn>
You can have ('a, 'b) tree or ('a, 'b, 'c, 'd, 'e, 'f, 'g) whatever. But here that just isn't neded.
<mrvn>
if you can code that then I want one.
<mrvn>
ups.
<eut>
:]
seafood has quit []
Alpounet has joined #ocaml
jeddhaberstro has quit []
mishok13 has joined #ocaml
sOpen has joined #ocaml
<sOpen>
is it possible to declare recursive function types? Like: 'a t -> 'a t -> 'a t... I am trying: let cap = (let rec ic = (fun lst -> function Some x -> ic (x :: lst) | None -> lst) in ic []);; and I don't understand the type error.
<sOpen>
I've played around without the Option monad, too. I don't think using it is the right way because it means the function signature terminates which is wrong.
<sOpen>
# let cap = (let rec ic = (fun lst x -> ic (x :: lst)) in ic []);; (* is the alternative that also doesn't work *)
<mrvn>
sOpen: ic is a function taking 2 arguments. If the second is Some x you return a function, if the second is None you return a list
<sOpen>
mrvn, yes. :-( How about: let cap = (let rec ic lst x = ic (x :: lst) in ic []);; ?
<sOpen>
repl says "This expression has type 'a -> 'b but is here used with type 'b" but 'a -> 'b == 'b
<Alpounet>
Hi everybody.
<mrvn>
no, 'a -> 'b is not 'b
<sOpen>
mrvn, why not?
<mrvn>
Because one is 'a -> 'b and the other is 'b
<sOpen>
ultimately i want 'a -> 'a -> 'a ...
<mrvn>
% ocaml -rectypes
<mrvn>
# let rec ic lst x = ic (x :: lst);;
<mrvn>
val ic : 'a list -> ('a -> 'b as 'b) = <fun>
<mrvn>
why is x a function?
<mrvn>
never mind, x is the 'a
<sOpen>
mrvn, yeah... that works like i want!
<sOpen>
What is this rectypes arg? man page is silent
<mrvn>
sOpen: You have to wrap that into a type to get around the type recursion.
<mrvn>
sOpen: -rectypes lets ocaml look for implicit recursive types.
<sOpen>
mrvn, what's the trade-off? why isn't rectypes always on?
<mrvn>
because normaly one doesn't want to write code like that
<mrvn>
sOpen: What would you do with a type like that? You could never do anything sensible with it.
<sOpen>
mrvn, i'm trying to figure that out... just exploring
pierre_m has joined #ocaml
<mrvn>
With rectypes you can do a nice continuation style based cooperative multitasking in ~3 lines.
<sOpen>
mrvn, :-)
<mrvn>
defining an actual type thread = ... and doing it without rectypes adds a few lines but is so much more readable.
<sOpen>
mrvn, yes... i certainly don't have a use that /cannot/ be done with normal types. I'm thinking about state machine DSLs.
acatout has quit ["leaving"]
acatout has joined #ocaml
verte has quit [Read error: 110 (Connection timed out)]
verte has joined #ocaml
s4tan has joined #ocaml
<Camarade_Tux>
is it possible to call the array pretty-printer function from another one in the toplevel : I have a hash table which holds an array per-element and would like to display it gracefully
<Alpounet>
why wouldn't it be possible ?
<Camarade_Tux>
because I have beautiful eyes ? :)
<Camarade_Tux>
or simply because it can be handy ;)
<Alpounet>
If you have an array pretty printer function, I think there's no problem with calling it, as long as you've loaded your function's module.
<Camarade_Tux>
no, I mean, not mine but ocaml's built-in
<Camarade_Tux>
another solution would be to make a hashtbl pretty-printer so ocaml would automatically calls the array one
komar_ has joined #ocaml
<Camarade_Tux>
except that ocaml does not want to use because Hashtbl.t is abstract =/ (well, I'll see that later on)
babalu has joined #ocaml
<babalu>
hi, does someone know how to do a sleep in microseconds in ocaml ?
<babalu>
or at least miliseconds
<babalu>
milli*
<Camarade_Tux>
last time I needed one, I wrote a C-binding (was about one line, two at most)
<Camarade_Tux>
iirc the problem is there is no cross-platform way to do one
<mrvn>
"Of course, all this SMP support stuff slows down the runtime system
<mrvn>
even if there is only one processor, which is the case for almost all
<mrvn>
our users..." is just plain wrong nowadays
chahibi has joined #ocaml
jamii__ has joined #ocaml
<sOpen>
yeah... multicore is everywhere. ocaml and python seem to be fighting the same demons
<flux>
while it may be (and I think it is) true that shared memory approach won't scale beyond 8 cores, it'd be nice to have support for it while we're still in that space :)
alp_ has joined #ocaml
<flux>
but I wonder how to architect software if you have, say, 64 cores, and for best performance you just can't just share everything. does it make sense to have multiple clusters of 8 cores with shared-everything while the clusters don't share between each other?
<flux>
in the end, message passing might just turn out to be more feasible
<flux>
too bad I haven't heard much of the project that was supposed to bring multicore-gc to ocaml
Alpounet has quit [Read error: 60 (Operation timed out)]
<sOpen>
flux, i've programmed on the Tile64 and message passing between cores was 1-4 cycles depending on what bus you use
<flux>
sopen, too bad such primitives don't seem to exist in the intel/amd world
<sOpen>
it may not be the winning design but it scales a hell of a lot better than crossbars
<sOpen>
flux, intel has an 80-core chip in r&d... i don't know how it handles shmem
<flux>
well, Sun released (?) their 64-core offering
<flux>
supposedly people run Java on those machines. I wonder how it works, then. Running a single jvm in 64 cores would basically be a shared-everything environment.
<flux>
but perhaps they run multiple jvms then.
<sOpen>
the sun chip is 8 cores with 8-way in-core threading
<thelema>
let est_interdit_triplet (a,b,c) = est_interdit a && est_interdit b && est_interdit c
<mrvn>
with "in" the est_interdit_triplet is a subfunction of est_interdit so you would have to end with "in something;;"
<Nucleos>
arf
<Nucleos>
yes of course.
<mrvn>
thelema: any idea how goo ocaml is at seeing that linterdits is a constant?
<Nucleos>
Thanks for the help! I was really staring at the code... couldn't find anything
<mrvn>
-l
<thelema>
in ocaml, you can have a bunch of toplevel phrases: [let v = val;; let v2 = val2;; let v3 = val3;;] (with or without the ;;s)
<Nucleos>
(thelema, you're right, my code if obfuscated.)
<Nucleos>
:)
<thelema>
or you can have one toplevel phrase: [let v = val in let v2 = val2 in let v3 = val3 in val4;;] (with or without the ;;s
<thelema>
once you have 'in', you have to have a final expression for which your binding is defined 'in'.
<thelema>
(i.e val4)
<thelema>
the scope is no longer the rest of your source file.
<thelema>
one could use the phrases 'local binding' vs. global binding, but that's not quite right
<thelema>
mrvn: what would you want ocaml to do with linterdits as a constant? I don't see any easy way to propogate it.
* Nucleos
has finally understood [ ] are no actual part of ocaml coding
<Nucleos>
thelema, the thing is, when you use the "promptline" that you may want to define first a, then define a function f of a. With Ocaml, you must specify you are actually declaring a function, then you can declare a, then you can use it in the body of the function.
<Nucleos>
only a question of syntax... doesn't matter.
<thelema>
"promptline" = "toplevel"
<thelema>
as to compiled vs. toplevel, the same code works - the rules are exactly the same.
<thelema>
I guess there's an implied ;; at the end of code to be compiled
<Nucleos>
thelema, I did think that way : i want to define foobar, then use it.
<Nucleos>
I understood that you may define foobar globally then use it.
<thelema>
but if you take any sequence of "commands" at the toplevel and put them into a file, you'll get the same result (except for the toplevel's nice printing of return values)
<Nucleos>
I understood also you may define it locally.
<thelema>
both work, yes.
<Nucleos>
I wanted to "press Enter" (= evaluate) and have my function.
<Nucleos>
In the toplevel, you have to press Enter twice if you use the first method.
<Nucleos>
I know it makes quite no sense to talk about that.
<thelema>
huh? enter twice?
<Nucleos>
never mind.
<thelema>
the toplevel knows to start evaluating by ";;"
<thelema>
you can give it as much code as you want, and it'll evaluate it all once it sees ;;
<Nucleos>
see that : [let test var = let b = 5 in var = 5;;] You may want to do that : [let b = 5;; let test var = var = 5;;]
<Nucleos>
In the toplevel you can't write it at once, then press Enter.
<Nucleos>
Syntax error : in the toplevel you can't "chain" 2 <;;>
<thelema>
# let b = 5;; let test var = var = 5;;
<thelema>
val b : int = 5
<thelema>
on my computer, it seems to have skipped everything after the first ;;
<Nucleos>
right.
<Camarade_Tux>
btw, has mlbot appeared on the channel yet ?
<Nucleos>
thelema, thus you have to either first know what you're doing, either "press twice the button"
jeanb-- has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
jamii__ has quit [Read error: 60 (Operation timed out)]
<mrvn>
thelema: create the data for interdits once and don't call a bunch of cons at runtime.
rogo has quit ["Leaving."]
verte has quit [":("]
s4tan has quit [Client Quit]
Ariens_Hyperion has joined #ocaml
ttamttam has joined #ocaml
ttamttam has left #ocaml []
_zack has joined #ocaml
BiDOrD has quit [Read error: 60 (Operation timed out)]
oriba has left #ocaml []
BiDOrD has joined #ocaml
mishok13 has quit [Success]
jeddhaberstro has joined #ocaml
rjones has joined #ocaml
rjones has left #ocaml []
rwmjones has quit [Remote closed the connection]
komar_ has quit [Read error: 113 (No route to host)]
Komar_ has joined #ocaml
hsuh has joined #ocaml
dejj has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
<Nucleos>
flux, how can i know when i'm allowed to use "and"?
<bluestorm>
Nucleos: type trou = Trou of (trou * trou) option
<vuln>
aij: it can't be 'a, 'cause there's no overload of operators in Ocaml
<vuln>
:(
<flux>
nucleos, well, you could read the language specification from the manual
<Alpounet>
vuln, neither for functions
<aij>
vuln: you just tried to write an overloaded function
<Nucleos>
flux, i see.
<vuln>
aij: yes
<vuln>
That's my goal :P
<vuln>
Can't I ?
<bluestorm>
you can't
<aij>
no, there's no overloading in ocaml
<Nucleos>
flux, anyway i'm glad. :)
<vuln>
:(
<aij>
operators are just functions that happen to be inline
<Alpounet>
infix ?
<flux>
nucleos, in addition to bluestorm's suggestion you could do: type 'a gauche = { gauchy : 'a; droite : 'a } type trou = Neant | Gauche of trou gauche
<aij>
Alpounet: ack, yes
<vuln>
I thought parametric polimorphism extended including to allow a function behaves differently given different args
<vuln>
At first, Ocaml looked awkward to me. No reason to learn it
<vuln>
But my point of view has changed a lot lately.
itewsh has joined #ocaml
<flux>
vuln, what affected it the most?
<vuln>
flux: I'm sorry?
<vuln>
What made me think like that?
<flux>
you changed your point of view changed a lot lately. what made it change?
<vuln>
flux: Ocaml Learning :)
<vuln>
It's too easy talk bad about something when you don't know it
<vuln>
My major is Computer Engineering. However, I go some classes in other departaments like Computer Sciense. And CC departament is who wanna teach us Ocaml
<vuln>
So everybody says: It's a language to go ahead at the univ, but you will throw it away after 6 months
<vuln>
All students say the same, that it's horrible and stupid and stuff like that
<vuln>
Maybe 'cause some teachers say the same, OR 'cause they're too dumb to recognize a good programming language
<olegfink>
I wish they'd teach us ocaml here.
<Alpounet>
+1.
<olegfink>
you know, java isn't exactly my definition of 'fun'
<vuln>
olegfink: 70% of the classes EVERY period get reproved.
<vuln>
I have veterans of veterans of mine studying in my class haha
hkBst has quit [Read error: 104 (Connection reset by peer)]
<vuln>
But, IMHO, is not the case about Ocaml be good or not. I think it's perfect in the course 'cause: It has several new implementations (modern ones) and a lot of concepts and techniques to program
* Nucleos
never understood why people are so contemptful with bad students.
<Alpounet>
doesn't Unix.close_process "kill" the process ?
<vuln>
The name of the matter is: Concepts and Tecnics of Programming
<vuln>
So, Ocaml is the most perfect programming language for it
<Ariens_Hyperion>
contemptful??
<vuln>
And it's too easy as first language (at least its base)
<vuln>
I always studied imperative languages, so it was hard at first time to me. It was my first reason to 'hate' Ocaml
<vuln>
But today, I have a new part of my brain thinking how I can solve problems differently
<vuln>
and sometimes even better than I could before know Ocaml.
<vuln>
I think I'm the only person in my class that say: I like Ocaml.
<vuln>
Just to you know how 'strong' the influence of the olders are :)
<vuln>
But I have to say I'm ansious for C in the next period haha
<olegfink>
after my first year or so studying ocaml in high school, my friends would give me strange looks looking at my C code full of recursive functions and stuff.
<vuln>
God, I talk too much ;x
<vuln>
olegfink: I couldn't solve my first exercise list without change states or iterations haha
<Ariens_Hyperion>
that has to change!!
<vuln>
The teacher was writing a question to list numbers and before he finish it, I was already writing some code with while
<vuln>
haha
<vuln>
Ariens_Hyperion: It already changed :)
<vuln>
thanks Lord
<vuln>
hehe
<vuln>
But the 'course' is really hard. I mean, I didn't get as well as I wanted in the exam..
<vuln>
I can imagine how people who have never studied language programming were..
<vuln>
I wanted 10 of course :P
<vuln>
haha
* Nucleos
's just learned the word 'contemptful' doesn't exist in a dictionary. One says 'to hold sb in contempt'. / to be scornful
<vuln>
But things are getting better now. Recursivity, Pattern-Matching and all the good stuff are starting now :D
<olegfink>
I have a small students project: get used to apl/j/k/q and then try going back to java classes. bwahaha!
<vuln>
hahaha
<vuln>
I want to do something AWESOME in Ocaml before finishs the matter.
<vuln>
In each specific matter. I'm going to project a bomb in Digital Circuitos
<vuln>
MUAHAHAHA
<vuln>
XD
<vuln>
Circuits*
<hsuh>
vuln: q estado?
<Ariens_Hyperion>
I wish I could use ocaml with cocoa to do something awesome
<Alpounet>
Damned. How can I kill a process ?
<vuln>
hsuh: RN
<vuln>
Alpounet: in Ocaml?
<Alpounet>
yeah
<Alpounet>
Unix.close_process waits for the process to terminate
<Smerdyakov>
vuln, good. Pick a book, and don't let yourself use _any_ feature you haven't read about it.
<Smerdyakov>
s/about it/about yet
bluestorm has quit [Remote closed the connection]
<vuln>
Smerdyakov: Well, thanks :)
<vuln>
I'm glad you're thinking beyond just help me now
<vuln>
but I also thank you m3ga hehe
<olegfink>
m3ga, if you insist on unions, you should probably add that they have a 'type tag' associated.
<m3ga>
to be honest i have never read more than about 5 contiguous pages of any ocaml book :-)
<kaustuv_>
I've never read even a single page of any OCaml book.
<Smerdyakov>
Some people get it easily. Some don't.
<m3ga>
olegfink: i don't mention the type tag but do mention that the compiler won't let you get it wrong.
<Smerdyakov>
But everyone should read instead of asking what a language feature is.
oof has joined #ocaml
<oof>
hello
<m3ga>
sometimes its useful to ask what it is. for vuln, the answer should have been "go to you book and read about variant types'.
<olegfink>
I've found out that calling them 'algebraic' instead of 'variant' greatly helps understanding.
<Nucleos>
Smerdyakov, i agree with m3ga : there's no question you should not ask.
<Smerdyakov>
m3ga, I disagree. Authors of books put lots of effort into choosing the right order in which to introduce material. Asking what a language feature is shows that you aren't following an expert's chosen order, and your order is probably inferior pedagogically.
<m3ga>
'alegbraic' always confused me while 'variant' was immediately obvious
<vuln>
=[
<vuln>
:)
<kaustuv_>
The problem is there are at least two distinguishable interpretation for "variant", and even the manual is not 100% on either side.
<olegfink>
might be; at least it might help that some of the type operators have a familiar algebraic nature, such as '|' and '*'
<Smerdyakov>
olegfink, those operators don't have the meanings you have in mind, for a large fraction of the people who want to learn OCaml.
<Smerdyakov>
Anyone who learns best by analogies to higher math isn't going to have any trouble learning OCaml, and thus it's pointless to think about how to help them learn.
jeanbon has quit [Connection timed out]
<Nucleos>
Smerdyakov, my math teacher doesn't agree with you. Anyway, you seem to live in a perfect world where everyone follows the rule, where everyone sticks to the advance of a book, etc. Happily, people tend to be less attracted to rigidity. I know it has some backwards, but that's the way it is.
<Smerdyakov>
Nucleos, it's not so happy that people impede their own learning.
<Smerdyakov>
Nucleos, people can do whatever they want. People who don't like to read rarely end up using ML.
<olegfink>
well, I see your point.
<vuln>
Smerdyakov: Can you give me a line which will return a' -> b' -> c' ?
<Smerdyakov>
vuln, are you asking me to do your homework?
<vuln>
Smerdyakov: no
<vuln>
I don't think would be a question like that
<Smerdyakov>
vuln, here is a definition of a function with that type: let rec f x y = f x y
<vuln>
thanks Smerdyakov
<vuln>
I'm just reading ocaml book and I remebered about an example like this that the professor show in class
Symmetry- has joined #ocaml
<Symmetry->
hello
jedai has joined #ocaml
<vuln>
hello :)
Ched has quit ["Ex-Chat"]
mjambon has joined #ocaml
<hsuh>
another day this guy asked why aren't all functions implicitly "let rec"s ... what would be the answer to that?
<Nucleos>
i think the valid one: yes we could do that, but it has drawbacks, so we thought it was best that way.
prime2 has quit ["leaving"]
Nucleos has quit ["Quitte"]
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
Yoric[DT] has quit ["Ex-Chat"]
kaustuv_ has quit ["e9769a5a3a9575c93219232b4da34123"]
jamii has quit [Read error: 113 (No route to host)]
deech has joined #ocaml
hsuh has quit [Read error: 110 (Connection timed out)]