<bernardofpc>
(and, if it was not enough not to point to the real system perl, I have moreover) ls: cannot access /home/bernardofpc/.opam/system/lib/perl5: No such file or directory
ollehar1 has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
badkins has joined #ocaml
axiles has quit [Ping timeout: 256 seconds]
axiles has joined #ocaml
Haudegen has joined #ocaml
badkins has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
kapil___ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 255 seconds]
yminsky has joined #ocaml
ghostpl_ has joined #ocaml
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
larhat has joined #ocaml
ghostpl_ has quit [Ping timeout: 252 seconds]
c74d has quit [Remote host closed the connection]
c74d has joined #ocaml
gdsfh1 has left #ocaml [#ocaml]
martintrojer has quit [Ping timeout: 250 seconds]
rand000 has joined #ocaml
martintrojer has joined #ocaml
martintrojer has quit [Max SendQ exceeded]
martintrojer has joined #ocaml
<ollehar1>
yo yo
<ollehar1>
how to check that all element in a list are equal (in some way)?
<ollehar1>
*elements
<ollehar1>
manual recursive function?
<ollehar1>
should be a list iterator that compares two elements at a time?
<srax>
ollehar1: what do you means by that ? You want to check that your lists are totaly equal, or that all the elements of a list are present in the other one ?
<ggole>
match list with [] -> true | x::xs -> List.for_all (fun e -> x = e) xs
<ollehar1>
xml structure of each list element should be equal to other element.
<ollehar1>
ggole: good one
avsm has joined #ocaml
grmartin has joined #ocaml
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 256 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
rgrinberg has quit [Ping timeout: 245 seconds]
idegen has joined #ocaml
yminsky has quit [Quit: yminsky]
oriba has joined #ocaml
yomimono has joined #ocaml
Haudegen has joined #ocaml
yminsky has joined #ocaml
yminsky has quit [Client Quit]
yminsky has joined #ocaml
darnuria has quit [Quit: WeeChat 1.2-dev]
yminsky has quit [Client Quit]
struktured has quit [Ping timeout: 256 seconds]
darkf has quit [Quit: Leaving]
leowzukw has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
<ollehar1>
Not_found is not good :(
<ollehar1>
know problem?
<ollehar1>
*known
<ggole>
It's a common exception
<ggole>
The List functions in particular are fond of raising Not_found to make your life more fun
<ollehar1>
what's wrong with return empty results?
<mrvn>
what's an empty result?
<ollehar1>
or options
<ggole>
That's an approach many would prefer.
<ggole>
It's not the approach the stdlib has taken.
<mrvn>
options you always have to match. If you know it's not gonna fail that is extra typing.
<mrvn>
overall it's just a matter of taste
<ggole>
assert false might be more typing, but at least it tells you where the explosion took place
<mrvn>
but then you can't catch that in case you expect a failure once in a while
<ggole>
I meant matching on the result of an option-returning thing with assert false
tianon has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 256 seconds]
<mrvn>
for a reusable module it's best if you have both ways. It's easy enough to wrap the option types with match None -> raise Not_found ...
tianon has joined #ocaml
<ggole>
Yeah, that's not a bad choice.
kapil___ has quit [Quit: Connection closed for inactivity]
ghostpl_ has joined #ocaml
etehtsea has joined #ocaml
etehtsea has quit [Max SendQ exceeded]
ghostpl_ has quit [Ping timeout: 246 seconds]
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
<mrvn>
the theoretical thing to explain recursion in untyped lambda calculus
<mrvn>
ups
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
Anarchos has joined #ocaml
badkins has joined #ocaml
ollehar1 has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
yomimono has quit [Ping timeout: 252 seconds]
Sim_n is now known as Simn
badkins has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 252 seconds]
vanila has joined #ocaml
struktured has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
tianon has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
tianon has joined #ocaml
ygrek has joined #ocaml
yminsky has joined #ocaml
yac has joined #ocaml
AlexRussia has joined #ocaml
<vanila>
anyone know about mirage?
<vanila>
I was wondering if I could use it instead of openssl?
<vanila>
(without rewriting my website in ocaml..)
<mrvn>
so you want a different sticker on your bumper so you buy a new car?
* vanila
facepaml
<vanila>
why am i on irc
<whitequark>
vanila: "can i use photoshop instead of chromium?"
vanila has left #ocaml ["Leaving"]
<ggole>
...
<yminsky>
Probably we could have given him a nicer answer than that.
dsheets has joined #ocaml
<yminsky>
It’s true the question was slightly disjointed, but it’s pretty clear what he wanted to know about...
<kakadu>
I think that some exception is raised when ppx extension being executed. How to debug it? OCAMLRUNPARAM=b doesn't print backtrace
<kakadu>
It seems that ppx extension itself accepts some [in_file] and [out_file] but it seems that they shouldnot be text ones
<mrvn>
does mirage support https at all?
<whitequark>
kakadu: no, these are not text
<whitequark>
they're serialized ASTs
<yminsky>
mrvn: there is indeed a new SSL implementation that works with Mirage.
<yminsky>
It’s pretty sweet, actually.
<kakadu>
whitequark: What can you recommend in case '/home/kakadu/.opam/4.02.1/lib/ppx_tools/rewriter got signal and exited' ?
<kakadu>
whitequark: 0x00000000004f337d in camlAst_mapper__map_1520 ()
<whitequark>
hrm
struktured has quit [Ping timeout: 244 seconds]
<whitequark>
are you sure the version of compiler-libs you used to build the ppx with matches the version of your compiler?
<whitequark>
and you didn't forget eval `opam config env`?
<whitequark>
well, it shouldn't happen either way, there's a signature
<whitequark>
but I have no other ideas
<kakadu>
eval is in my bashrc:)
<kakadu>
I was writing some code and it worked fine
<kakadu>
but I have added something else into extension and everything brokes
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<kakadu>
And it happens only for g.ml
ghostpl_ has joined #ocaml
<kakadu>
And when I comment part after '| Right (l_ast,r_ast) ->' it works
<whitequark>
you have some kind of unsoundness and it just manifests in that case
<kakadu>
ah!
<kakadu>
me idiot
<whitequark>
oh?
<whitequark>
wait
<whitequark>
> [%e Obj.magic() ]
<whitequark>
what do you /expect/
<kakadu>
everymody can laugh
freling has joined #ocaml
<ggole>
Naughty!
mort___ has joined #ocaml
ghostpl_ has quit [Ping timeout: 246 seconds]
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
reem has quit [Read error: No route to host]
reem has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
antkong has joined #ocaml
waneck has joined #ocaml
mort___ has quit [Quit: Leaving.]
dsheets has joined #ocaml
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
boogie has quit [Remote host closed the connection]
antkong has quit [Ping timeout: 264 seconds]
badkins has joined #ocaml
badkins has quit [Remote host closed the connection]
ollehar1 has joined #ocaml
<ollehar1>
any way to do `if var = None then foo else bar`?
<ollehar1>
or `if var = Some x then x else y`
<ollehar1>
instead of match case
reem has quit [Read error: Connection reset by peer]
reem has joined #ocaml
reem has quit [Remote host closed the connection]
psy_ has joined #ocaml
<kakadu>
if var = None should work, I think
<ggole>
match or a function call
<mrvn>
ollehar1: have you tried it?
<ggole>
let get_or opt alt = match opt with Some x -> x | None -> alt, then get_or var y
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
dant3 has quit [Remote host closed the connection]
oriba_ has joined #ocaml
dant3 has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
oriba has quit [Ping timeout: 250 seconds]
<xificurC>
2 questions on `ocamlbuild -use-ocamlfind -pkgs lwt.unix,lwt.ppx,str,ppx_deriving.show main.native'
<xificurC>
1) in what file can I put this _recipe_ so that I don't have to write it all over?
<xificurC>
2) ppx_deriving.show <== I found this out by trial and error, what does foo.bar stand for?
<kakadu>
1) _tags
<kakadu>
2) very likely package.subpackge
ghostpl_ has joined #ocaml
<xificurC>
kakadu: thanks, I'll look into the _tags file's syntax. Package/subpackage - those are OPAM terms, right?
<kakadu>
ocamlfind ones
<xificurC>
I see. I'll look into that as well then I guess. Thanks
<bernardofpc>
(by the way, apparently people here don't like Str; myself I've never used it, but maybe you can ask what should it be replaced by)
<xificurC>
bernardofpc: indeed. I'm planning to replace it with Re
struktured has joined #ocaml
larhat has quit [Quit: Leaving.]
ghostpl_ has quit [Ping timeout: 250 seconds]
<ollehar1>
mrvn: var = None should work yes, but I don't you can deconstruct variables directly in if-clause...
<ollehar1>
*don't think
yminsky has quit [Quit: yminsky]
<ollehar1>
I'm stupid, it works
<ollehar1>
# if a = Some x then x else 36;;
<ollehar1>
- : int = 10
<ollehar1>
where a = Some 10, and x = 10
<ollehar1>
pretty cool!
<ollehar1>
no wait...
<ollehar1>
x in then-clause might be another binding
<ggole>
Uh
<ggole>
You know that's not pulling the x out of the option, right?
<kakadu>
I though that I discovered something new about OCaml...
<ollehar1>
I know now
<ggole>
The two xs are the same, of course
<ggole>
So it'll "work"
<ollehar1>
mnm
<ollehar1>
*mm
<ollehar1>
# if a = Some w then w else 36;;
<ollehar1>
Error: Unbound value w
<ggole>
I think that 'if let' has been suggested which would allow a similar patten
<ollehar1>
ok
<ggole>
eg, if let Some x = var then x else y
<ollehar1>
yeah
avsm has joined #ocaml
dav has joined #ocaml
RossJH has quit [Ping timeout: 272 seconds]
pobivan has joined #ocaml
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
tianon has quit [Changing host]
tianon has joined #ocaml
A1977494 has joined #ocaml
<ollehar1>
match cases as first-class values?
octachron has quit [Ping timeout: 264 seconds]
<ggole>
I think there are languages which do that...
<ggole>
I'd settle for abstraction over patterns
<ollehar1>
what's that?
Hannibal_Smith has joined #ocaml
<ggole>
Where instead of typing the same pattern twice (maybe with slightly different bits) you bind it to a name and then use that
joncfoo has joined #ocaml
<joncfoo>
anyone have experience with getting utop to work with org-mode in emacs?
<ollehar1>
ggole: yeah, sound good, could use that. :)
<joncfoo>
I have some source code blocks that I'd like to have eval'd in utop but I haven't figured out how to do it yet - it starts up the ocaml interpreter and just sits there at the moment
A1977494 has quit [Quit: Leaving.]
A1977494 has joined #ocaml
RossJH has joined #ocaml
A1977494 has left #ocaml [#ocaml]
mort___ has joined #ocaml
avsm has quit [Quit: Leaving.]
freling has quit [Quit: Leaving.]
tianon has quit [Read error: Connection reset by peer]
tianon has joined #ocaml
<Drup>
put ;; at the end and press enter
Submarine has quit [Quit: Leaving]
virtualeyes has quit [Ping timeout: 252 seconds]
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
rgrinberg has joined #ocaml
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
octachron has joined #ocaml
octachron has quit [Client Quit]
<joncfoo>
Drup: C-c C-c doesn't eval the block - it's not even copied to the interpreter
<joncfoo>
and the interpreter is the standard ocaml one not utop
<joncfoo>
outside org-mode it all works well
<joncfoo>
C-c C-e evals into utop
<joncfoo>
just not in org-mode
dav has quit [Ping timeout: 272 seconds]
Haudegen has quit [Ping timeout: 272 seconds]
<ggole>
You need to bind it to whatever the command is in tuareg-mode
<ggole>
And that might not work, depending on the contents of the buffer and how tuareg does its phrase parsing
<ggole>
It's tuareg-eval-phrase, try that (just with M-x for now)
mxv has quit [Remote host closed the connection]
ZenosDance has joined #ocaml
Haudegen has joined #ocaml
dav has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
<ollehar1>
ggole: btw, if you had abstraction over patterns, you could stick it into modules and have first-class patterns that way.
<ollehar1>
which might lead to some weird code
myst has quit [Ping timeout: 265 seconds]
ghostpl_ has joined #ocaml
ghostpl_ has quit [Ping timeout: 245 seconds]
ggole has quit []
<reynir>
is "if let" new syntax?
<adrien>
if let x = 42 in x = 42 then ();;
<adrien>
that ?
<ollehar1>
no
<ollehar1>
possible deconstructing in if-clause
<reynir>
ggole wrote this earlier: let Some x = var then x else y
<ollehar1>
he also wrote "it's been suggested" :)
<reynir>
err, if let*
<reynir>
ah, suggested for ocaml
myyst has joined #ocaml
<ollehar1>
yes
<reynir>
I interpreted it as a suggeted solution heh
<ollehar1>
I wish :)
ZenosDance has quit [Ping timeout: 256 seconds]
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
swgillespie has joined #ocaml
myyst is now known as myst
Nahra has quit [Remote host closed the connection]
<def`>
+1 for first-class patterns, though it's unlikely to happen :P
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
<ousado>
it'd be awesome
thomasga has joined #ocaml
swgillespie has quit [Client Quit]
matason has joined #ocaml
swgillespie has joined #ocaml
yminsky has joined #ocaml
seangrove has quit [Remote host closed the connection]
<whitequark>
can be done with ppx
<whitequark>
i mean, you lose exhaustiveness checks anyway
qnix has joined #ocaml
matason has quit [Quit: Leaving...]
<ousado>
my preference would be compile-time pattern aliases/replacements/functions, however you want to call it, not passing 'pattern values' around at runtime
<ousado>
the latter is nicely covered by functions
matason has joined #ocaml
freling has joined #ocaml
<ousado>
but e.g. in case of the haxe compiler, there's certainly lots of code duplication in the various backends
<whitequark>
the former can /definitely/ be done with ppx
<whitequark>
and very elegantly so
<whitequark>
even with multiple files
<Drup>
the issue is, obviously, exporting such aliases.
<Drup>
it's starting to get in the territory "just do it in the compiler duh" :p
<Drup>
but yeah
<Drup>
I have yet to see a completely convincing design for first class pattern though, every one of them is slightly different
<Drup>
(or not-slightly)
esden has quit [Remote host closed the connection]
<ousado>
being able to reuse a complex pattern with its bindings as "| Patsy.alias_name a b c -> " would be sufficiently awesome already, IMO
reem has joined #ocaml
reem has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
<whitequark>
ousado: it's twenty lines ppx
<whitequark>
write it
reem has joined #ocaml
qnix has left #ocaml [#ocaml]
yminsky has quit [Quit: yminsky]
<ousado>
whitequark: could I get the above syntax?
esden has joined #ocaml
reem_ has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
<whitequark>
no
<whitequark>
Patsy.Alias_name (a, b, c), yes
pobivan has quit [Quit: pobivan]
<whitequark>
but I prefer [%patsy alias_name a b c]
pobivan has joined #ocaml
reem has quit [Ping timeout: 256 seconds]
pobivan has quit [Client Quit]
<ousado>
hm, maybe one could do away with the patsy, it might become quite redundant in most cases, I guess
badkins has joined #ocaml
<ousado>
perhaps I'll try that when haxe moves away from 3.xx
dav has quit [Ping timeout: 255 seconds]
dav has joined #ocaml
hh has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
xificurC has quit [Ping timeout: 264 seconds]
swgillespie has quit [Max SendQ exceeded]
adrien has quit [Quit: leaving]
swgillespie has joined #ocaml
tel has joined #ocaml
adrien has joined #ocaml
reem_ has quit [Remote host closed the connection]
<tel>
\join #nixos
<tel>
ah. hah, oops.
swgillespie has quit [Max SendQ exceeded]
<tel>
too much tex lately
swgillespie has joined #ocaml
swgillespie has quit [Max SendQ exceeded]
swgillespie has joined #ocaml
psy_ has quit [Ping timeout: 264 seconds]
reem has joined #ocaml
swgillespie has quit [Max SendQ exceeded]
swgillespie has joined #ocaml
ghostpl_ has joined #ocaml
psy_ has joined #ocaml
shinnya has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
ghostpl_ has quit [Ping timeout: 256 seconds]
c-c has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 245 seconds]
Simn has quit [Read error: Connection reset by peer]
<joncfoo>
is there a way to define an inline operator that uses letters - e.g. let (and_then) r f = ...
<Drup>
no
<joncfoo>
ok thanks
matason has quit [Quit: Leaving...]
antkong has joined #ocaml
<esden>
hi everyone, I have a question regarding ocamlfind and ocamlc
kdef has joined #ocaml
<companion_cube>
please ask
<esden>
On linux you can run "ocamlfind ocamlc -g -linkpkg mylibrary.so mycode.ml" and it detects correctly that mylibrary.so is a shared library and all is dandy. On OS X "ocamlfind ocamlc -g -linkpkg mylibrary.dylib mycode.ml" it fails as it does not know what to do with dylib
<esden>
any tips?
<esden>
obviously if I run the same code on osx "ocamlfind ocamlc -g -linkpkg mylibrary.so mycode.ml" it will fail as it can't find the mylibrary.so ...
<companion_cube>
I don't have a mac, sorry :/
<esden>
I can't find any pointers related to .so vs .dylib handling even through google
<esden>
obviously that was my first try
<esden>
so it has to be something obvious if noone beside me has the issue :)
<companion_cube>
is mylibrary.dylib a local lib, or a systemwide lib?
<esden>
local lib
<companion_cube>
erf
<esden>
well it is provided in a directory through -dllpath
<companion_cube>
have you tried a combination of -dllpath . -dllib mylibrary ?
<ousado>
learning ocaml will both help you getting paid for working with any language and increase the likelihood you'll find a job where you can use ocaml
thomasga has quit [Quit: Leaving.]
<esden>
companion_cube: ok, I think I figured it out. Although I feel like this is a "bug" in ocamlc. So ocamlc assumes that all .so files are dynamic libraries. It does not do that for .dylib files. I had to compile the .dylib file on osx and save it away with the .so ending then ocamlc accepts it as a dynamic library and all is good. The "clean" way would be if ocamlc assumed a .dylib file is a shared library on darwin the same way it assumes .so files