<m1dnight_>
The first error is about the spaces in the descriptoin.
<m1dnight_>
I remove the spaces there and then it complains about the colon at line 18.
<Algebr`>
yes, you need to indent the stuff under Library
<Algebr`>
and exectuable
<Algebr`>
by 2 spaces
<m1dnight_>
Oh.
<Algebr`>
the blog post needs to be fixed
<Algebr`>
rather, the post
<m1dnight_>
Aha, that makes sense.
<m1dnight_>
Thanks Algebr`
<Drup>
Algebr`: maybe you should just redirect to the oasis tutorial (that is also on ocaml.org)
* m1dnight_
has already found that one :D
<m1dnight_>
I just wanted to get up and running fast.
<Drup>
sveit: yes, it's the goal
<sveit>
Drup: well I can't get it to compile :( i get an error about missing Outcometree
<sveit>
also the project seems relatively old, but maybe that does not matter.
<Drup>
hum, ocamlnat is included in ocaml
<Drup>
you build the compiler (see INSTALL.adoc) and then "make ocamlnat"
<sveit>
should "opam switch..." pull it in?
<Drup>
unfortunatly, it's not build by the opam switches, not sure why
<sveit>
i see. this is a very simple question, but the best way to proceed would be just to pull down the compiler from https://github.com/ocaml/ocaml and build?
<Drup>
as a first approach, I guess, yes. Use the 4.03 tag, not the trunk branch
<Drup>
later, it might be more convenient to make your own switch description that also builds ocamlnat (assuming it proves succesfull for what you want to do)
<sveit>
great, thanks for all the help!
rgrinberg has joined #ocaml
shinnya has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
Algebr` has quit [Read error: Connection reset by peer]
Algebr` has joined #ocaml
d0nn1e has quit [Ping timeout: 246 seconds]
SomeDamnBody has joined #ocaml
<SomeDamnBody>
Drup: thanks to you and mrvn. Sorry I only just now saw it
d0nn1e has joined #ocaml
walter|r has quit [Remote host closed the connection]
jeffmo has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
walter|r has joined #ocaml
pierpa has quit [Ping timeout: 246 seconds]
SomeDamnBody has quit [Remote host closed the connection]
Algebr` has quit [Ping timeout: 250 seconds]
srcerer_ has joined #ocaml
Algebr` has joined #ocaml
srcerer has quit [Ping timeout: 260 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Algebr` has quit [Ping timeout: 250 seconds]
walter|r has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 244 seconds]
sveit has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
m1dnight_ has quit [Quit: WeeChat 1.5]
Algebr` has joined #ocaml
FreeBirdLjj has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
jmasseo has quit [Ping timeout: 244 seconds]
jonasen has joined #ocaml
slash^ has joined #ocaml
pecan has joined #ocaml
yunxing_ has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
yunxing_ has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
tmtwd has joined #ocaml
jonasen has joined #ocaml
yunxing__ has joined #ocaml
mcspud has quit [Ping timeout: 250 seconds]
mcspud has joined #ocaml
yunxing_ has quit [Ping timeout: 272 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A1977494 has joined #ocaml
MercurialAlchemi has joined #ocaml
Nahra has quit [Remote host closed the connection]
Intensity has quit [Remote host closed the connection]
jbrown has quit [Ping timeout: 276 seconds]
Intensity has joined #ocaml
slash^ has quit [Remote host closed the connection]
slash^ has joined #ocaml
tane has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
copy` has quit [Quit: Connection closed for inactivity]
jonasen has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
A1977494 has quit [Quit: Leaving.]
jonasen has joined #ocaml
yunxing__ has quit [Remote host closed the connection]
Simn has joined #ocaml
mcspud has quit [Max SendQ exceeded]
kushal has joined #ocaml
mcspud has joined #ocaml
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 276 seconds]
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
silver has joined #ocaml
ibor has joined #ocaml
kushal has quit [Quit: Leaving]
sdothum has joined #ocaml
fluter has quit [Ping timeout: 250 seconds]
malc_ has joined #ocaml
fluter has joined #ocaml
jonasen has joined #ocaml
rgrinberg has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 264 seconds]
jolabrycol has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
malc_ has quit [Ping timeout: 244 seconds]
fluter has quit [Quit: WeeChat 1.4]
malc_ has joined #ocaml
fluter has joined #ocaml
ibor has quit [Ping timeout: 260 seconds]
MercurialAlchemi has joined #ocaml
jolabrycol has quit [Quit: Leaving]
Nahra has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
TheLemonMan has joined #ocaml
Simn has joined #ocaml
walter|r has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
darkf has quit [Quit: Leaving]
jbrown has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
AlexRussia has joined #ocaml
jonasen has joined #ocaml
jgjl has joined #ocaml
SIGGIL has joined #ocaml
john51_ has joined #ocaml
inr_ has joined #ocaml
Rome has joined #ocaml
jeroud_ has joined #ocaml
kolko_ has joined #ocaml
oldmanistan__ has joined #ocaml
mankyKitty_ has joined #ocaml
yunxing_ has joined #ocaml
ggherdov_ has joined #ocaml
sgronblo_ has joined #ocaml
atsampso1 has joined #ocaml
tautologico_ has joined #ocaml
rwmjones_ has joined #ocaml
tautologico has quit [Ping timeout: 258 seconds]
oldmanistan_ has quit [Ping timeout: 258 seconds]
ggherdov has quit [Ping timeout: 258 seconds]
kolko has quit [Ping timeout: 258 seconds]
jeroud has quit [Ping timeout: 258 seconds]
rwmjones has quit [Ping timeout: 258 seconds]
abeaumont has quit [Ping timeout: 258 seconds]
mankyKitty has quit [Ping timeout: 258 seconds]
sgronblo has quit [Ping timeout: 258 seconds]
RomanZ5 has quit [Ping timeout: 258 seconds]
SIGILL has quit [Ping timeout: 258 seconds]
atsampson has quit [Ping timeout: 258 seconds]
jbrown has quit [Ping timeout: 258 seconds]
fluter has quit [Ping timeout: 258 seconds]
cnu- has quit [Ping timeout: 258 seconds]
rbocquet has quit [Ping timeout: 258 seconds]
igitoor has quit [Ping timeout: 258 seconds]
breitenj- has quit [Ping timeout: 258 seconds]
inr has quit [Ping timeout: 258 seconds]
john51 has quit [Ping timeout: 258 seconds]
manizzle has quit [Ping timeout: 258 seconds]
mfp has quit [Ping timeout: 258 seconds]
yunxing has quit [Ping timeout: 258 seconds]
breitenj has joined #ocaml
oldmanistan__ is now known as oldmanistan_
tautologico_ is now known as tautologico
fluter_ has joined #ocaml
jbrown has joined #ocaml
mfp has joined #ocaml
manizzle has joined #ocaml
rbocquet has joined #ocaml
jeroud_ is now known as jeroud
cnu- has joined #ocaml
cnu- has quit [Excess Flood]
yunxing_ is now known as yunxing
cnu- has joined #ocaml
mankyKitty_ is now known as mankyKitty
igitoor has joined #ocaml
ggherdov_ is now known as ggherdov
igitoor has quit [Changing host]
igitoor has joined #ocaml
pierpa has joined #ocaml
SIGGIL is now known as SIGILL
MercurialAlchemi has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jbrown has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
walter|r has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
hcarty has joined #ocaml
hcarty has quit [Ping timeout: 240 seconds]
jonasen has joined #ocaml
tmtwd has joined #ocaml
jmasseo has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
d0nn1e has quit [Ping timeout: 240 seconds]
abeaumont has joined #ocaml
Algebr` has joined #ocaml
d0nn1e has joined #ocaml
jbrown has joined #ocaml
<tormen_>
Hi. When you "include" a module does this include ALL its values or only the ones defined in the signature of the included module ?
<_y>
try it!
<companion_cube>
only the visible values are available
<_y>
or: what does your heart says?
<_y>
*say
<tormen_>
_y: I am trying it ;)
<tormen_>
_y: My heart... hmmm my heart guesses only te signature... but then again it's an INCLUDE so ... my heart does not know what to say
* tormen_
's heart is undecided ^^
<tormen_>
... but it'll shall seek the truth :)
<_y>
always follow your heart
<malc_>
The expression include module-expr in a structure re-exports in the current structure all definitions of the structure denoted by module-expr.
<tormen_>
How can one "print" the module signature in a test program ?
<tormen_>
... as always one question leads to the next ;)
<Drup>
"ocamlc -i foo.ml" shows the signature of Foo
<tormen_>
ah okey
<tormen_>
Drup: thanks! ... again :)
<_y>
there is also « #show Module » in the toplevel
MercurialAlchemi has joined #ocaml
<tormen_>
_y : Okey so it is ALL the definitions (like malc mentioned... THANKS ! ... but I needed to see it ;))
<tormen_>
... ah moment... my example has a flaw ;) ...
silver has quit [Ping timeout: 252 seconds]
<Enjolras>
what ? It is only the signature. But of course, if you do module Foo = struct ... end with the signature restricted somewhere else, it will include the whole Foo
<_y>
it would be annoying if you got ghost values dangling in your module with unknown names, types and semantics
<Enjolras>
but include (Foo : sig type t end) will only include t. Or module Foo : sig type t end = struct ... end and later include Foo will also only include t
<companion_cube>
oh joy, modifying the stdlib requires bootstraping
<tormen_>
_y: Hmm. I had defined first a module A = ... followed by a module type A .... .... ;) ... so my heart knows now that it's first intuition was the right one :)) ... as you said: one should always follow it's heart :D
<Enjolras>
tormen_: module and signature namespace are distincts, just like types and values namespaces. So if you define a module type and a module with the same name, it doesn't mean the signature applies to the module
<Enjolras>
in case it wasn't clear to you :=
<Enjolras>
:)*
<Drup>
_y: worse than that, it would completely break abstraction
<_y>
y
<tormen_>
Enjolras: yes... no it WAS actually already clear to SOME part of my brain... but somehow this part went AWOL for a sec ;)
tmtwd has quit [Ping timeout: 240 seconds]
<tormen_>
Thanks to *everyone* !!! You are such a great and welcoming community !!!! Awesome. Very motivating :)))
<tormen_>
So: Enjolras , _y Drup and malc_ + companion_cube : Thanks :)
<Enjolras>
yw
<tormen_>
_y: You said "it would be annoying if you got ghost values dangling in your module with unknown names, types and semanticsit would be annoying if you got ghost values dangling in your module with unknown names, types and semantics" ... but as ocaml is typed it can induce these types, like it does for the original module, no?
<tormen_>
(sorry, pasted your comment 2x ;))
<_y>
tormen_, i mean, *you* as the programmer know anything about these internal values
<_y>
*know nothing
<tormen_>
(because for a module A which signature does not cover certain values ... ocaml will induce its types... so why not do that in the module that "include"s the module... this should not result in ghost values, no ?
<tormen_>
_y: ah ok... yeah ... I am in a case where I have full source code access... but this might not be the case ...
<tormen_>
and sure it makes more sense that it's only the signature (public interface) ...
<_y>
precisely because they are internal, thus hidden on purpose from the user, via abstraction
<tormen_>
_y: ... sorry. I am still trying to wrap my head around all the implications of a fully typed language ... :(
* tormen_
does not give up easily and is getting there ... step by step :))
<tormen_>
_y: I like your name... so positive :)
<_y>
abstraction being precisely what says that you are not even supposed to being able to access those values
<tormen_>
... yes, yes... makes sense ^^
<tormen_>
:)
<_y>
tormen_, it was not the original meaning of it, but eh, y not :-)
* _y
now has a polysemic nick
* tormen_
is looking up polysemic ... which sounds like an illness ;)
<tormen_>
ah multiple semantics
<tormen_>
hehe
<tormen_>
Can one include the signature of another module ?
<_y>
y
<tormen_>
k
<_y>
:-)
<tormen_>
:)
<tormen_>
let's cut to the chase and do efficient chat communication :)
<_y>
i am attached to my nose at least as much as my nose is attached to me
<_y>
the syntax is again « include MODULE »
<tormen_>
nose: ok sounds true
<_y>
the difference with the module *value* inclusion being that it is written in a signature
<_y>
and MODULE has to be the name of a module *signature*, not a module
<_y>
note than you can write « include module type of Module »
<tormen_>
syntax: Hmmm it tells me "Error: Unbound module type A" ... hmmm ah okey cool !
<tormen_>
... because I am not sure if there is a signature and what it is named
<tormen_>
nice I got a version that compiles :) ... have to go now
AlexRussia has quit [Ping timeout: 260 seconds]
Algebr` has quit [Ping timeout: 240 seconds]
infinity0 has quit [Remote host closed the connection]
Algebr` has joined #ocaml
A1977494 has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
AlexRussia has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
inr_ is now known as inr
infinity0 has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
infinity0 has quit [Remote host closed the connection]
<flux>
sadly these aren't on-par with C++ iterators :(, are they? for example, you cannot compare them and they are always forward-only
<companion_cube>
no, indeed
<flux>
also what's that sneaking of 'range' to the same commit..
<companion_cube>
C++ iterators are much more complicated
<companion_cube>
couldn't resist :s
<companion_cube>
maybe I should cut it out and add it later with missing `fold` functions
<flux>
misses documentation on what happens if a > b
<companion_cube>
(it makes a decreasing range, but yeah, need to comment)
laurus has joined #ocaml
<flux>
I would actally expect Invalid_argument or empty range
<flux>
why put all these whitespace changes into the same commit as well.. :)
<companion_cube>
but then you'd need 2 range functions
<companion_cube>
oh, weird
<companion_cube>
I'm suspecting the whitespace wasn't consistent in .ml and .mli, I had to copy paste a bit
<companion_cube>
(to revert a change)
<flux>
there are foo: -> foo : -changes, but not on all signatures
<flux>
neater if they were a separate commit though..
<companion_cube>
it wasn't intentional :/
<Drup>
companion_cube: Array.to_gen is there twice
laurus has left #ocaml ["Leaving"]
<Drup>
bleh, nevermind, can't read
<companion_cube>
:D
dexterph has joined #ocaml
<companion_cube>
I'm worried, if people start bikeshedding so much here, the PR is going to be a rampage
<companion_cube>
Drup: I'm counting on support from you
<Drup>
companion_cube: for the purpose of the stdlib, I don't think you should declare your gen type everywhere
<companion_cube>
well, I don't have a better solution (yet?)
<companion_cube>
CamlInternalGen ?
mcc has joined #ocaml
<companion_cube>
with just a type def in it?
<Drup>
or just Gen :D
jnavila has joined #ocaml
<companion_cube>
huuu
<companion_cube>
that would kind of break userspace :]
silver has joined #ocaml
yunxing_ has joined #ocaml
yunxing_ has quit [Client Quit]
dmj` has quit [Ping timeout: 244 seconds]
slash^ has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 250 seconds]
jonasen has joined #ocaml
malc_ has quit [Remote host closed the connection]
dmj` has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
diphuser has joined #ocaml
dexterph has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
ibor has joined #ocaml
<gasche>
companion_cube: it's hard to follow your benchmark results because the benchmark code does not have pointers to where the various modules are implemented
<gasche>
could you add them?
<_y>
companion_cube, in Buffer.of_list, why allocating a buffer with an initial size of 32 instead of getting the size from List.length?
<_y>
(same goes for Hashtbl.of_list)
<Drup>
gasche: most of it is in `bench.ml` in the same repository
<gasche>
yep, "most"
Sorella has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
<gasche>
Gen, Sequence, Core.Sequence don't
<Drup>
hum, right
<_y>
also, why add the new functions of Hashtbl inside a new separate signature FULL?
<Drup>
yeah, I don't really understand that part of the patch
<gasche>
maybe to avoid breaking code that advertizes that it meets the Hashtbl.S signature?
<gasche>
_y: you should ask on the patch, though, that's the point of reviews
jonasen has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jonasen has quit [Client Quit]
AlexRussia has joined #ocaml
jnavila has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 244 seconds]
dhil has joined #ocaml
rrika has joined #ocaml
<rrika>
Hello, I'm ocaml beginner and want to use "string_before"
<mrvn>
Error: Unbound value string_before
<rrika>
I guess I'll have to use "Str." before but that doesn't work either.
dmj` has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
<Kakadu>
-package str
<mrvn>
#require "str";; in the toplevel
<rrika>
I get "Unknown directive `package'."
<Kakadu>
#use "topfind";;
octachron has joined #ocaml
<companion_cube>
gasche: hmmm, I'll edit the readme
<gasche>
I'm not sure if people would think of looking in the README; maybe add a pointer to it in the bench.ml part defining the benchmarks
<gasche>
(that's the natural place to look for what the various implementations are)
<rrika>
oh, "-package str" is what I pass to the compiler?
<rrika>
no that doesn't work either
<gasche>
it depends on how you build your program
<gasche>
if you're using ocamlfind, "-package str" should work
<rrika>
well, I have a .ml file that I want to load and use from the repl
<rrika>
and that .ml file needs to slice a few strings
<gasche>
what repl are you using? if it is "ocaml", you need #use "topfind";; then #use "str";;
<gasche>
(#load "str.cma";; would also work, I think, but it's more low-level and doesn't scale to other libraries)
<gasche>
if you are using "utop", which you should because it's better than "ocaml", then #require "str";; should work directly
<rrika>
I thought I need to compile the ml file before being able to load it from the repl
<gasche>
you can do just #use "foo.ml";;
<gasche>
if you compile, then for example "ocamlfind ocamlc -package str foo.ml" should work
<companion_cube>
gasche: done
<gasche>
thanks
<gasche>
rrika: which learning document are you using, out of curiosity? (I don't know what tools it recommends)
<companion_cube>
_y: maybe so, I could read the length indeed
<rrika>
gasche, none actually
<gasche>
interesting
<rrika>
I just know that there's let, let rec, matchwith
<rrika>
and I know a bit about other functional languages
<rrika>
"File foobar.ml is not a bytecode object file."
<gasche>
( companion_cube : I think reading the length may actually improve performances; and it avoids resizing allocations )
<gasche>
#use, not #load, for source files
<rrika>
my fault I used require instead of use
<companion_cube>
possible, indeed
<companion_cube>
I don't like to traverse twice, but in this case...
<gasche>
traversing twice is bad when it's slow or changes the semantics
MercurialAlchemi has quit [Ping timeout: 244 seconds]
<gasche>
rrika: I warmly recommend trying "utop"
<rrika>
cool that works
<gasche>
it will make your toplevel experience much smoother
<rrika>
will look into it
<Drup>
companion_cube: well, measure for big and small list, and we will see :)
<companion_cube>
yayyyyy
<companion_cube>
so much instrumentation to do
<Drup>
hum ? Not really
<companion_cube>
setup a script, compile, try it, recompile, blabla
<Drup>
copy the implementation of hashtbl in an external file, add both version, do one benchmark
<Drup>
:D
<companion_cube>
of_list can be done from another lib
<companion_cube>
;)
<Drup>
oh right, easy then !
<Drup>
no need to play with the stdlib
<companion_cube>
yeha, you can do it! :P
<companion_cube>
also, I'm not sure about whether hashtbl.of_list should use add or replace
<companion_cube>
:/
<Drup>
I would tend to say "have only the add version"
<Drup>
if people want replace, they can do it themselves, most of the time you want add ...
<Drup>
(or you don't care)
<companion_cube>
I'm not sure, most of the time I want replace
<companion_cube>
add is really a niche feature imho
ibor has quit [Ping timeout: 240 seconds]
<Drup>
add is faster, the compromise is that it takes more space.
<companion_cube>
and it has a weird semantics w.r.t remove
ygrek has quit [Ping timeout: 244 seconds]
<Drup>
(I wouldn't mind having "replace_with_fun : ('a, 'b) t -> 'a -> ('b -> 'b)"
MercurialAlchemi has joined #ocaml
darkf has joined #ocaml
<companion_cube>
yeah, even `update`
<companion_cube>
the one from batteries is nice, iirc
<companion_cube>
I also use `get_or : ('a,'b) t -> 'a -> default:'b -> 'b`
rrika has left #ocaml ["Ex-Chat"]
<octachron>
gasche, just musing, but why stop at type-directed indexing operator? Type-directed arithmetic operators might be even nicer.
A1977494 has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<companion_cube>
gasche: fixed the traversal ordering, indeed
<companion_cube>
this code is new, becaues I couldn't write it in containers
zaquest has joined #ocaml
Simn has quit [Quit: Leaving]
sgronblo_ has quit [Ping timeout: 264 seconds]
octachron has quit [Quit: Leaving]
fluter_ is now known as fluter
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
walter|r has joined #ocaml
Kakadu has quit [Remote host closed the connection]
douglascorrea has joined #ocaml
douglascorrea has quit [Remote host closed the connection]