<pierpa>
the one with the exception is faster when the item is present in the table. The one without is faster when te item is not present. Not a big surprise :)
FreeBirdLjj has quit [Ping timeout: 272 seconds]
<haesbaert>
hmm I have this inside a match
<haesbaert>
find_option (function Unassigned (c, _) as x -> Some x | _ -> None) all_options
<haesbaert>
arghh
<haesbaert>
1s
<haesbaert>
| UNASSIGNED_216 | UNASSIGNED_215 as c -> find_option (function Unassigned (c, _) as x -> Some x | _ -> None) all_options
<haesbaert>
but I get a warning that "c" is unused
FreeBirdLjj has joined #ocaml
BenEdelman is now known as JacobEdelman
<pierpa>
indeed the first c is unused
<pierpa>
if you want the second c to match only if it has the same value as the first c then you can use a "when" guard
<haesbaert>
ah I see it now, merlin tricked me before
shinnya has quit [Ping timeout: 245 seconds]
psy_ has quit [Ping timeout: 250 seconds]
kushal has quit [Ping timeout: 265 seconds]
danieli has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
kushal has joined #ocaml
struk|desk|away is now known as struk|desk2
ygrek has quit [Ping timeout: 250 seconds]
Mirry has quit [Quit: leaving]
psy_ has joined #ocaml
psy_ has quit [Read error: Connection reset by peer]
mahasamoot has quit [Ping timeout: 245 seconds]
struk|desk2 is now known as struk|desk|away
b4284 has joined #ocaml
<b4284>
hello
<b4284>
i've run into an error message that raised a question
<b4284>
the compiler goes: "The type constructor int expects 0 argument(s)", which describes argument" with an s
<b4284>
which implies that it's possible for type constructor to have plural arguments
<b4284>
but how do i do it ?
<b4284>
type location = Street of int * int * int
<b4284>
would mean that Street takes one tuple of 3 elements, instead of 3 separate arguments
<pierpa>
looks like constructors can have more than 1 arguments:
<pierpa>
# type t = C of int * int * int;;
<pierpa>
type t = C of int * int * int
<pierpa>
# type t = D of (int * int * int);;
<pierpa>
type t = D of (int * int * int)
<pierpa>
these two cases are printed differently
<pierpa>
# C;;
<pierpa>
Error: The constructor C expects 3 argument(s),
<pierpa>
but is applied here to 0 argument(s)
<b4284>
#C 5 5 5
<b4284>
# C 5 5 5;;
<b4284>
pierpa: it seems no different than passing a tuple in effect
<pierpa>
similar but different
kushal has quit [Ping timeout: 260 seconds]
mac10688 has quit [Ping timeout: 240 seconds]
kushal has joined #ocaml
gustav___ has quit [Ping timeout: 260 seconds]
djellemah_ has joined #ocaml
johnelse has quit [Ping timeout: 246 seconds]
djellemah has quit [Ping timeout: 256 seconds]
johnelse has joined #ocaml
gustav___ has joined #ocaml
johnelse is now known as Guest77895
tmtwd has joined #ocaml
rand has joined #ocaml
rand is now known as Guest76818
cody` has quit [Quit: Connection closed for inactivity]
mahasamoot has joined #ocaml
darkf has joined #ocaml
MercurialAlchemi has joined #ocaml
mac10688 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
mac10688 has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
poincare101 has joined #ocaml
wolfcore has quit [Ping timeout: 260 seconds]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
wolfcore has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
pierpa has quit [Ping timeout: 250 seconds]
poincare101 has quit [Quit: poincare101]
fantasticsid has joined #ocaml
lokien_ has joined #ocaml
zpe has joined #ocaml
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 240 seconds]
mahasamoot has quit [Ping timeout: 255 seconds]
tmtwd has quit [Ping timeout: 240 seconds]
JacobEdelman has quit [Quit: Connection closed for inactivity]
zpe has quit [Remote host closed the connection]
badon has quit [Ping timeout: 256 seconds]
zaquest has quit [Quit: Leaving]
mahasamoot has joined #ocaml
Simn has joined #ocaml
antkong has quit [Quit: antkong]
Haudegen has quit [Ping timeout: 240 seconds]
jacquev6 has joined #ocaml
wolfcore has quit [Ping timeout: 276 seconds]
wolfcore has joined #ocaml
Algebr has joined #ocaml
<sspi>
any hints on finding type declarations during ppx? (I do get the names of the types, and basic types seem to work - however records and variants are not)
<sspi>
currently using Env.find_type - but not sure if this is correct, or the right one is somewhere else
badon has joined #ocaml
zaquest has joined #ocaml
sbrouf has joined #ocaml
Haudegen has joined #ocaml
ygrek has joined #ocaml
fantasti` has quit [Read error: Connection reset by peer]
xyh has joined #ocaml
sbrouf has quit [Quit: Quitte]
Guest76818 has quit [Ping timeout: 246 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
mahasamoot has quit [Ping timeout: 240 seconds]
AltGr has joined #ocaml
AltGr has left #ocaml [#ocaml]
cdidd has quit [Ping timeout: 260 seconds]
kushal has quit [Ping timeout: 260 seconds]
freehck` has joined #ocaml
jacquev6 has quit [Quit: jacquev6]
Algebr has quit [Ping timeout: 240 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
kushal has joined #ocaml
Algebr has joined #ocaml
ontologiae has joined #ocaml
cdidd has joined #ocaml
larhat1 has quit [Quit: Leaving.]
FreeBirdLjj has quit [Ping timeout: 264 seconds]
Algebr has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
b4284 has quit [Quit: Page closed]
d0nn1e has quit [Ping timeout: 255 seconds]
d0nn1e has joined #ocaml
_andre has joined #ocaml
antkong_ has joined #ocaml
zpe has joined #ocaml
antkong_ has quit [Client Quit]
AltGr has joined #ocaml
struk|desk|away is now known as struk|desk2
iorivur has quit [Ping timeout: 250 seconds]
iorivur has joined #ocaml
toolslive has joined #ocaml
<toolslive>
any emacs gurus here? I want to change the caml-annot-dir variable, but I'm not sure what types are acceptable, it can be a string, but is a list of strings also ok ?
cody` has joined #ocaml
iorivur has quit [Ping timeout: 250 seconds]
zpe has quit [Remote host closed the connection]
iorivur has joined #ocaml
<flux>
toolslive, no idea, but you could try C-h v caml-annot-dir to find its documentation
<rks`>
also: why do you need to change that variable?
struk|desk2 is now known as struk|desk|away
<sspi>
nevrmind - got it! :D
<sspi>
I was giving the wrong env variable
<freehck`>
toolslive: It seems my emacs doesn't have such variable.
<freehck`>
Well, If you need to change it's value you could try type (setq caml-annot-dir "/path/in/form/of/string"), move the point to the end of sexp end press C-x C-e
<toolslive>
I needed to set it to make the caml mode find the annot files.
<toolslive>
it's elisp documentation, types are not really important for them ;)
<freehck`>
toolslive: what is caml mode? I'm using Tuareg and Merlin.
<toolslive>
yeah, it's tuareg.... merlin never works
<freehck`>
toolslive: types are important but in run-time.
<freehck`>
toolslive: but it does work
<freehck`>
merlin-mode I mean
<haesbaert>
works great actually
<freehck`>
except only one thing: u need to compile your project to have completion from other files of the project
<rks`>
freehck`: you also need that if you want .annot files to be present
<rks`>
there are no shortcuts.
<freehck`>
rks`: what are these .annot files?
<toolslive>
I run prelude, and the combination merlin, prelude will make my emacs spin randomly (100% cpu, freeze indefinitely)
<rks`>
freehck`: ancestors of .cmt files
<rks`>
~ a textual representation of the typedtree
zpe has joined #ocaml
sier-pyon-ski has quit [Quit: Loops are hard, let's GOTO shopping!]
xyh has quit [Ping timeout: 276 seconds]
petercommand has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
Guest77895 is now known as johnelse
Haudegen has quit [Ping timeout: 250 seconds]
sepp2k has joined #ocaml
zpe has quit [Remote host closed the connection]
jacquev6 has joined #ocaml
ggole has joined #ocaml
xyh has joined #ocaml
JacobEdelman has joined #ocaml
Haudegen has joined #ocaml
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 265 seconds]
darkf has quit [Ping timeout: 272 seconds]
darkf has joined #ocaml
thesnowdog1 has quit [Ping timeout: 240 seconds]
thesnowdog1 has joined #ocaml
thesnowdog1 has quit [Ping timeout: 240 seconds]
thesnowdog1 has joined #ocaml
xyh is now known as APM666
zoobab has quit [Ping timeout: 250 seconds]
zoobab has joined #ocaml
APM666 is now known as little-demon-fox
chinglish has joined #ocaml
chinglish has left #ocaml [#ocaml]
zpe has joined #ocaml
rand has joined #ocaml
rand is now known as Guest12225
lewis1711 has joined #ocaml
<lewis1711>
so what's the idiomatic ocaml community thing to do for build scripts on a public repo, like github?
<lewis1711>
makefiles?
<companion_cube>
people use different build systems
<companion_cube>
but if it's a library on github, chances are t hat it has an 'opam' file so you can easily install it
<lewis1711>
right I'm using corebuild out of laziness
<companion_cube>
yeah, in general ocamlbuild and the likes are fine
<companion_cube>
some people use oasis
<lewis1711>
just put them in some script?
<lewis1711>
compile.sh or something?
<companion_cube>
I don't see why you would do that
<companion_cube>
if you explain how to compile in the readme, it should be fine
<lewis1711>
hmm, ok. I did
<companion_cube>
(ok, I tend to have a small makefile that calls my build system)
yomimono has joined #ocaml
<edwin>
an opam file would help too, then people can just pin your github repo in opam and install it
Sorella has joined #ocaml
little-demon-fox is now known as shaman
<freehck`>
lewis1711: I've been packaging a pile of ocaml modules and it seems that GNU Make is more popular than other build systems.
<Drup>
I doubt that
<Drup>
the different is that everyone uses makes as a shortcut
<companion_cube>
maybe it's true for old projects
<companion_cube>
the ones that are not already packaged by their author
<freehck`>
Drup: It's quite personal feeling. All I can provide as evidence in this argue is a list of modules I've packaged.
<freehck`>
companion_cube: maybe. I've a rare old-schoole. )
<freehck`>
*I'm
<toolslive>
we use myocamlbuild, but end up writing a makefile for the comfort of users and scripts (debian packaging is way easier if you have it, fe)
<toolslive>
plenty of our libs are installable via opam, again for the comfort of users ...
<Drup>
toolslive: does the makefile calls ocamlbuild ?
<toolslive>
yes, but sometimes it also needs to build cpp, or latex or whatever
<companion_cube>
I always use a makefile but it calls ocamlbuild directly
Mercuria1Alchemi has quit [Ping timeout: 246 seconds]
<sigjuice>
I have utop running inside Emacs, but C-c C-b will not evaluate a buffer that contains '#require' . I am new to this so I am not sure if I am doing something wrong or if there is some problem with my setup. Any suggestions?
cody` has joined #ocaml
sspi has joined #ocaml
<Algebr`>
Can you provide more details, are you getting errors, check the messages buffer in emacs, C-h e
S11001001 has joined #ocaml
ygrek has joined #ocaml
tane has quit [Quit: Verlassend]
kdas_ has joined #ocaml
larhat1 has joined #ocaml
kushal has quit [Ping timeout: 260 seconds]
ollehar has quit [Ping timeout: 255 seconds]
<sigjuice>
Here is a screenshot http://i.imgur.com/UcHNbU4.png . 1. I started with a minimal file called test1.ml 2. Then hit C-c C-b. It looks like the contents of test1.ml got fed to the *utop* buffer. I expected 'x' to be bound, but it isn't.
kdas_ has quit [Read error: Connection reset by peer]
lambdahands has joined #ocaml
kushal has joined #ocaml
enquora has joined #ocaml
<Algebr`>
that is odd to me.
<lyxia>
looks like it cuts off after the first ;; and doesn't even read past it
<sigjuice>
I don't see any errors in in the *Messages* buffer
kakadu has joined #ocaml
Mercuria1Alchemi has joined #ocaml
darkf has quit [Quit: Leaving]
<sigjuice>
Looks like bindings before #require get evaluate. But bindings after #require do not. http://i.imgur.com/x8M7lAp.png
ggherdov has joined #ocaml
<Algebr`>
maybe #require "core_bench" is doing a side effect. try something else, #require "yojson" or whatever.
kushal has quit [Ping timeout: 264 seconds]
<sigjuice>
#require "yojson" behavior is identical to #require "core_bench"
<sigjuice>
Looks like I can get away with adding #requires to ~/.ocamlinit so I don't have to put them in my .ml files.
<edwin>
#require works here with ./elpa/utop-20151105.247 and emacs 24.4.1
<sigjuice>
edwin : thanks, I will give elpa's utop a try.
antkong has joined #ocaml
<edwin>
diff shows very small difference
<edwin>
in a function thast not even used
<edwin>
I mean utop 1.18.1's utop.el and elpa's
<edwin>
did you try utop from commandline?
<edwin>
does it behave correctly there?
<sigjuice>
utop from the command line is a different setting and behaves normally. i.e. if I type individual lines ending in ;; then everything is as I expect.
kushal has joined #ocaml
ollehar has joined #ocaml
AltGr has joined #ocaml
jeffmo has joined #ocaml
AltGr has left #ocaml [#ocaml]
yomimono has quit [Ping timeout: 272 seconds]
BitPuffin has quit [Read error: Connection reset by peer]
sbrouf has joined #ocaml
_andre has quit [Quit: leaving]
malc_ has joined #ocaml
<xyh>
how to let the repl truncate long arrays ?
<lyxia>
xyh: doesn't it already do that?
<xyh>
not for bytes
<Algebr`>
there's a config you can do with # somethign
thorsten` has left #ocaml ["WeeChat 1.4-dev"]
<Algebr`>
#print_depth and #print_length methinks
<Algebr`>
this is for utop
<xyh>
utop ?
<lyxia>
doesn't seem to work on bytes
<Algebr`>
xyh: utop is an enchanced ocaml repl.
<Drup>
yeah, pretty sure it doesn't work on bytes/strings