BitPuffin|osx has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
contempt has quit [Ping timeout: 272 seconds]
mort___ has quit [Quit: Leaving.]
yegods has quit [Remote host closed the connection]
uvicon has joined #ocaml
yegods has joined #ocaml
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
Kakadu has quit [Remote host closed the connection]
ncthom91 has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jonludlam has quit [Remote host closed the connection]
govg has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
ryanartecona has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ncthom91 has joined #ocaml
ncthom91 has quit [Client Quit]
wolfcore has joined #ocaml
wolfcore has quit [Changing host]
wolfcore has joined #ocaml
<wolfcore>
started playing with OCaml again
<wolfcore>
coming from Haskell
<wolfcore>
OCaml is *so* nice
<wolfcore>
love it
<wolfcore>
Haskell is awesome too
<wolfcore>
I'm a sucker for ML based langs
<wolfcore>
:p
<dmbaturin>
wolfcore: There's also StandardML, if you want to become an ML collector. ;)
<dmbaturin>
And numerous research dialects.
<Drup>
sooo many research dialects
<wolfcore>
dmbaturin: yup, I have a copy of PFDS next to me -- going to read it tomorrow probably
<dmbaturin>
The next step is to invent your own research dialect.
<wolfcore>
I want to write a theorem prover
<wolfcore>
Isn't that one of the main reasons ML was created?
ncthom91 has joined #ocaml
<dmbaturin>
Original ML was an internal language of a theorem prover AFAIR.
teknozulu has joined #ocaml
wolfcore has quit [Quit: Trying something]
<python476>
milner's meta language
<python476>
that makes ocaml a sibling of xml.
wolfcore has joined #ocaml
<python476>
I can't say why yet, but sml/nj felt a lot easier to learn than ocaml btw
<Drup>
it's "a bit" smaller
<python476>
yeah, that also
<python476>
I should try it again to compare post-ocaml
<Drup>
You are not yet post-ocaml :D
<python476>
I'm prepost-ocaml
<wolfcore>
any tips for getting up to speed on OCaml quickly? I have an interview coming up and am going to use to answer algo questions. I have been writing mostly Haskell for months, but I don't want to run into a wall when they ask questions that could be better solved with state
<python476>
and prepost-erous
echo-area has joined #ocaml
ollehar1 has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
ollehar1 is now known as ollehar
<Drup>
wolfcore: for the tooling, the intro of RWO
Guest58 has quit [Ping timeout: 260 seconds]
wolfcore has left #ocaml ["Killed buffer"]
wolfcore has joined #ocaml
wolfcore is now known as Guest51782
Guest51782 has quit [Changing host]
Guest51782 has joined #ocaml
Guest51782 is now known as wolfcore
Guest58 has joined #ocaml
wolfcore has left #ocaml ["Killed buffer"]
wolfcore has joined #ocaml
<dmbaturin>
wolfcore: Perhaps it can be a rule of thumb that if you would go for IORef's if it was haskell, a reference in ML is a good idea too. :)
<wolfcore>
dmbaturin: thanks :) gotta read up on refs
<dmbaturin>
wolfcore: A ref is secretly a mutable record. type 'a ref = { mutable contents: 'a }
<dmbaturin>
A record can have more than one mutable field, so sometimes it's better to store some state in a single record than create a bunch of refs.
<wolfcore>
dmbaturin: so essentially it would still be creating many refs, but all in the same record?
<dmbaturin>
Yeah, pretty much.
Bahman has joined #ocaml
<dmbaturin>
Well. In older MLs references were first class objects and there were no mutable records. OCaml introduced mutable records but included 'a ref, !, and := in the standard library that look like the original references, but implemented on top of mutable records.
<dmbaturin>
In SML "val foo = ref 0" is not a sugar for anything.
<wolfcore>
oh okay, that makes sense
ygrek has joined #ocaml
demonimin has quit [Ping timeout: 250 seconds]
<wolfcore>
so I was wondering
<wolfcore>
is there an equivalent to Haskell's syntax that lets you bind the entire match?
<wolfcore>
like
<wolfcore>
f all@(x:xs) = ...
darkf has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
<Drup>
(<pat> as <name>)
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
malex has left #ocaml [#ocaml]
psy_ has joined #ocaml
ril is now known as ril[away]
contempt has joined #ocaml
mac10688 has quit [Ping timeout: 264 seconds]
<wolfcore>
Drup: thanks!
Guest58 has quit [Ping timeout: 240 seconds]
psy_ has quit [Read error: Connection reset by peer]
Algebr has joined #ocaml
<Algebr>
Trying to have my friend see an ocaml project, its pretty frustrating because just did a fresh switch and try to install js_of_ocaml and get unbound module B64. Ugh.
<Algebr>
Quote in reply "This is why people don't use ocaml" :()
<Drup>
if that was the case, people would not use ruby and python either
<Drup>
that's a stupid answer
<dmbaturin>
I've installed octopress lately. As I'm not an active Ruby user, I was really frustrated by the fact that simply having a gem installed may not be enough, it still doesn't work until you add it to your Gemfile
<python476>
we really need prolog based build system ~_~
<python476>
let's brute force frustration out
<wolfcore>
why is it that fold_left [1;2;3;4;5;6] 0 (fun x n -> x+n);; returns a <fun> but naming the args like fold_left [1;2;3;4;5;6] ~init:0 ~f:(fun x n -> x+n);; gives the result?
<python476>
wolfcore: is that the right order?
<wolfcore>
yeah the type signature is 'a list -> init:'b -> f:('b -> 'a -> 'b) -> 'b = <fun>
MercurialAlchemi has joined #ocaml
<python476>
and I realize I'm not using the latest ocaml
<wolfcore>
do named parameters have to be named in function calls then?
<python476>
I don't know that, I would have assumed like you
<dmbaturin>
wolfcore: Where is this fold_left from?
<dmbaturin>
wolfcore: Yes, if the positional (non-named non-optional) argument comes last, this problem doesn't arise.
<dmbaturin>
let my_fold = fold_left ~init:0 ~f:myfun ;; will work as expected though.
MercurialAlchemi has quit [Ping timeout: 250 seconds]
AltGr has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
echo-area has quit [Remote host closed the connection]
<dmbaturin>
wolfcore: Actually, this is a bit odd. I've just tried to make an analgous function with labeled but non-optional arguments, it worked as you expected the fold to work.
Algebr has joined #ocaml
echo-area has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 244 seconds]
<wolfcore>
dmbaturin: hmm this is really strange
<wolfcore>
dmbaturin: yeah from what I read on ocaml.org it seems labelled arguments require the label name when calling the fn
<wolfcore>
but actually
<wolfcore>
I just tried the take_while from the same module, and didn't label the parameters.... it still worked
<wolfcore>
so I'm not sure
ril[away] is now known as ril
xificurC has quit [Ping timeout: 260 seconds]
MercurialAlchemi has joined #ocaml
tmtwd has quit [Ping timeout: 250 seconds]
pierpa has quit [Ping timeout: 265 seconds]
kushal has quit [Quit: Leaving]
demonimin has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
ril is now known as ril[away]
Bahman has quit [Remote host closed the connection]
Bahman has joined #ocaml
octachron has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Simn has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
johnelse has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
johnelse has joined #ocaml
johnelse is now known as Guest36551
ygrek has joined #ocaml
emaphis has quit [Ping timeout: 244 seconds]
ely-se has joined #ocaml
vbmithr_ has quit [Read error: Connection reset by peer]
<apache2>
I have a logger, and need to call Lwt_log_core.fatal_f ~logger ....mystuff...
<apache2>
I tried to curry it: let log_f = Lwt_log_core.fatal_f ~logger in ...
<apache2>
but the type checker does type inference on my first call to the curried function so I end up with:
<apache2>
Error: This expression has type ('a, unit, string, unit Lwt.t) format4 -> 'a but an expression was expected of type string -> int -> unit Lwt.t
<octachron>
apache2, you should add the format4 argument in your definition of log_f: let log_f fmt = ....
larhat1 has quit [Quit: Leaving.]
larhat1 has joined #ocaml
larhat1 has quit [Client Quit]
rand has joined #ocaml
ril has joined #ocaml
ncthom91 has joined #ocaml
rgrinberg has joined #ocaml
ollehar has quit [Ping timeout: 260 seconds]
superboum_ has joined #ocaml
pierpa has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
ely-se has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 246 seconds]
kakadu__ has joined #ocaml
kakadu_ has quit [Ping timeout: 272 seconds]
MercurialAlchemi has joined #ocaml
darkf has quit [Quit: Leaving]
<apache2>
thanks
<octachron>
did it work?
netrobyatmobile has quit [Quit: Connection closed for inactivity]
octachron has quit [Quit: Leaving]
Guest38 has joined #ocaml
rgrinberg has joined #ocaml
slash^ has joined #ocaml
jeffmo has joined #ocaml
orbifx2 has quit [Remote host closed the connection]
ryanartecona has joined #ocaml
kushal has joined #ocaml
orbifx has joined #ocaml
govg has joined #ocaml
bjorkintosh has quit [Read error: Connection reset by peer]
bjorkintosh has joined #ocaml
orbifx2 has joined #ocaml
orbifx2 has quit [Client Quit]
orbifx has quit [Ping timeout: 240 seconds]
ryanartecona has quit [Quit: ryanartecona]
kushal has quit [Remote host closed the connection]
kushal has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwatzman|work has joined #ocaml
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
tane has quit [Quit: Verlassend]
tane has joined #ocaml
jonludlam has quit [Ping timeout: 244 seconds]
caisah has joined #ocaml
ril has joined #ocaml
emaphis has quit [Ping timeout: 260 seconds]
^elyse^ has joined #ocaml
emaphis has joined #ocaml
kakadu__ has quit [Quit: Konversation terminated!]
Kakadu has quit [Quit: Page closed]
sepp2k has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 260 seconds]
<apache2>
ocnope :(
<caisah>
hi, sorry for the noob question: I'm trying to follow the examples from "Real world OCaml" in utop but when I use " Float.of_int x " I get the message "Error: Unbound module Float". What am I doing wrong?
zpe has joined #ocaml
ryanartecona has joined #ocaml
octachron has joined #ocaml
superboum_ has quit [Quit: superboum_]
JuggleTux has joined #ocaml
<octachron>
caisah, you need to open Core standard library
<caisah>
octachron: yeah, I figured it out, thanks!
ceryo has quit [Read error: Connection reset by peer]
ceryo_ has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
MercurialAlchemi has quit [Ping timeout: 255 seconds]
python476 has quit [Ping timeout: 246 seconds]
kushal has quit [Quit: Leaving]
schoppenhauer has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
Haudegen has joined #ocaml
Guest58 has joined #ocaml
schoppenhauer has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 265 seconds]
Kakadu has joined #ocaml
mort___ has joined #ocaml
JuggleTux has quit [Quit: leaving]
sivoais has quit [Ping timeout: 255 seconds]
tane has quit [Ping timeout: 240 seconds]
octachron has quit [Quit: Leaving]
lobo has joined #ocaml
tane has joined #ocaml
sivoais has joined #ocaml
Guest38 has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
igoroliveira has joined #ocaml
tane has quit [Ping timeout: 250 seconds]
rossberg has quit [Ping timeout: 240 seconds]
sivoais has quit [Ping timeout: 276 seconds]
tane has joined #ocaml
sivoais has joined #ocaml
_andre has quit [Quit: leaving]
sivoais has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
sivoais has joined #ocaml
orbifx has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
orbifx2 has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
orbifx has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
yegods has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
freehck has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
mort___ has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
xificurC has quit [Read error: Connection reset by peer]
slash^ has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
orbifx2 has quit [Ping timeout: 252 seconds]
ryanartecona has quit [Quit: ryanartecona]
yegods has quit [Remote host closed the connection]
taigi100 has joined #ocaml
ryanartecona has joined #ocaml
yegods has joined #ocaml
<taigi100>
Hey folks, I am looking for a string key in a Map that mapps ( string -> bool ). If I find it, I wanna use it , if not I wanna use the string . How should I do it ? I tried something like : | B v -> B ( try M.find v dict with Not_found -> v ) . Where B is a type defined by me.
<companion_cube>
this sounds like it's ill typed: in one case you use a bool, in the other case a string
<taigi100>
yep
<taigi100>
I'm trying to simplify a boolean expression where I only know a few of the variables
caisah has quit [Quit: Leaving]
<companion_cube>
so you want to return a symbolic boolean expression?
<companion_cube>
it means you have to wrap the string in some constructor
<taigi100>
I defined my boolean expression as such
<taigi100>
agree, when I get a B I just wanna return v, but when I get a V ( which is a proposition, for example "x") I either wanna return it's value ( If I can find it in the Map ) or just leave it as "x" otherwise
<mrvn>
so make a type for it
<taigi100>
and afterwards ? Can I do something like try ( M.find ) ->
<taigi100>
or could I do a function that just checks if the value is in the map without returning it's value if it is?
BitPuffin has quit [Ping timeout: 260 seconds]
<companion_cube>
V v -> begin try B (Map.find v dict) with Not_found -> V v end
mort___ has quit [Quit: Leaving.]
<taigi100>
and how should I deal with returning different types?
<companion_cube>
you can't
<companion_cube>
that's as simple as that
<companion_cube>
the snippet I posted above returns an expression in both cases
<taigi100>
so ... B of something is also an expression right?
<companion_cube>
yes
<companion_cube>
B true, for instance (B e where e is a boolean)
<taigi100>
ok, thnx :)
<companion_cube>
V "x" is also an expression
yegods has quit []
<taigi100>
and btw
ncthom91 has joined #ocaml
<taigi100>
if you happen to have understood what I'm trying to do