<isd>
shoved into one paste for convienince. the "line 4" in the error message is line 22 in the paste
<isd>
Shouldn't the subexpression mentioned have type Data.t Stream.t?
jao has quit [Ping timeout: 264 seconds]
<isd>
tried putting parens around it, just in case it was a precedence issue. same error.
ggole has joined #ocaml
arj has joined #ocaml
<flux>
the error sounds like you are not giving enough arguments to a function call
<isd>
It should just take the stream, no?
<flux>
so at the end of 'parse' you call parse_list stream, but then parse_list is parse_list lst = parser .. didn't 'parser' introduce an additional argument? I haven't used camlp4 parser for a long while
<isd>
good call, should be parse_list [] stream. let's see if that fixes it.
<isd>
Thanks. I should probably sleep more.
<flux>
you can get to sleep when you're retired - or dead - why waste time for it any sooner :)
<isd>
:P
<isd>
good point.
* isd
goes back to writing code
maattdd_ has joined #ocaml
tlockney is now known as tlockney_away
racycle has quit [Quit: ZZZzzz…]
isd has quit [Quit: Leaving.]
maattdd_ has quit [Ping timeout: 264 seconds]
johnf has quit [Read error: Connection reset by peer]
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
pyon has quit [Read error: Connection reset by peer]
divyanshu has quit [Quit: Computer has gone to sleep.]
ygrek has joined #ocaml
BitPuffin has quit [Ping timeout: 264 seconds]
philtor_ has joined #ocaml
manizzle has quit [Ping timeout: 244 seconds]
johnf has joined #ocaml
divyanshu has joined #ocaml
philtor_ has quit [Ping timeout: 272 seconds]
hhugo has joined #ocaml
johnf has quit [Ping timeout: 272 seconds]
Simn has joined #ocaml
lordkryss has joined #ocaml
penglingbo has quit [Ping timeout: 264 seconds]
rand000 has joined #ocaml
penglingbo has joined #ocaml
ustunozgur has joined #ocaml
Lutin` has quit [Ping timeout: 264 seconds]
BitPuffin has joined #ocaml
yacks has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
Kakadu has joined #ocaml
alpounet has joined #ocaml
eikke__ has joined #ocaml
ustunozg_ has joined #ocaml
ustunozgur has quit [Ping timeout: 240 seconds]
cago has joined #ocaml
hhugo has quit [Quit: Leaving.]
WraithM_ is now known as WraithM
hhugo has joined #ocaml
hhugo has quit [Client Quit]
AltGr has joined #ocaml
bartbes has quit [Quit: No Ping reply in 180 seconds.]
bartbes has joined #ocaml
ustunozg_ has quit [Remote host closed the connection]
ollehar has joined #ocaml
sagotch has joined #ocaml
lordkryss_ has joined #ocaml
ustunozgur has joined #ocaml
thomasga has joined #ocaml
eikke__ has quit [Ping timeout: 252 seconds]
manizzle has joined #ocaml
ontologiae has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: Leaving.]
eikke__ has joined #ocaml
dsheets has joined #ocaml
thomasga has quit [Quit: Leaving.]
avsm has joined #ocaml
sagotch has quit [Remote host closed the connection]
thomasga has joined #ocaml
SethTisue has joined #ocaml
thomasga has quit [Quit: Leaving.]
ygrek has joined #ocaml
<rand000>
.. I'm wondering if there is a way to be practical (in a purely functional way) about returning incremental values from sub-functions to the caller of a mother-function.. The imperative concept I'm contemplating as plan B is callbacks
<rand000>
It seems like I'm needed to pass the incremental values from all the sub-functions "back in the stack" towards the caller when I'm trying a functional way..
<rand000>
.. which is very verbose
lordkryss_ has quit [Quit: Connection closed for inactivity]
yacks has quit [Remote host closed the connection]
<rand000>
Anyone that could give me a hint? I'm thinking monads maybe.. just not sure how
<rand000>
.. when the types of the sub-returned values are differing from the main returned value - then I guess I would still need to define a sum-type the encompasses them all
<def`>
I don't understand what you want. could you show some code?
SethTisue has quit [Quit: SethTisue]
sagotch has joined #ocaml
<rand000>
It might be a bit difficult to show from what I'm working with - could write an example or maybe explain more specifically?
<rand000>
.. what I wan't in essense is saving the incremental calculations of an algorithm to a database - plus the progress of the calculation and the final return-value in the end..
<def`>
If you can write a minimal example.
<def`>
There are monadic approaches to incremental computation.
<rand000>
I'll try (:
siddharthv has quit [Ping timeout: 260 seconds]
yacks has joined #ocaml
<orbitz>
Do you just need bind to update some state somewhere?
<rand000>
Yes I but I would like to do it in a fp way (;
<rand000>
.. skip down to the comment "(*Focus: ...*)" to see where the subvalues I wan't get's calculated - the problem is that I don't wan't the analysis-module (the analysis is just a function in the example) to depend on the interface of the database...
<rand000>
Another way I just thought of - maybe it would be practical to write my own database wrapper and just use first class modules ...?
<rand000>
or just a statically defined functor
<BitPuffin>
the function keyword always acts as it's taking one parameter right?
<rand000>
yes
<BitPuffin>
okay
<BitPuffin>
thought so
<BitPuffin>
wouldn't make sense otherwise
<rand000>
(:
Thooms has joined #ocaml
<rand000>
If writing a wrapper for the database as a functor - it would be a callback of course.. which I would like to avoid - just seems like the most practical way
ustunozg_ has joined #ocaml
ustunozgur has quit [Ping timeout: 240 seconds]
* BitPuffin
wonders if Core.Async is using anything platform specific
ustunozg_ has quit [Remote host closed the connection]
ustunozgur has joined #ocaml
ustunozgur has quit [Ping timeout: 245 seconds]
ustunozgur has joined #ocaml
maufred has quit [Ping timeout: 245 seconds]
Thooms has quit [Read error: No route to host]
penglingbo has quit [Ping timeout: 264 seconds]
Hannibal_Smith has joined #ocaml
maufred has joined #ocaml
Thooms has joined #ocaml
<BitPuffin>
Is it possible to raise an exception with a polymorphic variant? Rather than declaring it just go `My_Exception or something
<Drup>
no
<BitPuffin>
alright
<Drup>
you can, however, just use Failwith
<Drup>
failwith*
<BitPuffin>
Yeah
<BitPuffin>
failwith always raises the same type though
<BitPuffin>
But yeah I remember reading some code which was dealing with exceptions and there was something like `This in the code and by the time I didn't know what it meant
<BitPuffin>
so I was wondering if it was perhaps that
<BitPuffin>
it was probably something like | `Something -> raise Bla or something then
shallower has joined #ocaml
<shallower>
howdy, can you recommend me some code colorizer (for ocaml ofc) for linux, please? I'd like to print some code.
<whitequark>
pygments
<adrien>
vim's tohtml :)
zebr has quit [*.net *.split]
studybot_ has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
sagotch_ has joined #ocaml
sagotch has quit [Ping timeout: 240 seconds]
<BitPuffin>
shallower: write your own hehe
<shallower>
thanks :)
<shallower>
trying pygments
yacks has quit [Ping timeout: 264 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
<BitPuffin>
is there an immutable array type?
shinnya has joined #ocaml
agarwal1975 has joined #ocaml
<BitPuffin>
that has the same memory niceness
<ggole>
No.
<BitPuffin>
hrm
<BitPuffin>
ar arrays resizable?
<ggole>
You can write a wrapper module, I suppose.
<ggole>
But that (absent certain hacks) loses the nice a.(i) sugar.
<ggole>
No.
<BitPuffin>
good
<ggole>
If you want extensible arrays, there are various libraries which provide that.
<BitPuffin>
with sugar included?
<BitPuffin>
or oh
<BitPuffin>
you mean extensible as resizable
<ggole>
Yeah
<BitPuffin>
alright
<ggole>
DynArray.push da elt, that kinda thing
<BitPuffin>
cool
<BitPuffin>
ggole: do you know if there are any plans to support making an array immutable? seems like having a mutable-by-default type is not very ocamly
<ggole>
Well, many of the stdlib's data structures are mutable.
<BitPuffin>
sure, but I meant for built in types
<BitPuffin>
I know there is mutable stuff in Core at least and other libs of course
<BitPuffin>
but I thought they were built upon explicitly making things mutable
<ggole>
Strings and arrays are both mutable (strings are becoming immutable soon though, which is pleasant).
<BitPuffin>
good
<BitPuffin>
hopefully the same thing happens for arrays imo haha
<ggole>
I don't know of any such plans for arrays though
<ggole>
We'll see.
<BitPuffin>
I mean I want to be able to make a mutable array of course
<def`>
immutable array are much less useful
<BitPuffin>
def`: not necessarily
<BitPuffin>
for my use case they make perfect sense
<BitPuffin>
(vectors and matrices)
<def`>
then just create an abstract type preventing mutations
<BitPuffin>
sure, but you lose the indexing sugar :P
<def`>
to quote you, "not necessarily" :P
<BitPuffin>
oh you don't?
<BitPuffin>
Is it possible to implement the indexing sugar by hand by any chance?
<def`>
it's a hack in the parser, but yes, you can somehow override the indexing operators
<BitPuffin>
hmm
<BitPuffin>
interesting
<def`>
(i've seen a patch recently implementing a much cleaner sugar, but for ocaml >= 4.02)
avsm has quit [Quit: Leaving.]
<Drup>
ocaml > 4.02 even, I think :/
<def`>
hmm, you're probably right. :/
<whitequark>
no, >= 4.02
<whitequark>
you can do -ppx that replaces .[] in 4.02 too
<Drup>
whitequark: you still have to exploit the parser hack for the ppx solution
ustunozg_ has joined #ocaml
ustunozgur has quit [Ping timeout: 245 seconds]
<whitequark>
oh, I see
seanmcl has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
ustunozg_ has quit [Remote host closed the connection]
cow-orke1 is now known as cow-orker
ontologiae has joined #ocaml
ustunozg_ has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
WraithM has quit [Remote host closed the connection]
penglingbo has joined #ocaml
avsm has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tnguyen1 has joined #ocaml
ustunozg_ has quit [Remote host closed the connection]
SethTisue has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
pyon has joined #ocaml
pyon has quit [Remote host closed the connection]
cdidd_ has joined #ocaml
maattdd_ has quit [Ping timeout: 244 seconds]
cdidd has quit [Ping timeout: 276 seconds]
pyon has joined #ocaml
sagotch_ has quit [Ping timeout: 240 seconds]
studybot_ has joined #ocaml
sagotch has joined #ocaml
sagotch has quit [Remote host closed the connection]
arj has quit [Quit: Leaving.]
divyanshu has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
ustunozg_ has joined #ocaml
manizzle has quit [Ping timeout: 272 seconds]
sagotch has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
Tamae has joined #ocaml
cago has left #ocaml [#ocaml]
tirom13 has joined #ocaml
maattdd_ has joined #ocaml
siddharthv has joined #ocaml
lordkryss has quit [Ping timeout: 252 seconds]
philtor_ has joined #ocaml
tlockney_away is now known as tlockney
* ggole
<3s printf
<companion_cube>
:)
<ggole>
printf "!\n" punches far above its weight
ontologiae has quit [Ping timeout: 245 seconds]
<dsheets>
"\n%!"?
ygrek has quit [Quit: ygrek]
lordkryss has joined #ocaml
mcclurmc has joined #ocaml
lordkryss has quit [Ping timeout: 252 seconds]
yacks has joined #ocaml
philtor_ has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
slash^ has joined #ocaml
Arsenik has joined #ocaml
lordkryss has joined #ocaml
avsm1 has quit [Read error: Connection reset by peer]
racycle has joined #ocaml
ustunozgur has joined #ocaml
ontologiae has quit [Ping timeout: 272 seconds]
ustunozg_ has quit [Ping timeout: 240 seconds]
ustunozgur has quit [Remote host closed the connection]
Moataz-E has joined #ocaml
avsm has joined #ocaml
sagotch has quit [Remote host closed the connection]
avsm has quit [Client Quit]
boogie has joined #ocaml
Moataz-E has quit [Ping timeout: 240 seconds]
Thooms has joined #ocaml
shinnya has quit [Ping timeout: 272 seconds]
tirom13 has quit [Quit: leaving]
rgrinberg has joined #ocaml
jwatzman|work has joined #ocaml
Moataz-E has joined #ocaml
avsm has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
avsm has quit [Client Quit]
Moataz-E has quit [Quit: Leaving]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
avsm has joined #ocaml
AltGr has left #ocaml [#ocaml]
avsm has quit [Client Quit]
q66 has joined #ocaml
avsm has joined #ocaml
seanmcl has quit [Ping timeout: 264 seconds]
penglingbo has quit [Ping timeout: 264 seconds]
maattdd_ has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
ustunozg_ has joined #ocaml
lordkryss has quit [Ping timeout: 252 seconds]
tane has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
jabesed has joined #ocaml
dsheets has joined #ocaml
nicoo_ has joined #ocaml
tnguyen1 has quit [Quit: tnguyen1]
<_habnabit>
is there a 'best' async IO library for ocaml? i'm slowly looking over the google results for 'ocaml network programming'
<adrien>
lwt/async in the same style
<adrien>
ocamlnet has its own
<adrien>
and tons of network related stuff
<_habnabit>
hmm, okay
nicoo has quit [*.net *.split]
<Drup>
ocamlnet's concurency style is a bit .. let's say personnal.
Lutin` has joined #ocaml
<_habnabit>
man, it's been a long time since i did any ocaml work
<_habnabit>
gotta get tuareg-mode set up again
<_habnabit>
unless there's something better now?
<companion_cube>
merlin
<Drup>
merlin adds to tuareg, doesn't replace it.
_obad_ has joined #ocaml
<ggole>
There's typerex, dunno if you'd find that better
<_habnabit>
oh, opam is new
<Drup>
don't use typerex, there is no point.
tlockney is now known as tlockney_away
<Drup>
ocp-index, maybe, but typerex, no.
<dsheets>
i think typerex is deprecated anyway
<Drup>
yes
<ggole>
Hmm, lotta work to just throw away
agarwal1975 has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Quit: Leaving.]
<_habnabit>
hm, how does ocamlnet even work? i don't see e.g. promises or deferreds
<Drup>
_habnabit: it does work
<companion_cube>
there is a low level layer that use those, I think (Equeue or something like this)
<_habnabit>
Http_client.Convenience.http_get is just string -> string
<Drup>
I told you, the concurency style is very personal :p
<adrien>
_habnabit: "convenience"
<Drup>
_habnabit: I would advise you to use cohttp and Lwt/Async
<adrien>
(ocamlnet really is fine)
<adrien>
(and there's more in life than http :D )
<_habnabit>
haha
<Drup>
not anymore, you can do everything over http nowadays =°
Simn has quit [*.net *.split]
freling has quit [*.net *.split]
keen________ has quit [*.net *.split]
fraggle_ has quit [*.net *.split]
<_habnabit>
oh, Lwt isn't pthreads. okay.
keen________ has joined #ocaml
Simn has joined #ocaml
freling has joined #ocaml
<_habnabit>
in fact, Ltw threads look like they're really just promises
<Drup>
yes
fraggle_ has joined #ocaml
<_habnabit>
interesting
tlockney_away is now known as tlockney
slash^ has quit [Read error: Connection reset by peer]
<companion_cube>
that's exactly what they are
agarwal1975 has joined #ocaml
rgrinberg has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
<dsheets>
except they're parametric whereas js promises are non-parametric
jao has quit [Ping timeout: 240 seconds]
dsheets has quit [Ping timeout: 252 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
ustunozgur has joined #ocaml
tnguyen1 has joined #ocaml
ustunozg_ has quit [Ping timeout: 252 seconds]
philtor_ has joined #ocaml
<rgrinberg>
ggole: add ocp-build to that dustbin
agarwal1975 has quit [Ping timeout: 264 seconds]
agarwal1975 has joined #ocaml
<ggole>
Never used that.
<rgrinberg>
ggole: good. you haven't missed out on anything
<Drup>
rgrinberg: there is only (and only one) argument for ocp-build : it's indeed fast
<Drup>
there is one*
tlockney is now known as tlockney_away
Simn has quit [Ping timeout: 260 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
<ggole>
What does it do differently to ocamlbuild? Look at timestamps?
<smondet>
ggole: i think not having a plugin system + resolving dependencies earlier to get more //ism + using ocamlfind once and then calling ocaml{c,opt} directly
ustunozgur has quit [Remote host closed the connection]
<rgrinberg>
Drup: Yeah i think Fabrice revealed the trick why it's fast
<rgrinberg>
something to do with camlp4 caching
racycle has quit [Quit: ZZZzzz…]
<rgrinberg>
at this point anyone can implement that and move on
thomasga has joined #ocaml
shinnya has joined #ocaml
<Drup>
rgrinberg: no, that's meaningless
<def`>
Drup: ?
<Drup>
it's fast because it parallelize properly and there is no overhead
<def`>
Also because it caches camlp4
<def`>
Jenga is really fast thanks to the same trick
<Drup>
yeah but it's also faster on no-camlp4 sources
<rgrinberg>
Drup: if I don't use camlp4 even ocamlbuild is fast enough
<def`>
Sure, ocamlbuild almost never parallelize
<Drup>
rgrinberg: buh, it depends :x
<adrien>
ocamlbuild -funrool-loops fast.native
thomasga has quit [Quit: Leaving.]
jwatzman|work has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
axiles has quit [Remote host closed the connection]
thomasga has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
ustunozgur has joined #ocaml
ustunozgur has quit [Ping timeout: 252 seconds]
hhugo has joined #ocaml
jwatzman|wor has joined #ocaml
jwatzman|work has quit [Disconnected by services]
jwatzman|wor is now known as jwatzman|work
jwatzman|work has quit [Changing host]
jwatzman|work has joined #ocaml
Submarine has quit [Quit: Leaving]
nicoo_ is now known as nicoo
thomasga has quit [Quit: Leaving.]
tlockney_away is now known as tlockney
jwatzman|work has quit [Quit: jwatzman|work]
lordkryss has joined #ocaml
Thooms has joined #ocaml
rand000 has quit [Quit: leaving]
tane has quit [Quit: Verlassend]
thomasga has joined #ocaml
hhugo has quit [Quit: Leaving.]
<_habnabit>
i keep getting "buffer amp.ml has no process" when trying to run merlin-restart-process
<def`>
did you enable merlin-mode ?
<_habnabit>
yes
<_habnabit>
i get the same error when i toggle merlin-mode off and on again
ggole has quit []
<def`>
any other messages in *Messages* buffer?
<_habnabit>
no, just that
<_habnabit>
merlin-send-command-async: Buffer amp.ml has no process
<Drup>
_habnabit: was merlin accessible in the shell you launched emacs from ?
<def`>
(or use M-x shell-command which ocamlmerlin)
<_habnabit>
Drup, if i do M-!, i can execute 'ocamlmerlin'
<_habnabit>
Drup, i had to customize exec-path and setenv PATH
philtor_ has quit [Ping timeout: 245 seconds]
<def`>
so you had an error about missing binary?
<_habnabit>
i did, but i changed exec-path and PATH to include ~/.opam/system/bin
<def`>
can you try restarting emacs? I wonder if it just give up after first fail
<_habnabit>
i'll try
<_habnabit>
aha, that did it
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<Drup>
def`: on the subject, I ocasionnaly get this error when I open a buffer attached to a non existing file (typical example : I forget to create the parent directory)
<Drup>
and it doesn't recover, even after the file is created
<def`>
Drup: tell asmanur, I have no idea what is going on on emacs side
<Drup>
(even with merlin restart, and so on)
<Drup>
ping asmanur ? :D
dapz has joined #ocaml
thomasga has quit [Quit: Leaving.]
ustunozgur has joined #ocaml
Arsenik has quit [Remote host closed the connection]
ustunozgur has quit [Ping timeout: 244 seconds]
alpounet has quit [Remote host closed the connection]
jao has quit [Ping timeout: 264 seconds]
jknick has quit [Quit: leaving]
Kakadu has quit [Quit: Konversation terminated!]
jwatzman|work has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
tobiasBora has joined #ocaml
eikke__ has quit [Ping timeout: 244 seconds]
penryu is now known as [UNIX]penryu
eikke__ has joined #ocaml
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Thooms has quit [Quit: WeeChat 0.3.8]
typedlambda has quit [Ping timeout: 252 seconds]
philtor_ has joined #ocaml
typedlambda has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
struktured has joined #ocaml
pyon has quit [Read error: Connection reset by peer]
[UNIX]penryu is now known as penryu
hhugo has joined #ocaml
hhugo has quit [Quit: Leaving.]
dapz has joined #ocaml
tnguyen1 has quit [Quit: tnguyen1]
agarwal1975 has joined #ocaml
pyon has joined #ocaml
<emias>
[A[A
jabesed has quit [Quit: Konversation terminated!]
rgrinberg has joined #ocaml
racycle has joined #ocaml
darkf has joined #ocaml
philtor_ has quit [Ping timeout: 255 seconds]
martinsk has joined #ocaml
maattdd_ has joined #ocaml
<martinsk>
Hello all you people who have seen the light before me :)
<martinsk>
I was walking through http://www.matt-mcdonnell.com/code/code_ocaml/lexing/lexing.html and I'm having some trouble making the first example into a full fletched parser.. I think its might be an issue of making the main function correct - any pointers.