yegods_ has quit [Read error: Connection reset by peer]
MercurialAlchemi has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
yegods has joined #ocaml
unbalancedparen has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 276 seconds]
sh0t has quit [Remote host closed the connection]
Algebr` has joined #ocaml
sh0t has joined #ocaml
tautologico has quit [Ping timeout: 240 seconds]
silver has quit [Quit: rakede]
pyon has quit [Ping timeout: 258 seconds]
tautologico has joined #ocaml
struk|desk has quit [Remote host closed the connection]
pyon has joined #ocaml
struk|desk has joined #ocaml
rfk has joined #ocaml
sh0t has quit [Ping timeout: 258 seconds]
yegods has quit [Read error: Connection reset by peer]
tmtwd has quit [Ping timeout: 276 seconds]
chinglish has quit [Ping timeout: 244 seconds]
tautologico has quit [Ping timeout: 240 seconds]
yegods has joined #ocaml
LACampbell has joined #ocaml
tautologico has joined #ocaml
chinglish has joined #ocaml
dmj` has joined #ocaml
chinglish has quit [Ping timeout: 264 seconds]
dmj` has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
chinglish has joined #ocaml
mattrepl has quit [Quit: mattrepl]
tautologico has quit [Ping timeout: 276 seconds]
kdas__ has joined #ocaml
yegods has quit [Remote host closed the connection]
kdas__ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
LACampbell has left #ocaml ["WeeChat 1.4"]
darkf has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
sh0t has joined #ocaml
tristero has quit [Quit: tristero]
MercurialAlchemi has joined #ocaml
zaquest has quit [Ping timeout: 260 seconds]
zaquest has joined #ocaml
tautologico has joined #ocaml
chinglish has quit [Ping timeout: 276 seconds]
fluter has quit [Ping timeout: 258 seconds]
sveit has joined #ocaml
sveit has left #ocaml [#ocaml]
sveit has joined #ocaml
sveit has left #ocaml [#ocaml]
sveit has joined #ocaml
chinglish has joined #ocaml
<sveit>
hi! is there a way to iterate over a list with short-circuiting? for example, i want to check if every list element satisfies a predicate "p". I could write a function taking a predicate and a list "let all p xs = List.fold_left (fun a x -> a && p x) true xs" but this will waste time if I get a "false" early on
<sveit>
is throwing an exception the correct/performant way? i am reluctant to use this method because it does not seem "functional"
LACampbell1 has joined #ocaml
seangrove has joined #ocaml
<Algebr`>
yes, raise exception
<seangrove>
Is there a CAS datastructure in ocaml?
<Algebr`>
can even make a local module definition so that you can make an exception that is only know about in the function call
<seangrove>
I want a ref, but only with CAS semantics, and that when swapped, I can have an observer callback
<sveit>
Algebr`: is creating a local module/exception like that "free"? i mean negligible cost, apart from allocating it in the first place
<sveit>
sorry, as in allocating the exception
<sveit>
when called, not when created
<seangrove>
Damn I miss Clojure's datastructures
<Algebr`>
sveit: I understand exceptions to be pretty performant but I don't know hard numbers
LACampbell1 is now known as LACampbell
<Algebr`>
I think allocation should be low, since exception constructor doesn't take args so its probably not a block thing
<Algebr`>
not sure
<sveit>
Algebr`: it's too bad there's no "global" or "accepted" pattern for such a thing, to make things generically short-circuit. thanks!
<sveit>
to clarify, i of course mean without exceptions
<LACampbell>
Is it possible to "yield" two values in a stream? I am reading chars from stdin, and when I come across something like "hello(", I want to return Some "hello" and Some "("
<Algebr`>
its pretty accepted to raise an exception to end a loop early
<Algebr`>
ah
sh0t has quit [Ping timeout: 244 seconds]
<jun>
sveit: there are List.for_all, List.exists, etc which do short-circuiting
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<seangrove>
Algebr`: Think I'm missing a bit from the types in the react bindings
<seangrove>
How can I get a ref to the initial render call? I want to use that to render from the root again
<sveit>
jun: thanks! looks like those are implemented using explicit recursion and rely on short-circuiting of "&&", so they're kind of a special case in that regard
<sveit>
although they obviously work for the example I hgave
sh0t has joined #ocaml
<jun>
yeah the implementation (which is kind of generic) in Sequence use exception actually
tautologico has quit [Ping timeout: 240 seconds]
copy` has quit [Quit: Connection closed for inactivity]
<Algebr`>
seangrove: you want the component returned by render?
<seangrove>
Algebr`: Maybe, reading into this a bit more, we'll see
ggole has joined #ocaml
<sveit>
jun: Can you link to that?
rgrinberg has quit [Ping timeout: 252 seconds]
<Algebr`>
seangrove: maybe do a update; upgrade from source? I've added a bit, added doc strings that ought to come up in merlin and started a helper module Common_components
<seangrove>
Algebr`: Lots of potential. OCaml syntax and lack of vargars makes it a bit sad in some places, but there'll be time to figure out what it should look like later
<seangrove>
Also a lack of lenses is tough
<Algebr`>
what lack of lenses, what the issue there? Could always do {some_record with some_field = "other"}
<Algebr`>
varargs taken care of by lists...
<ggole>
You can do varargs reasonably well with either lists or a continuation hack
<seangrove>
Algebr`: I'll have to explain it in person, but effectively I want Om-like cursor datastructures right now, where every time I render a component and update a node in a nested datastructure, the path to the point is automatically kept
<seangrove>
Right now every component has to be aware of where it is in the overall app state. Bad mojo.
chinglish has quit [Read error: Connection reset by peer]
<seangrove>
Cool, got basic editing working. Need to figure out how to re-render without blowing out the prexisting DOM elements (input is being destroyed/focus lost on every render), basic React stuff
<seangrove>
Then a tiny reworking of the app state and should be good for an example
<Algebr``>
this is really great
<Algebr``>
I'm also getting a feel for the library and adding higher level things and such
<seangrove>
Nice!
<seangrove>
There are still some holes though, easy to get a runtime error because I got a Js.t string instead of a string
<seangrove>
Anyway, talk later, g'night! Looking forward to fleshing this all out
<Algebr``>
+!
<Algebr``>
+1
AltGr has joined #ocaml
chinglish has quit [Ping timeout: 250 seconds]
regnat has quit [Quit: WeeChat 1.5]
regnat has joined #ocaml
octachron has quit [Quit: Leaving]
beginner has joined #ocaml
<beginner>
Is there a reason why ocaml should recompile the standard library? I get a unbound module Pervasives error, because it tries to recompile pervasives
dhil has joined #ocaml
octachron has joined #ocaml
<octachron>
beginner, without context it is hard to tell. It is normal to recompile the stdlib when building the compiler for instance
<beginner>
ocatchron: no i am trying to compile my own source files
<octachron>
do you have a source file named "pervasives.ml" ?
cyraxjoe has quit [Ping timeout: 250 seconds]
<beginner>
octachron: just the one from the standard lib in /lib
cyraxjoe has joined #ocaml
<octachron>
I see no reason why your build system would try to recompile the stdlib when trying to build your own source files
<beginner>
octachron: me neither, but thanks for that confirmation. If i have set OCAMLLIB the files in this folder should not be recompiled if the appropriate cmi etc files are there?
chinglish has joined #ocaml
<octachron>
beginner, I do not have enough context to answer your question (and I have to go).
octachron has quit [Quit: Leaving]
freehck has joined #ocaml
Algebr`` has quit [Ping timeout: 244 seconds]
yegods has joined #ocaml
ggole_ has joined #ocaml
jwatzman|work has joined #ocaml
fluter has quit [Ping timeout: 264 seconds]
ggole__ has quit [Ping timeout: 244 seconds]
tautologico has joined #ocaml
chindy has quit [Ping timeout: 276 seconds]
nicholasf has quit [Remote host closed the connection]
fluter has joined #ocaml
_gt has joined #ocaml
cross has quit [Quit: Lost terminal]
fluter has quit [Ping timeout: 258 seconds]
yegods has quit [Ping timeout: 244 seconds]
nicholasf has joined #ocaml
<_gt>
hi
<_gt>
I'm trying communicate with another process from OCaml
<_gt>
like this
<_gt>
open Core.Std
<_gt>
let () = printf "start\n"; let cat_in, cat_out = Unix.open_process "/bin/cat" in output_string cat_out "hi?"; flush cat_out; printf "Result: %s\n" (input_line cat_in); Unix.close_process (cat_in, cat_out); printf "end\n";
<_gt>
but programm just hang out and wait
<asmanur>
you need to output a newline -- cat's input is line-buffered
<asmanur>
output_string cat_out "hi?\n"
<_gt>
ok, I'l try right now
<_gt>
it works
<_gt>
thanks!
yegods has joined #ocaml
fluter has joined #ocaml
yomimono has joined #ocaml
tautologico has quit [Ping timeout: 244 seconds]
kushal has joined #ocaml
sfri has quit [Remote host closed the connection]
lopex has joined #ocaml
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 276 seconds]
sfri has joined #ocaml
yegods has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 244 seconds]
yegods has joined #ocaml
larhat has joined #ocaml
_andre has joined #ocaml
sdothum has joined #ocaml
kushal has quit [Ping timeout: 276 seconds]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
dexterph has joined #ocaml
silver has joined #ocaml
octachron has joined #ocaml
kushal has joined #ocaml
wtetzner has joined #ocaml
fluter has quit [Ping timeout: 250 seconds]
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
<beginner>
are there recommendations for good functional programming languages, that go more into type theory depth?
fluter has joined #ocaml
<Drup>
define "type theory depth" :)
<beginner>
Drup: thats not that easy ;) i like the real world ocaml book, but something more in depth about type theory
dhil has quit [Ping timeout: 265 seconds]
<Drup>
So you want a book, not a PL. TAPL then :)
<beginner>
Drup: i will give it a try, thanks
jackweirdy has joined #ocaml
<Drup>
(TAPL is from the point of view of implementing type checkers)
dhil has joined #ocaml
<Drup>
(well, designing type systems, at least)
<beginner>
Drup: gadts and such as well?
<Drup>
What do you want to learn exactly ? type theory or just using sophisticated corners of the type system ?
<beginner>
Drup: More about those sophisticated corners
<Drup>
right
<Drup>
the ocaml manual itself is not too bad for gadts
copy` has joined #ocaml
wtetzner has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 258 seconds]
cross has joined #ocaml
kushal has quit [Ping timeout: 250 seconds]
larhat has quit [Ping timeout: 244 seconds]
larhat has joined #ocaml
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
fluter has joined #ocaml
<Leonidas>
I would expect that Idris is a good functional programming language that goes more into type theory depth.
yegods has quit [Ping timeout: 240 seconds]
jackweirdy has joined #ocaml
yegods has joined #ocaml
fedjo has quit [Remote host closed the connection]
nicholasf has quit [Remote host closed the connection]
<gasche>
the problem with going in "the advanced corners" first is that you may lack the vocabulary and notations to understand much of the theoretical treatment of them
yegods has quit [Read error: Connection reset by peer]
<gasche>
you need to understand the bases of how to use type theory to describe simpler language features first
yegods has joined #ocaml
dave24 has joined #ocaml
<beginner>
gasche: thanks
tane has joined #ocaml
tautologico has quit [Ping timeout: 258 seconds]
kdas__ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
nicholasf has quit [Remote host closed the connection]
Mercuria1Alchemi has quit [Ping timeout: 244 seconds]
pyon has joined #ocaml
dwillems has joined #ocaml
tautologico has quit [Ping timeout: 252 seconds]
chinglish has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
tautologico has joined #ocaml
yegods has joined #ocaml
nicholasf has joined #ocaml
Algebr`` has joined #ocaml
nicholasf has quit [Ping timeout: 244 seconds]
manizzle has quit [Quit: Leaving]
kushal has quit [Ping timeout: 276 seconds]
_gt has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
tautologico has quit [Ping timeout: 250 seconds]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
larhat has quit [Quit: Leaving.]
brub has joined #ocaml
yegods has joined #ocaml
yegods has quit [Client Quit]
tristero has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
sh0t has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
sdothum has joined #ocaml
tautologico has joined #ocaml
tane has quit [Quit: Verlassend]
dhil has quit [Ping timeout: 240 seconds]
<companion_cube>
seliopou: don't try to argue with dbuenzli, it's a waste of time
slash^ has joined #ocaml
<adrien>
hahaha
tautologico has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
dhil has joined #ocaml
dwillems has quit [Ping timeout: 260 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
larhat has joined #ocaml
<Bluddy[m]>
Compiler question: I'm trying to add a command line argument to the compiler, but I mysteriously don't have it set where it should be. On ocamlopt, adding printouts, I see my code being called before printouts from main() in optmain.ml. Anyone have any idea?
zaquest has quit [Read error: Connection reset by peer]
<Drup>
adding compiler args to the ocamlc/opt is a mess, please show your patch
<Bluddy[m]>
Just byterun/ocamlrun ./ocamlopt -safe-syntax test.ml
<Bluddy[m]>
where -safe-syntax is the new argument
<Bluddy[m]>
But in the debug printouts, what I see is "unsafe" (from parse.ml) being printed many times before I even get to here0/1/2/3 (all in optmain.ml)
<Bluddy[m]>
which could explain why the flag is never observed for some reason
<Drup>
ah
<Drup>
the problem is in the implementation of wrap
<Bluddy[m]>
oh yeah awesome thanks
<Bluddy[m]>
Part of the reason that I tend to avoid globals myself :)
<Drup>
(fwiw, I think you have too much duplication in your patch)
<Bluddy[m]>
I don't disagree
<Bluddy[m]>
I'm trying to get it to work first.
<Algebr``>
opam repo taking a long time to update
octachron has quit [Quit: Page closed]
<Bluddy[m]>
Drup: no simple way to avoid duplication on the lexer/parser unfortunately. Doesn't seem like there's an include command, and I'd have to add new rules that check a global, which could get very ugly.
<Bluddy[m]>
parse.ml can be improved substantially. I just spent time untangling it, and once it works, will work on improving it.