cdidd has quit [Remote host closed the connection]
ahokaomaeha has joined #ocaml
mcsquiggedy has quit [Ping timeout: 276 seconds]
LukeSun1 has joined #ocaml
LukeSun has quit [Ping timeout: 252 seconds]
gnuvince has quit [Ping timeout: 256 seconds]
rwmjones has quit [Read error: Operation timed out]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
tac has joined #ocaml
rwmjones has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
ahokaomaeha has quit [Ping timeout: 245 seconds]
adotbrown has quit [Ping timeout: 276 seconds]
ManAmongHippos has joined #ocaml
adotbrown has joined #ocaml
parlancho has quit [Ping timeout: 256 seconds]
emmanuelux has quit [Remote host closed the connection]
LukeSun1 has quit [Quit: Leaving.]
ahokaomaeha has joined #ocaml
gnuvince has joined #ocaml
yacks has joined #ocaml
groovy2shoes has quit [Quit: Computer has gone to sleep]
tac has quit [Quit: Page closed]
tac has joined #ocaml
tac has quit [Quit: Page closed]
tac has joined #ocaml
tac has quit [Quit: Page closed]
clan has joined #ocaml
ahokaomaeha is now known as nishidabianya
groovy2shoes has joined #ocaml
Yoric has joined #ocaml
silkwood has joined #ocaml
silkwood has quit [Client Quit]
silkwood has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
silkwood has quit [Quit: Ex-Chat]
groovy2shoes has quit [Quit: Computer has gone to sleep]
dabd_ has quit [Read error: Operation timed out]
andreypopp has joined #ocaml
yacks has joined #ocaml
adotbrown has quit [Ping timeout: 252 seconds]
ro_ has quit [Quit: Quitte]
andreypopp has quit [Quit: sleep]
answer_42 has joined #ocaml
osa1 has joined #ocaml
<osa1>
is there a way to override to_sexp function of some data types ?
<orbitz>
define it yourself
<orbitz>
the camlp4 isn't doing anything magical
<osa1>
orbitz: ok. how can I define it myself ? do we have an API for this ?
<osa1>
I can't find sexplib documentations
<osa1>
oh and if I define it myself I have to remove `with sexp` part, right ? I have some big data types connected with `and`s and I want to override only one of them
<flux>
interesting case, I wonder if that has been taken into account :)
<flux>
maybe you can define some of the parts seprately in a polymorphic way and then 'un-polymorphize' them with the and clause
<flux>
(type 'a bar = Bar of int | Baz of 'a where 'a is the part you want to refer recursively)
<osa1>
flux: do you know where is the API documentation for generating sexps ?
<flux>
sexplib.mli probably
<flux>
or some other file $(ocamlfind query sexplib)/*.mli
<osa1>
what does that line mean: " include Sexp_intf.S " ?
<osa1>
it's the only line in sexplib.mli
yacks has quit [Ping timeout: 245 seconds]
<flux>
find module Sexp_intf and its module type S
<osa1>
ok I found it
<pippijn>
also, it copies all declarations from that module type
<osa1>
I think it may work if I just generate a string with sexp syntax from my data type and call of_string
ontologiae has joined #ocaml
<osa1>
oh noes and I have to define data_type_of_sexp too
<osa1>
even if I never use it. maybe I can just put something as placeholder
ontologiae has quit [Ping timeout: 252 seconds]
<pippijn>
let data_type_of_sexp sx = Some (Dummy, Value)
<pippijn>
or:
<pippijn>
let data_type_of_sexp = let v = Some (Dummy, Value) in fun sx -> v
<pippijn>
where v is a data_type
yacks has joined #ocaml
ttamttam has joined #ocaml
ManAmongHippos has quit [Quit: ManAmongHippos]
Cyanure has joined #ocaml
<osa1>
strange, all I do is moving a type declaration with `and ...` to somewhere before that part and replace that `and` with `type`. but now I'm getting this error: Error: This function is applied to too many arguments;
cdidd has joined #ocaml
Cyanure has quit [Ping timeout: 244 seconds]
<osa1>
what's wrong with this code: http://hpaste.org/81459 I'm getting "line 49, characters 21-24: Error: This function is applied to too many arguments;"
nishidabianya is now known as ahokaomaeha
<osa1>
overriding sexp_of_my_data didn't work
yacks has quit [Ping timeout: 246 seconds]
<osa1>
other sexp functions are still calling sexplib generated sexp_of_my_data
<osa1>
yay \o/ finally made it work
ontologiae has joined #ocaml
djcoin has joined #ocaml
andreypopp has joined #ocaml
ftrvxmtrx_ has joined #ocaml
yacks has joined #ocaml
Cyanure has joined #ocaml
AltGr has joined #ocaml
answer_42 has quit [Ping timeout: 276 seconds]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
ontologiae has quit [Ping timeout: 276 seconds]
answer_42 has joined #ocaml
gour has joined #ocaml
mika1 has joined #ocaml
f[x] has quit [Remote host closed the connection]
hyperboreean has quit [Ping timeout: 260 seconds]
andreypopp has quit [Quit: sleep]
f[x] has joined #ocaml
andreypopp has joined #ocaml
<pippijn>
osa1: do you know why you made it work?
<osa1>
pippijn: actually I'm not sure. I after fixing sexp_of_... and ..._of_sexp functions it worked
<pippijn>
because those functions get an a_of_sexp and sexp_of_a as first argument
<pippijn>
because your env is parametrised
thomasga has joined #ocaml
ottbot has quit [Quit: WeeChat 0.3.9.2]
hyperboreean has joined #ocaml
hkBst has joined #ocaml
osa1 has quit [Ping timeout: 245 seconds]
answer_42 has quit [Remote host closed the connection]
cyball has joined #ocaml
ontologiae has joined #ocaml
hkBst has quit [Ping timeout: 256 seconds]
cyball has quit [Ping timeout: 276 seconds]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
mcclurmc has quit [Ping timeout: 256 seconds]
alxbl has quit [Ping timeout: 255 seconds]
Yoric has quit [Ping timeout: 252 seconds]
alxbl has joined #ocaml
_andre has joined #ocaml
hkBst has quit [Remote host closed the connection]
hkBst has joined #ocaml
hkBst has quit [Remote host closed the connection]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
ocp has joined #ocaml
SuperNoeMan has joined #ocaml
<SuperNoeMan>
I really like ocaml. I've been wondering why more people don't, and I think its because the typing primitive that ocaml provides aren't as powerful as they could be
<SuperNoeMan>
I look at python, and I wish it did more static type checking. I wonder why more people don't like ocaml that use python because ocaml has some strong advantages. So now I'm wondering-why doesn't ocaml provide some of the same type primitives that python does-like lists, hashing and what not
<companion_cube>
I think they are already to restrictive for most people
<flux>
I think the most common excuses are: 1) syntax is ugly (I don't see it, though) 2) no ability to use multiple cores simultaenously in a single process 3) probably more reasons
<SuperNoeMan>
I know that ocaml has [1;2;3...
<companion_cube>
SuperNoeMan: ocaml has both lists and hashtables
<SuperNoeMan>
but its not the same for ocaml's lists, vs python.
<SuperNoeMan>
or am I wrong about the last part
<companion_cube>
what is wrong with ocaml's lists?
<SuperNoeMan>
I know it has them, I'm wondering if ocaml's aren't as expressive, or aren't as powerful
<flux>
what ocaml doesn't have is a nice inline syntax for hash tables as some other languages do, but I don't think it's a big factor
<SuperNoeMan>
and I'm asking to be refuted or to be informed. I'm not complaining. I like ocaml
<flux>
I would say hash tables aren't used in ocaml as much as they are in those dynamic languages
<companion_cube>
SuperNoeMan: python's lists really are vectors, not lists
<SuperNoeMan>
ah
<SuperNoeMan>
interesting point companion_cube
<SuperNoeMan>
but can anybody contrast why python may have more popularity than ocaml?
<thizanne>
amongst people I deal with, the main reason for not using OCaml is "yuck, maths"
<companion_cube>
because it's easy
<companion_cube>
whereas ocaml requires learning functional programming, and accepting that the compiler yells at you
yacks has quit [Ping timeout: 246 seconds]
<companion_cube>
(which most people dislike)
<flux>
oh, a third reason: the ocaml standard library doesn't provide much
<SuperNoeMan>
flux: ahh... I thought that there was a lwt module you could get and use threads...?
<SuperNoeMan>
do you mean to say that there is absolutely no way to do multi-tasking in a single ocaml process?
<thizanne>
not multi-tasking, multi-processors
<thizanne>
(or multi-cores)
<flux>
supernoeman, you cannot write a pure ocaml program that has one process that consumes 200% CPU
<SuperNoeMan>
companion_cube: true, but static type checking really makes you solve problems you will eventually deal with anyway, and dealing with them first beats this piss out of dealing with them when they are massive problems
<flux>
you can have multiple processes, or you can have multiple threads but they don't use all of the available >1 cpus due to locking
<companion_cube>
SuperNoeMan: I agree, that's why i love ocaml
<companion_cube>
but that's not what everybody thinks
<flux>
it is similar (but different) to the situation in python, though
adotbrown has joined #ocaml
<SuperNoeMan>
flux: so, you're saying that you can have an ocaml program that uses more than one core?
<companion_cube>
SuperNoeMan: just fork+exec
<SuperNoeMan>
"or you can have multiple threads"
<SuperNoeMan>
eww fork & exec.
<flux>
supernoeman, you can have multiple processes and they can pass messages with relative ease
<SuperNoeMan>
what does the lwt module exist for if not to provide threading?
<SuperNoeMan>
flux: true
<flux>
it gives light-weight co-operative threading, that scales for tens of thousands of threads
<flux>
there have been and are projects for making ocaml's gargage collector concurrent (and enabling running multiple ocaml threads simultaneously) but apparently it is more difficult than people expect
<SuperNoeMan>
flux: the lwt does or fork & exec does? (give light-weight co-operative... )
<SuperNoeMan>
interesting.
<flux>
lwt, Light-Weight Threads I think is the acronym
<SuperNoeMan>
right I know the acronym. so, lwt is not garbage collected?
<flux>
it is, but it doesn't give you >100% cpu usage
<SuperNoeMan>
so, how soon might one expect that ocaml will become more capable at multithreading
<flux>
it gives you tens of thousands of threads
<SuperNoeMan>
well, do you get most of the cpu usage?
<flux>
well, if your problem is IO bound to begin with, LWT is great. for example web services.
<companion_cube>
lwt is for concurrency, not for parallelism
<SuperNoeMan>
... but do you get most of the cpu usage?
<companion_cube>
you just do several things concurrently, but they still remain on one core
<companion_cube>
the only way to get more than 100% cpu usage in OCaml (or python) is to fork subprocesses
<SuperNoeMan>
companion_cube: how can anything be truely concurrent if it is only on one core?
<flux>
it's not like you can just use threads and get great CPU usage automatically either
<companion_cube>
SuperNoeMan: concurrency is about doing several things concurrently
<companion_cube>
parallelism is about using several cores to compute one thing
<SuperNoeMan>
ok
<flux>
currently in ocaml the only way to get more than one core to use is to use more than one process, but it doesn't need to be difficult :)
<SuperNoeMan>
ok ok. I understand now. I won't question the status quo anymore :)
<flux>
parmap worked great for me the last time I needed to spread a cpu-bound task to multiple cores. not sure if using threads would've made it any easier :)
yacks has joined #ocaml
hkBst has quit [Remote host closed the connection]
hkBst has joined #ocaml
mye has joined #ocaml
Yoric has joined #ocaml
gour has quit [Disconnected by services]
gour_ has joined #ocaml
mcclurmc has joined #ocaml
yacks has quit [Ping timeout: 240 seconds]
hkBst has quit [Ping timeout: 240 seconds]
adotbrown has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
tane has joined #ocaml
andreypopp has quit [Quit: sleep]
yacks has quit [Ping timeout: 256 seconds]
parlancho has joined #ocaml
yacks has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
AltGr has joined #ocaml
diggo has joined #ocaml
<diggo>
hi
<diggo>
A question - I am trying to learn a functional language. I really want to learn ocaml but haskell seems to have more resources for beginner than ocaml
<diggo>
is it a good idea to start with haskell first? How hard would moving to ocaml be later?
<diggo>
I am also thinking about Standard ML
gour_ is now known as gour
* gour
tried with haskell, now he's here :-)
<diggo>
you mean *tired?
<flux>
diggo, I think many of the people here think that ocaml is near striking the balance between purity and imperative programming
<gour>
diggo: no, tried, but i believe ocaml is more pragmatic language for real-world projects
<diggo>
ah, ok. But would it be a good idea to start with ocaml directly? I have tried to find some video tutorials (Which I tend to learn better) and couldn't find any
<flux>
also as a language ocaml is quite small - well, modules are quite essential and perhaps a new concept
<diggo>
trying to find some good books on Amazon too, but unlike Haskell, and standard ML. There is hardly any of them with good reviews
<flux>
diggo, I think an ocaml book might be a great way to get into ocaml programming (google for jason ocaml book), perhaps there's less of tutorial stuff
<flux>
there's tryocmal, but I think it's not complete (but it may have advanced since last time I saw it)
<flux>
diggo, I imagine you are already familiar with some language? maybe the most efficient way is to find a small enough problem you want solved, and then get on it :)
<flux>
diggo, btw, the official ocaml manual serves as a good introduction to the language as well
<diggo>
flux, I have visited the tryocmal. But it is not complete as you said
<thomasga>
nobody uses it at the moment but I one point I was planning to push people to add them :-)
<companion_cube>
ok, perfect then
<thomasga>
true
<thomasga>
need to update that page
<companion_cube>
I think it should be mentionned in the description of the 'url' file
hkBst has quit [Ping timeout: 272 seconds]
hkBst_ has joined #ocaml
hkBst_ has quit [Client Quit]
adrien_oww has quit [Ping timeout: 272 seconds]
jamii has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ontologiae has quit [Read error: Connection reset by peer]
chambart has quit [Ping timeout: 256 seconds]
clan has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 252 seconds]
ocp has quit [Quit: Leaving.]
LukeSun has joined #ocaml
RagingDave has quit [Read error: Connection reset by peer]
RagingDave has joined #ocaml
tac has joined #ocaml
nimred has joined #ocaml
nimred has quit [Changing host]
nimred has joined #ocaml
RagingDave has quit [Quit: Ex-Chat]
travisbrady has quit [Quit: travisbrady]
Xizor has joined #ocaml
travisbrady has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
chambart has joined #ocaml
Yoric has joined #ocaml
tane has joined #ocaml
skippy_ has joined #ocaml
ttamttam has joined #ocaml
<skippy_>
hi guys, I need help.. Don't quite understand this
<skippy_>
# let eval = fun f -> fun x -> f x;; val eval : ('a -> 'b) -> 'a -> 'b = <fun>
<thelema_>
ok, any part?
<thelema_>
eval is a function that takes 2 arguments
<thelema_>
the first is of type ('a -> 'b)
<thelema_>
the second is of type 'a
<skippy_>
ok
<thelema_>
"f x" means pass x in as an argument to function f
<thelema_>
so eval will run f on x and return the result, which is of type 'b
<thelema_>
think about 'a and 'b like x and y in algebra
<thelema_>
they're type variables
andreypopp has quit [Quit: sleep]
<skippy_>
hai thelema_, if that is true, then # let hyp = fun a -> fun b -> sqrt(a *. a +. b *. b);; val hyp : float -> float -> float = <fun>
<skippy_>
should be hyp is a function that take 2 arguments of the type float
ttamttam has quit [Quit: ttamttam]
<skippy_>
and return, a float, right?
<thelema_>
yes
<thelema_>
yes
<skippy_>
but why in the lecture it says it is equivalent to float -> (float -> float)
jamii has quit [Quit: Leaving]
<thelema_>
skippy_: it can take the arguments one at a time.
<skippy_>
yet for the first example, it is ('a -> 'b) -> 'a -> 'b ?
<thelema_>
if it takes just a single argument, the result is a function float -> float
<thelema_>
the first example can also take its arguments one at a time
<thelema_>
the parenthesization for it is ('a -> 'b) -> ('a -> 'b)
Anarchos has joined #ocaml
<skippy_>
so ('a -> 'b> -> ('a -> 'b) basically means eval is a function that takes a function and return a function?
<skippy_>
am I right, thelema_ ?
tane has quit [Quit: Verlassend]
<thelema_>
functions with multiple arguments always return a function when fewer than max number of arguments are given
thomasga has quit [Quit: Leaving.]
<thelema_>
they return the function that accepts the remaining arguments and then does what the original function would do on all the arguments
tac has quit [Ping timeout: 245 seconds]
tac has joined #ocaml
Snark has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<skippy_>
thelema_: thanks. I can't I say I completely get it now - but definitely helping to understand it a bit more
tac_ has joined #ocaml
tac has quit [Quit: Page closed]
chambart has quit [Ping timeout: 272 seconds]
osa1 has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.9.2]
<skippy_>
thelema_: let eval x y z = x y z;; val eval : ('a -> 'b -> 'c) -> 'a -> 'b -> 'c = <fun> is the same thing as ('a ->( 'b -> 'c)) -> ('a ->( 'b -> 'c)) correct?
<skippy_>
I think I am starting to understand this
<skippy_>
reading backward seems to help
rwmjones has quit [Read error: Operation timed out]
<skippy_>
I think my main problem was my experience with imperative language and my failure to think abstractly
derek_c has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
derek_c has quit [Quit: leaving]
derek_c has joined #ocaml
ahokaomaeha has joined #ocaml
tane has joined #ocaml
rwmjones has joined #ocaml
LukeSun has quit [Read error: Connection reset by peer]
derek_c has quit [Ping timeout: 256 seconds]
<Qrntz>
skippy_, yes, signatures are right-associative
derek_c has joined #ocaml
yacks has quit [Remote host closed the connection]
<skippy_>
k. thanks!
LukeSun has joined #ocaml
derek_c has quit [Ping timeout: 264 seconds]
derek_c has joined #ocaml
_andre has quit [Quit: leaving]
chambart has joined #ocaml
derek_c has quit [Ping timeout: 248 seconds]
andreypopp has joined #ocaml
derek_c has joined #ocaml
derek_c has quit [Ping timeout: 252 seconds]
mcclurmc has quit [Ping timeout: 245 seconds]
tac_ has quit [Ping timeout: 245 seconds]
tac has joined #ocaml
<travisbrady>
rwmjones: any pointers on compiling a program that makes use of bit string using OCamlMakefile?
<travisbrady>
I've set the (*pp … *) bit at the top but I'm not sure I'm doing it correctly.
tac has quit [Ping timeout: 245 seconds]
<thelema_>
bitstring.syntax is the package you want.
tac has joined #ocaml
Anarchos has joined #ocaml
<travisbrady>
thelema_: yes I had that in my PACKS but with no luck. But after reading through the bit string Makefile.in I was able to figure it out.
<thelema_>
great
ahokaomaeha has quit [Read error: Operation timed out]
julm has joined #ocaml
mcclurmc has joined #ocaml
Snark has quit [Quit: Quitte]
parlancho has quit [Ping timeout: 256 seconds]
andreypopp has quit [Quit: sleep]
parlancho has joined #ocaml
derek_c has joined #ocaml
chambart has quit [Ping timeout: 272 seconds]
<osa1>
I just read Pottier's "a modern eye on ml type inference" and it's mentioned that two more parts to the article will be come but I couldn't find it, any ideas ?
fds has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
gour has quit [Quit: WeeChat 0.4.0]
derek_c has quit [Ping timeout: 272 seconds]
cyball has joined #ocaml
answer_42 has quit [Ping timeout: 276 seconds]
Cyanure has joined #ocaml
tac_ has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
Cyanure has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
ahokaomaeha has joined #ocaml
ttamttam has joined #ocaml
tac_ has quit [Quit: Page closed]
ttamttam has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 264 seconds]
tac has joined #ocaml
mcsquiggedy has joined #ocaml
ahokaomaeha has quit [Ping timeout: 245 seconds]
cyball has quit [Read error: No route to host]
rwmjones has quit [Ping timeout: 256 seconds]
adotbrown has joined #ocaml
rwmjones has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
rossberg has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
parlancho has quit [Ping timeout: 272 seconds]
derek_c has joined #ocaml
rossberg has joined #ocaml
tani has joined #ocaml
ski has quit [Ping timeout: 264 seconds]
tane has quit [Ping timeout: 248 seconds]
ski has joined #ocaml
smondet has quit [Ping timeout: 276 seconds]
derek_c has quit [Ping timeout: 264 seconds]
tani has quit [Quit: Verlassend]
mcclurmc has quit [Remote host closed the connection]
Xizor has quit [Ping timeout: 264 seconds]
emmanuelux has quit [Remote host closed the connection]