<ianhedoesit>
yeah, I was just hoping for a more rich syntax highlighting option.
<companion_cube>
oh, I didn't compare, tbh :)
<ianhedoesit>
yeah, they're all fine (most use the same syntax highlighting anyway)
<companion_cube>
I suppose so, something like pygments or the php equivalent
<ianhedoesit>
yup
nicholasf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nicholasf has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
ianhedoesit has quit [Quit: leaving]
nicholasf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has joined #ocaml
eni_ has joined #ocaml
eni_ is now known as eni
zpe has joined #ocaml
^elyse^ has joined #ocaml
infinity0 has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 260 seconds]
mort___ has quit [Remote host closed the connection]
yegods has quit [Remote host closed the connection]
govg has joined #ocaml
infinity0 has joined #ocaml
mort___ has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
cody` has joined #ocaml
cdidd has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
cdidd has joined #ocaml
zpe has joined #ocaml
d0nn1e has quit [Ping timeout: 246 seconds]
d0nn1e has joined #ocaml
zpe has quit [Remote host closed the connection]
yomimono has joined #ocaml
rand has quit [Quit: leaving]
supercircle4 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
patronus_ has joined #ocaml
Nahra``` has joined #ocaml
flx_ has joined #ocaml
mehdi___ has joined #ocaml
pootler_ has joined #ocaml
infinity0 has joined #ocaml
Pepe__ has joined #ocaml
_2can_ has joined #ocaml
vbmithr has joined #ocaml
Mandus_ has joined #ocaml
adrien_z- has joined #ocaml
Drup has joined #ocaml
w1gz_ has joined #ocaml
infinity0 has quit [Remote host closed the connection]
flx_ is now known as flux
infinity0 has joined #ocaml
pootler_ has quit [Ping timeout: 260 seconds]
Simn has quit [Read error: Network is unreachable]
Guest55091 has joined #ocaml
edwin has joined #ocaml
M-Illandan has joined #ocaml
rbocquet has joined #ocaml
yminsky has quit [Read error: Connection reset by peer]
rom1504 has quit [Ping timeout: 264 seconds]
yminsky has joined #ocaml
lopex_ has joined #ocaml
lopex has quit [Ping timeout: 264 seconds]
lopex_ is now known as lopex
pootler_ has joined #ocaml
rom1504 has joined #ocaml
msch has quit [Read error: Connection reset by peer]
groovy3shoes has joined #ocaml
msch has joined #ocaml
mietek has quit [Ping timeout: 264 seconds]
groovy2shoes has quit [Ping timeout: 260 seconds]
mietek has joined #ocaml
S11001001_ has joined #ocaml
S11001001 has quit [Ping timeout: 264 seconds]
S11001001_ is now known as S11001001
ggole has joined #ocaml
<Kakadu>
Any ideas why ocaml toplevel doesn't have directive like #ppx2 "(value : Ast_mapper.mapper)" ?
<companion_cube>
what would that do?
<Kakadu>
will try to apply mapper to evey definition
<Kakadu>
at the moment #ppx does some System.command
<companion_cube>
oh, I see
<companion_cube>
that would be interesting
Guest55091 has quit [Read error: Network is unreachable]
Guest55091 has joined #ocaml
Sim_n has joined #ocaml
Guest55091 has quit [Ping timeout: 264 seconds]
JacobEdelman has joined #ocaml
FreeBirdLjj has joined #ocaml
Sim_n has quit [Read error: Network is unreachable]
Sim_n has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
S11001001 has quit [Ping timeout: 264 seconds]
S11001001 has joined #ocaml
mort___ has quit [Remote host closed the connection]
^elyse^ has quit [Quit: Leaving]
yomimono has joined #ocaml
IP92 has joined #ocaml
<IP92>
I have this code http://pastebin.com/fD9cByaZ and the error message is there as well, why am I getting that although I explicitly say that t = int ?
Leonidas has joined #ocaml
<def`>
IP92: the error message is pretty clear
<def`>
the signature expects a : unit -> int while the structure contains a : int
vanilla_ has joined #ocaml
<IP92>
how do I denote no input arguments then? ?
<def`>
let a () = 10
<IP92>
or the other option is to write val a : int right?
<def`>
yes
pierpa` has joined #ocaml
<IP92>
but if I were to not specify that t = int, how could I have that a = 10 ? kinda leave the t abstract
<def`>
I don't understand ?
<def`>
you would only know that there is a value named a of type t
<def`>
inside the structure, t is int and a is 10, outside, we can't tell anything
<def`>
you still have to provide a definition for t, which happens to
<def`>
be an int
<def`>
so add
<def`>
type t = int to Proov2 and that will be fine
<IP92>
what's the difference if I add the t = int after the :Proov as "with t = int"
<IP92>
"with type t = int"*
<def`>
in this case you are changing the signature
<IP92>
in Proov1 the signature is type t = int; val a : t, in Proov2 the signature is type t; val a : t?
<def`>
yes
<IP92>
ok, thanks
<def`>
but in both case there needs to be a type t in the structure
<def`>
and furthermore, a should be of type t
<def`>
each structure as a "most precise" signature.
<IP92>
so if I tried computing something with Proov1.a, then the type is t, but in case of Proov2.a, it is of type int?
<def`>
the opposite
<IP92>
ah yes
<IP92>
although I know that the Proov2.a is actually a 10
<def`>
Proov1.a is of type Proov1.t = int
<def`>
well, inside your mind but not elsewhere
Haudegen has quit [Ping timeout: 260 seconds]
<IP92>
yes
<def`>
it is just abstract :)
<IP92>
and Proov2.a is of type Proov2.t, just an abstract type ?
<def`>
exact
<IP92>
ok, that cleared stuff up a bit, thanks
<def`>
np
<def`>
a structure has a canonical signature, then when you constrain it with ": some_signature"
<def`>
the compiler check that the inclusion is correct (everything in some_signature must exists in the structure), and then forgets the rest (what was inside the structure but not in some_signature)
yawnt has joined #ocaml
yawnt has left #ocaml [#ocaml]
FreeBirdLjj has quit [Remote host closed the connection]
andreypopp has quit [Read error: Connection reset by peer]
andreypopp has joined #ocaml
Haudegen has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
vanilla_ is now known as smerdyakow
lopex has quit [Ping timeout: 264 seconds]
lopex has joined #ocaml
^elyse^ has joined #ocaml
IP92 has quit [Ping timeout: 260 seconds]
oldmanistan_ has quit [Ping timeout: 264 seconds]
oldmanistan_ has joined #ocaml
lobo has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
<gasche>
def`: "a structure has a canonical signature", I think you have some progress margin left regarding pedagogy
smerdyakow has quit [Ping timeout: 245 seconds]
Algebr` has joined #ocaml
larhat1 has joined #ocaml
m_ has joined #ocaml
^elyse^ has quit [Quit: Leaving]
BitPuffin|osx has joined #ocaml
mac10688 has joined #ocaml
<m_>
Hi, in an OCaml file, how I can use a module in a different folder? I have a makefile using "ocamlfind ocamlopt ..." to build the target
supercircle4 has quit [Quit: Sleep]
Algebr` has quit [Remote host closed the connection]
supercircle4 has joined #ocaml
<Maelan>
m_, folders are not visible in the OCaml language
<Maelan>
all you have is a set of modules (possibly with submodules)
agumonkey has quit [Ping timeout: 245 seconds]
<Maelan>
so if you have a module B/ModB.ml that uses the module A/ModA.ml
<ggole>
m_: you can tell ocamlopt to search in directories with -I
<Maelan>
then in B/ModB.ml you simply do things like « ModB.function_from_ModB » or « open ModB »
<Maelan>
oops
<ggole>
Although usually you would use a build system
agumonkey has joined #ocaml
<Maelan>
then in B/ModB.ml you simply do things like « ModA.function_from_ModA » or « open ModA »
<m_>
How I can d that? To clarify it, I have my main file in src folder, and module file in x folder.
<m_>
Ah, thanks ggole, let me see if that works
<Maelan>
and for compiling, you compile A/ModA.ml with something like « ocamlfind ocamlc -c B/ModB.ml -o B/ModB.cmo »
<Maelan>
then you link then with « ocamlfind ocamlc A/ModA.cmo B/ModB.cmo -o prgm.exe »
<m_>
Thanks
smerdyakow has joined #ocaml
<mahem1_>
Maelan: Hmmm, so if I wanted to emulate directory structures: A.ModA.my_func
<Maelan>
(not sure about the exact commands, i remember standard ocaml tools being troublesome about files not in the current directory :/)
<mahem1_>
Then I could have the directory structure: A/modA.ml and A/a.ml
oldmanistan_ has quit [Ping timeout: 264 seconds]
<Maelan>
mahem1_, yes, you would have to explicitly create a module A that contains the module ModA
oldmanistan_ has joined #ocaml
<mahem1_>
Where a.ml is just a dummy file: module ModA = ModA;;
<Maelan>
the problem is module ModA still being globally visible, in addition to being available through module A
<mahem1_>
True. But that isn't too too bad, is it?
Kakadu has quit [Ping timeout: 246 seconds]
<Maelan>
a better setting would probably be putting the dummy “directory” module at the same level as the directory, instead of in it
IP92 has joined #ocaml
darkf has quit [Quit: Leaving]
<IP92>
what's the |> operator?
<mahem1_>
Maelan: that would make sense. But A/modA.ml would still be global?
<Maelan>
mahem1_, the point of directories/submodules is to organize your modules neatly, so making ModA directly available without going through A would break that purpose
<Maelan>
and if you have say A/Mod.ml and B/Mod.ml, and both directories A and B are in the search path
<Maelan>
you will have trouble
<Maelan>
mahem1_, depends of which directories you put in your search path for compiling/linking
<Maelan>
with the structure you suggested, you would have to add every directory (directory A/ to access A/A.cmo), so everything would be visible and it would break the abstraction
mort___ has joined #ocaml
<mahem1_>
Makes sense, so if you put a.ml in the "root" directory, how would one properly compile? (So that just a.ml is visible)
<Maelan>
by putting A.cmo in the root/parent directory, you only have to add that parent directory in the search path
^elyse^ has joined #ocaml
<mahem1_>
Makes sense, thanks for the explanation.
<IP92>
says, "this is not a function, cannot be applied"
<Maelan>
IP92, your code?
<IP92>
let map = IntMap.(empty |> add 0 0 |> 1 1)
<ggole>
You probably want add 1 1 there
zpe has joined #ocaml
<IP92>
..., such rookie mistake, sorry for bothering
<ggole>
No worries.
smerdyakow has quit [Ping timeout: 260 seconds]
yomimono has joined #ocaml
Kakadu has joined #ocaml
profan has joined #ocaml
zpe has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
<IP92>
if I define a module, can I not have one "#open MyModule;;" after the definition to use it?
<Maelan>
no #
mort___ has joined #ocaml
yomimono has quit [Quit: Leaving]
demonimin has joined #ocaml
<def`>
gasche: :D "PAN!"
demonimin has quit [Remote host closed the connection]
<Maelan>
ggole, is there a build system (ocamlbuild / oasis) that can automate this emulation of the directory structure?
<ggole>
I don't think so, they just build the source. Pretty much what you'd do by hand.
smerdyakow has joined #ocaml
Algebr` has joined #ocaml
<Maelan>
i saw there was something called “packed modules”, that looks like intended for this…
demonimin has joined #ocaml
jonh has quit [Ping timeout: 264 seconds]
jonh has joined #ocaml
demonimin has quit [Ping timeout: 245 seconds]
supercircle4 has quit [Quit: Sleep]
supercircle4 has joined #ocaml
<IP92>
I have this code http://pastebin.com/pNGu2eJg the last line "find n !map" should return an int and the function fib should return that function, but I receive that "this expression is of type int but unit was expected", why's that
<IP92>
fib should return that int*
<def`>
it is parsed as
<def`>
if not (mem n !map) then (...; find n !map)