<struktured>
sdegutis: in all seriousness, for me it's maintaining two separate files per module that gets on my nerves. not a huge deal though. the 2nd thing is I really wish vim used syntax highlighting in omnicompletion window, but that's not ocaml's fault :)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sdegutis>
ah
yaewa has quit [Read error: Connection reset by peer]
<sdegutis>
struktured: hey dont i remember you from #ruby or something?
<sdegutis>
years ago?
<sdegutis>
or #python
<struktured>
sdegutis: maybe?? I dabbled but never wrote any serious stuff in ruby. same with python but I used python more recently (then switched to ocaml)
<sdegutis>
ok
<struktured>
sdegutis: u thinking of #qt maybe? lurk there a bit
<sdegutis>
maybe
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
<sdegutis>
RWO is not a skimmable book :'(
moei has quit [Read error: Connection reset by peer]
<sdegutis>
How do you know when to make a new type or a new module containing a type 't'?
<sdegutis>
RWO is a frustrating book.
moei has joined #ocaml
<struktured>
sdegutis: it's not necessary to learn ocaml at all.
<sdegutis>
struktured: uhh
<Drup>
potential usage in a functor, I guess ?
<struktured>
sdegutis: the book I mean, there are other books and examples
arboris` has quit [Ping timeout: 265 seconds]
jabesed has quit [Ping timeout: 240 seconds]
<struktured>
sdegutis: if you want to associate operations with some type, its usually worth making a module and bundling all the operations together, much like you would a class
<sdegutis>
"OCaml from the Very Beginning will appeal both to new programmers, and experienced programmers eager to explore functional languages such as OCaml"
<sdegutis>
I'm neither.
<Drup>
this one is more geared toward beginners in programming in general, afaik
<sdegutis>
I'm not new at programming, and I have much experience with FP concepts.
<Drup>
but apparently, the issue was already filled.
araujo has joined #ocaml
araujo has joined #ocaml
dmbaturin has joined #ocaml
<Drup>
AltGr: is the feature field going to be in 1.2.1 ?
<AltGr>
ah yeah. No idea really. I should be getting a mac soon to be able to test and reproduce such issues. At the moment I only have a working system.
<AltGr>
(troll inside)
enitiz has quit [Ping timeout: 245 seconds]
<AltGr>
Drup: my idea was to put it there, but still flagged as experimental, because it feels a bit underspecified yet
<Drup>
yay !
<AltGr>
experimental, as in, not expected to appear in opam.ocaml.org's repo
<Drup>
:(
<Drup>
and the compiler-as-packages ?
<AltGr>
the basic features allowing it are there. But the repo probably won't be rewritten with ocaml packages right away
<Drup>
ok
<Drup>
mostly cute utf8 in 1.2.1 then :<
<Drup>
(which is obviously the most important feature)
<AltGr>
well the cute utf8 is the visible part of a rewritten command-running engine, which should allow better parallelism, error recovery and stability
<Drup>
AltGr: do you plan to rewrite the history to add {build} on ocamlfind everywhere ?
<Drup>
the repository*
<AltGr>
I did but there's the 'bytes' stuff in the way
<pippijn>
is there any situation where you don't want it to do that?
AlexRussia has quit [Ping timeout: 245 seconds]
yaewa has quit [Read error: Connection reset by peer]
moei has joined #ocaml
<AltGr>
hm, if you want a specific order and added a backwards dependency by mistake ? %)
<pippijn>
backwards dependency?
<pippijn>
you mean cyclic?
<pippijn>
if you want a specific order, I think you're doing something very wrong
<AltGr>
I was imagining three modules doing just side-effects that I want ordered A B C, without dependencies, then I add a dep C -> B
<pippijn>
but ok
<AltGr>
Quite unlikely, yes, but you said *any* situation :)
<pippijn>
in that case, you can still do it manually
<pippijn>
yeah
<pippijn>
I see
<pippijn>
but it could check whether the modules are topologically sorted, and leave the order alone in that case
<pippijn>
otherwise, toposort them
darkf has joined #ocaml
<pippijn>
I'm in the situation where I need to implement a topological sort again
<pippijn>
very annoying
<AltGr>
I know the feeling
<pippijn>
jane street solved it by reading .d files and writing a collection to another file, then reading that file and doing stuff... ew
<AltGr>
If there's anyone motivated to contribute to opam-user-setup for vim, that'd be gladly welcome. I've updated the README and am trying to switch from static to "as much dynamic as possible"
<AltGr>
for emacs I'm doing `opam list --installed --safe --short <packages>`, and configuring the returned packages
swgillespie has joined #ocaml
<struktured>
man I think I'm hitting GC performance degradation running an experiment in utop. any one know how to tune it for more memory using some sort of profile?
<struktured>
Drup: what do you mean by native here?
<Drup>
native as in "will load native code and compile the code to native"
<struktured>
oh I see. so when I do something like #require foobar the default is to use the non-native version?
<Drup>
iirc, yes
<struktured>
ok thanks for help will look into this further
AlexRussia has joined #ocaml
enitiz has joined #ocaml
mcc has joined #ocaml
<struktured>
hmm bumped it with OCAMLRUNPARAM but it still slows down after about 300 iterations. guess its debugging time
<sdegutis>
How do directories factor into OCaml projects?
<sdegutis>
Do intermediate directories become intermediate module names? Or are all files generally put in the top level? Or neither?
<struktured>
sdegutis: no hard rule. the convenition is that subfolders are container modules basically. also they are used to create multilibrary projects
<sdegutis>
does their presence effect module names?
<sdegutis>
like is foo/bar.ml now turned into Foo.Bar ?
<struktured>
sdegutis: depends how you compile it ultimatey, but in general yes
<sdegutis>
is there a build tool for ocaml (that doesnt depend on Core)?
<struktured>
several, all with limitations. oasis I personally recommend for some simple projects.
<sdegutis>
oasis it is then
<sdegutis>
my project is very simple: i just want to wrap a small C library
<pippijn>
sdegutis: OMake
<pippijn>
sdegutis: what build tool depends on Core?
<sdegutis>
pippijn: omake compared to oasis?
<pippijn>
oasis is not a build tool
<sdegutis>
i no longer trust struktured
<pippijn>
it's a project tool
<pippijn>
it generates some ocamlbuild input
<sdegutis>
i now trust struktured once again, and no longer trust pippijn
<pippijn>
okay
<sdegutis>
wait reverse that again
<sdegutis>
omake it is
<sdegutis>
this is really confusing
<sdegutis>
i just want to make an executable that compiles several .ml and .mli files and uses a C library
<sdegutis>
and probably has opam libs like ctypes
<pippijn>
omake is a very generic build tool that can be used to do everything you could ever want
<Drup>
pippijn: I must say, I don't even know how to build C libraries with ocamlbuild
<mcc>
Drup: When I put this next patch in-- do you have any objection to using my custom struct internally and then converting to Lexing.position on export?
<Drup>
while with oasis, it's trivial
<pippijn>
okay
<pippijn>
it's trivial with ocamlbuild, too, but not well described anywhere I know
<sdegutis>
should .ml files end in ;; ?
<pippijn>
sdegutis: okay, oasis has reasonable docs (for simple use cases), maybe it's better to start with oasis
<pippijn>
sdegutis: no
<sdegutis>
ok
<pippijn>
enter "oasis help" and read what that says
<Drup>
sdegutis: It shouldn't be completely broken, what's your file ?
<sdegutis>
Drup: let x = 3 ;;
q66 has quit [Quit: Leaving]
<Drup>
remove the ";;" :p
<sdegutis>
Drup: every line after this is 2-spaces indented
<Drup>
the complete file please.
<sdegutis>
Drup: with ;; removed, every line after this is like 8 spaces indented
<sdegutis>
Drup: $ cat hi.ml
<sdegutis>
let x = 3
<Drup>
what are you typing *after* then ?
<sdegutis>
enter
<sdegutis>
oh sorry, i mean the "return" key
<Drup>
then type something meaningful, a let for example ~~
<sdegutis>
the key above right-shift
<sdegutis>
oh, the new statement is indented right
<sdegutis>
only blank lines are super-far-indented
<Drup>
oh and
<Drup>
don't read this ocamlbuild tutorial
<Drup>
really, don't
<Drup>
it will only confuse you
<sdegutis>
ok
<sdegutis>
plz 2 give me 1
<Drup>
I linked one
<sdegutis>
you linked an oasis one no?
<Drup>
yes
<sdegutis>
wth i thought i was gonna use ocamlbuild
* sdegutis
sighs
<sdegutis>
can the CSources field take globs?
<sdegutis>
like *.c ?
<Drup>
I'm pretty sure that it doesn't.
<sdegutis>
wow
<sdegutis>
im not gonna manually list all my .c files
<sdegutis>
theres like 50 of them
<pippijn>
sorry, you have to
<sdegutis>
i refuse
<pippijn>
ls *.c >> _oasis
<pippijn>
or
<mcc>
write a perl script that generates a _oasis file which generates ocamlbuild…
<pippijn>
echo *.c >> _oasis
<sdegutis>
oh only 33 actually
<pippijn>
mcc: been there
<sdegutis>
echo *.c doesnt expand
<pippijn>
sdegutis: why not?
<sdegutis>
oh yeah ti does
<sdegutis>
i forgot the subdir
<pippijn>
*.c is done by your shell
<pippijn>
not by ls
<Drup>
wait, are you starting your ocaml exploration by writing a binding to a C library ? =__=
<pippijn>
some people like it rough
<sdegutis>
Drup: because my hello-world is writing a window manager
<sdegutis>
i know how to use this C lib better than i know any algorithm
<pippijn>
Drup: my hello-world was a C parser
<pippijn>
I for one fully endorse this window manager hello-world
<Drup>
it's not rough, it's meaningless, you will not see most of the high lever nice features of OCaml, only the sordid memory model
<Drup>
pippijn: writing a C parser or a window manager is fine, but doing the binding ? ew
Rebelion has quit [Quit: Saliendo]
<sdegutis>
Drup: i get to write a variant type to represent possible lua values, how much better can thou gettest for high level feature stuffeth?
<pippijn>
heh
<Drup>
oh, yet another lua person ! :D
<pippijn>
I see GADTs in your future
<sdegutis>
pippijn: whats gadt
<Drup>
quick, mcc !
shinnya has quit [Ping timeout: 272 seconds]
<sdegutis>
in my Swift version, i switched from an enum (like an ocaml variant type) to using a protocol (like an ocaml signature) to represent Lua.Value
<pippijn>
sdegutis: it's where your ADTs have different types depending on the variant selected
<sdegutis>
mainly because i wanted to support naturally supporting built-in literals
<sdegutis>
but i cant do that here, can i?
<Drup>
indeed
<sdegutis>
also, i loved trying to make an automatic type checker for swift-written functions that get put into lua
<sdegutis>
id love to try and do the same in ocaml
<Drup>
(lot's of lua people going around)
<pippijn>
sdegutis: you can do many really cool things with ocaml types
<sdegutis>
can i make the 'string' type conform to a signature of my own devising?
<pippijn>
example?
<sdegutis>
like: type t var some_function: t -> int
<sdegutis>
or maybe -> string, whatever, doesnt matter
<sdegutis>
can i "extend" the built-in string type so that some_function takes a pure string?
<Drup>
you still have a very object centric view of the world
<sdegutis>
yea im sleepy and only half paying attention
<Drup>
Just write a function.
ygrek has joined #ocaml
<pippijn>
sdegutis: you can make: val some_function : string -> int
<pippijn>
sdegutis: and that function translates string to t and t to int
<pippijn>
sdegutis: you can do this automatically using tools provided by the ocaml type system
<sdegutis>
im thinking of Swift right now, and in Swift i can make a function so that it returns a list of 't, where 't confirms to interface/protocol LuaValue which has a method t.push()
lordkryss has quit [Quit: Connection closed for inactivity]
<sdegutis>
This way, I could return this from a swift function: [1234, "foo", 3.14] and its valid without any type conversions, because int, float, and string all conform to my protocol (i extended them)
<Drup>
you can't do it this way in ocaml.
<sdegutis>
and in ocaml i want to return [1234; "foo"; 3.14] from a function that returns "lua_type list"
<sdegutis>
where lua_type is a signature that anything can conform to i guess
<Drup>
No, that's not how it works
<Drup>
use an ADT.
<sdegutis>
sum type?
<sdegutis>
i.e. variant type?
<Drup>
yes
<sdegutis>
but i want to be able to extend it later to new types from outside the definition of this type
<sdegutis>
but variant types are not extensible from without
<pippijn>
=> expression problem
<Drup>
why ?
<sdegutis>
thats why i moved from a swift enum to a swift protocol
<Drup>
example of things you only want to add after the fact ?
<sdegutis>
Drup: because i want to be able to return some_rect instead of Table.to_table some_rect
<sdegutis>
Drup: mostly other structs like point, rect, size, range, etc
<pippijn>
you want implicit conversions?
<Drup>
sdegutis: just define type alias and conversion functions.
<sdegutis>
i didnt think you needed to *convert* something to a signature
<Drup>
you should extend your adt for that
<Drup>
you should not need to extend your adt for that*
<sdegutis>
Drup: i want other uses of my library to be able to do it, with my library being sealed
<Drup>
they can define conversion functions and type aliases too
<sdegutis>
ok
<sdegutis>
ill do that
<Drup>
Lua types are fixed, they are not extended. Your interface is weird if you allow to arbitrary add new kind of lua objects.
<sdegutis>
i agree
chouser has quit [Ping timeout: 276 seconds]
<sdegutis>
sum type is coolest
<sdegutis>
and bestest
<pippijn>
I have a network packet encoder/decoder with extensible formats
<pippijn>
and composable
oriba__ has quit [Quit: oriba__]
<pippijn>
with combinators
<pippijn>
you can do something similar for your lua thing
<pippijn>
to describe structural information about your lua tables in static types
<pippijn>
that can then be used to automatically decode/encode the tables into statically typed ocaml tuples
<pippijn>
but that will sit on top of your low level api
<Drup>
pippijn: that will still not give you the coertions he wants
ontologiae has quit [Ping timeout: 244 seconds]
<Drup>
but, as you said "I see great GADTs in your future".
<sdegutis>
my first ocaml code: type lua_type = String | Number | Boolean | Function | Table | Userdata | LightUserdata | Thread | Nil
jao has quit [Ping timeout: 252 seconds]
<sdegutis>
oh right, gotta figure out the build system
<sdegutis>
grahahla;hs;dflsad
<Drup>
mcc: you ok for the example thing ?
<sdegutis>
cant i just pass all my stuff to ocamlopt?
<sdegutis>
or ocamlc?
<sdegutis>
oasis is so far broken and retarded
<sdegutis>
i didnt make any typos but i got a broken makefile
<pippijn>
you probably forgot commas
<pippijn>
sdegutis: can you show your _oasis?
<sdegutis>
oh, "src" needs to have stuff in it
<sdegutis>
fixed.
<pippijn>
ok
<sdegutis>
i just had ./hi.ml not ./src/hi.ml
<pippijn>
oasis *is* broken and retarded
<pippijn>
but yeah, that was a mistake
chouser has joined #ocaml
<sdegutis>
Oh nice, I can just edit _oasis aftre the Makefile is created, and not have to keep re-creating the makefile
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<sdegutis>
if a function takes no args, do you call it like foo () or foo ?
<Drup>
with ()
<sdegutis>
i assume foo () since foo just returns the function
<sdegutis>
ok
<sdegutis>
thx
<sdegutis>
its weird that () is called unit and [] called nil
<sdegutis>
seems it should be reversed
<pippijn>
why?
<sdegutis>
nil is teh absence of value like () is, and [] is the foundation for a potential list like [] is
<sdegutis>
*and unit is the fou--
<Drup>
hum, no, it's the opposite in all the language I know
<sdegutis>
im not talking about other languages
<Drup>
in particular, nil is call nil in lisp.
<sdegutis>
im talking about english/latin
<Drup>
Oh.
<Drup>
well, () is not the absence of value
<pippijn>
() is a value
<Drup>
it's literally the only value in it's type.
<sdegutis>
its a singleton value that has no semantic meaning except the absence of any other value
<Drup>
hence, unit.
<sdegutis>
bla
<sdegutis>
whatever
<pippijn>
None has the semantic meaning of "no value"
<sdegutis>
which is funny cuz its also a value
<sdegutis>
alternative of Some x
<pippijn>
yes
<pippijn>
no value = exception
<pippijn>
exceptions are a way to write partial functions
<pippijn>
I don't like exceptions for anything but very local control flow
<sdegutis>
how can you print a rough description of a function value?
<sdegutis>
doesnt matter what it is, could be an address for all i care
<pippijn>
print_int (Obj.magic value)
* Drup
cries.
<sdegutis>
thanks
<sdegutis>
none of my changes are taking effect when i run make
<sdegutis>
oh nm
<sdegutis>
im editing ./hi.ml not ./src/hi.ml
alpen has joined #ocaml
<sdegutis>
how do you use ctypes inside a .ml file and not in th repl?
<sdegutis>
well either way, hes the one who told me to look into ocaml last year
<sdegutis>
i cant figure out how to get a very dead-simple ctypes example to work
<sdegutis>
i put open Ctypes at the top of my .ml file and it says error
<sdegutis>
Error: Unbound module Ctypes
<chouser>
is there any way to avoid repetition in match patterns?
<sdegutis>
chouser: got an example?
<sdegutis>
chouser: in return maybe you can help me figure out this ctypes crap
<chouser>
That is, some way to abstract out a pattern that shows up a lot?
<pippijn>
chouser: functions
<chouser>
You can call function on the left of a -> ?
<pippijn>
chouser: other than that, no
<pippijn>
chouser: no
<chouser>
oh
<sdegutis>
chouser: can you please paste an example?
<pippijn>
and I also wish we had some sort of pattern construction
<sdegutis>
pretty much all google results for "Error: Unbound module Ctypes" point to that IRC conversation between pippijn and technomancy from last year
<pippijn>
simple compile time pattern construction
<sdegutis>
and the answer pippijn gave him (to use #require "ctypes.foreign";;) does not apply to my .ml file
<sdegutis>
that only applies in the interactive prompt
<pippijn>
2013-09-02 21:49 <pippijn> then it compiles
<pippijn>
2013-09-02 21:49 <technomancy> true:package(ctypes.foreign),thread,annot,debugging should do it
<sdegutis>
oh let me put that in my _oasis somewhere
<pippijn>
that goes in _tags
<sdegutis>
oh let me look for _tags
<pippijn>
but you can also put it in _oasis, with a different format
<pippijn>
something like Dependencies
<pippijn>
look in the manual
<chouser>
I've got a record type in a variant such that this is a valid pattern: Types.Types.List { Types.Types.value = [(Types.Type.Symbol {Types.Types.value = "foo" })] }
<sdegutis>
chouser: remove Types.Types. in all places but one
<chouser>
And then I've got a few matches that use that with different strings for "foo"
<pippijn>
looks like you want local open
<sdegutis>
chouser: just one is enough to make the type inferer work
<sdegutis>
it was referencing context that it didnt explain anywhere else
<sdegutis>
so i assumed its just crappy documentation and nobody noticed
chouser has quit [Ping timeout: 245 seconds]
swgillespie has joined #ocaml
pyon has joined #ocaml
<sdegutis>
I think I really would have liked OCaml.
<sdegutis>
Too bad.
sdegutis has quit [Quit: Leaving...]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<imslavko>
hey guys, I am pretty new to OCaml and getting a syntax error. The error message is quite unhelpful "Error: Syntax Error", can anyone help please? I have a github repo: https://github.com/Slava/decaf/tree/parser-base
lambdahands has quit [Ping timeout: 244 seconds]
<S11001001>
imslavko: you could try deleting halves until you find the section whose deletion removes the error
<sdegutis>
thizanne, Drup, flux: my plan is to have type lua_value = Integer of int | String of string, etc, and I will pass "lua_value list" into a Lua function defined in OCaml, and I can define it as let my_lua_fn (String s) (Integer i) = do_something s i
<whitequark>
it should
<Drup>
sdegutis: ah, you want partial definition
<Drup>
then no, you can't do that.
<sdegutis>
Drup: partial definition? that doesn't sound right
<Drup>
do a pattern match
<sdegutis>
oh sorry no no no
<sdegutis>
I meant let my_lua_fn [(String s); (Integer i)] = do_something s i
<Drup>
and what do you do if it's not exactly a string and an integer
<ggole>
You can do that, but you'll get warnings
<Drup>
?
<sdegutis>
I just took an argument called "args" and destructured it later
<companion_cube>
hey, ppx_deriving_yojson isn't compatible with ppx_deriving 2.0 ? :(
<sdegutis>
Drup: there is a function earlier that verifies at runtime that it is in fact a string and an int
<companion_cube>
gah, never mind
<Drup>
sdegutis: no, you can't do that.
<sdegutis>
Drup: hy not?
<sdegutis>
Drup: this one part of my code is not perfectly compile-time verifiable but that's inevitable because i'm wrapping a dynamic language (lua)
<sdegutis>
Drup: im pretty sure i can do this
<sdegutis>
Does anyone in here have experience with using ctypes with C files that are part of my project's own source, as opposed to being a statically linked library?
<def`>
sdegutis: the usual way to fix this is to make the verification function produce a value with a stricter type
<sdegutis>
def`: but I need a specific type signature for all my Lua functions written in OCaml
<sdegutis>
def`: in this case: () -> lua_value list
<def`>
sdegutis: then you juste assert false :P
<sdegutis>
er wait, I had that wrong: lua_value list -> lua_return_value
<sdegutis>
def`: what? im confused
<def`>
let my_lua_fn = function [(String s); (Integer i)] -> blabla | _ (*anything else*) -> assert false
<def`>
(you can also use a set of combinators to express that in a "lighter" fashion)
<sdegutis>
def`: that would be nice except I want to throw a Lua exception for each specific argument
<sdegutis>
I was actually planning on doing this:
<def`>
then combinators are the way to go
<sdegutis>
let my_lua_fn = make_lua_function [check_string; check_integer] (fun (String s); (Integer i) -> do_something s i)
<sdegutis>
The first argument is a list of assertion functions that return Some <expected type> or None (i.e. valid arg)
blandflakes has joined #ocaml
<sdegutis>
my make_lua_function then makes an anonymous OCaml function that checks all the args given to me by Lua first, before calling the second argument given to it (a fun)
<sdegutis>
def`: what do you mean by combinator?
<def`>
sdegutis: I finish some work, I'll give you an example in ~20minutes
<sdegutis>
def`: is it possible you could just explain in a handful of words?
<sdegutis>
def`: im pretty literate with complicated computer concepts, just not their common terms/names
<sdegutis>
(like "combinator")
<sdegutis>
Drup: do you have experience with ctypes?
<def`>
sdegutis: the int, string, @->, return from ctypes are an example of combinators
<def`>
you just build atomic components that you compose to process your input.
<sdegutis>
def`: i dont know how ctypes works, i just know i cant get it to work
<def`>
as you have observed, the resulting values are stronly typed
thegameg has quit [Quit: Bye :D]
thegameg has joined #ocaml
avsm has joined #ocaml
thegameg has quit [Quit: Bye :D]
<companion_cube>
gah, utop is so annoying when it comes to copy/pasting its output
<def`>
(some combinators… those are really ugly but you should grasp the idea)
<flux>
ocaml has: proper module system, object system/row types, strict-by-default, ability to perform side effects (ie: id-generators), opam (my understanding it's nicer than cabal), blindingly fast compilation times, experimental compiler forks for different purposes (ocaml java, ocaml-js, jocaml, metaocaml, ocapic), doesn't have a boatload of extensions that might lead into undecidable compilation ;)
<companion_cube>
so, I'm sad, I can't use type 'a set = WrapSet : (module Set with type t = 't and type elt = 'a) * 't -> 'a set
<companion_cube>
because when I match the GADT, there is no way to unpack the module
<companion_cube>
:(
Haudegen has joined #ocaml
lambdaha1ds has quit [Quit: leaving]
axiles has joined #ocaml
<whitequark>
there isn't?
<companion_cube>
let add set x = let WrapSet ((module S), set) = set in WrapSet((module S), S.add x set);;
<companion_cube>
Error: The type of this packed module contains variables: (module Set.S with type elt = 'b and type t = t#0)
uris77 has quit [Ping timeout: 264 seconds]
uris77 has joined #ocaml
mcclurmc_ has joined #ocaml
chinglish has joined #ocaml
oscar_toro has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
oscar_toro has quit [Ping timeout: 252 seconds]
oscar_toro has joined #ocaml
axiles has quit [Ping timeout: 255 seconds]
fraggle_ has joined #ocaml
thomasga has quit [Quit: Leaving.]
ollehar has quit [Ping timeout: 240 seconds]
mort___ has quit [Ping timeout: 272 seconds]
laalko has joined #ocaml
ontologiae has joined #ocaml
mobajm has joined #ocaml
mobajm has quit [Remote host closed the connection]
badkins has joined #ocaml
jwatzman|work has joined #ocaml
Rc43 has quit [Quit: Page closed]
MrScout_ has joined #ocaml
axiles has joined #ocaml
MrScout_ is now known as MrScout
IbnFirnas has quit [Read error: Connection reset by peer]
msch has quit []
msch has joined #ocaml
sdegutis has joined #ocaml
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Hannibal_Smith has joined #ocaml
rfv has quit []
rfv has joined #ocaml
thomasga has joined #ocaml
Denommus has quit [Read error: Connection reset by peer]
valis_ has quit [Quit: Page closed]
jonludlam has quit [Ping timeout: 264 seconds]
q66 has joined #ocaml
psy has quit [Disconnected by services]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
psy_ has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
jave has quit [Ping timeout: 256 seconds]
flhs has joined #ocaml
ollehar has joined #ocaml
Denommus has joined #ocaml
jave has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 276 seconds]
leowzukw has joined #ocaml
mort___ has joined #ocaml
IbnFirnas has joined #ocaml
larhat has quit [Quit: Leaving.]
<sdegutis>
Is there a function to print a general thing if I don't know what type it is, for debugging purposes?
<Drup>
no
<chouser>
huh! how does the repl do it?
<whitequark>
REPL knows what the type is.
<whitequark>
(since it runs the typechecker and remembers the result)
moei has quit [Quit: Leaving...]
<sdegutis>
dang
<sdegutis>
thats gonna make it tricksy
Submarine has joined #ocaml
Submarine has joined #ocaml
<laalko>
I have a (key, value) list of tuples and a list of "key"s to get the corresponding values of (assumably by List.assoc), but I'm a bit stuck on how to List.map this correctly.
<jeroud>
sdegutis: I generally write a formatter for every type and use that for debugging.
<sdegutis>
ok
MrScout has quit [Ping timeout: 245 seconds]
<laalko>
Any tips?
MrScout_ has joined #ocaml
avsm has quit [Ping timeout: 246 seconds]
<companion_cube>
laalko: you mean find the value for each key?
<laalko>
companion_cube, Yeah. If I run List.assoc key tuple_list it returns the desired result. I'm just not sure how to do that for each element in a list of keys to be checked
<laalko>
That returns the error "The function applied to this argument has type 'a list -> 'b list This argument cannot be applied with label ~f"
<laalko>
Which is... odd
skinkitten is now known as INeedWork
<companion_cube>
oh, you must be using Core
<companion_cube>
then it's List.map ~f:(fun key -> ....) my_key_list
<laalko>
Actually no, I'm a complete moron
<laalko>
I _wasn't_ using core, but was using ~f:
<companion_cube>
oh! :)
<laalko>
It took me a min to see the diff between the two vers of that :)
manizzle has quit [Ping timeout: 252 seconds]
<laalko>
I actually originally used Core for this for List.init but that ended up causing a bunch of confusion
<laalko>
First program in OCaml
<companion_cube>
don't be harsh on yourself :)
<jeroud>
laalko: Seems more successful than my first program in OCaml. :-)
Haudegen has quit [Ping timeout: 256 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
thomasga has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
michatotol has joined #ocaml
<sdegutis>
So far, the most confusing thing to me about OCaml is modules.
oriba has joined #ocaml
<sdegutis>
I was on the Real World OCaml book's chapter on modules (chapter 3 or 4, I think?) and I just couldn't see why the author started creating modules with type "t" in it, instead of just creating a type in the current module.
<sdegutis>
Please help me understand?
INeedWork is now known as HauntedC0de
<jeroud>
sdegutis: That's so things that operate on modules can work more easily.
<smondet>
sdegutis: it's a convention used by a bunch of people, if all types are called `t` in their module it makes it more practical to use functors
<sdegutis>
So I'll learn about this more in the functors chapter?
<jeroud>
Yes.
<sdegutis>
Because, I started reading the Functors chapter, and was confused and thought I had missed some context in the original Modules chapter.
<sdegutis>
So I went back and was still confused.
<jeroud>
The functors chapter is a bit confusing.
<sdegutis>
:'(
<sdegutis>
All of RWO has been so far, except chapter 1 which was awesome
bezirg has joined #ocaml
<Drup>
arguably, functors are a complicated feature.
MrScout_ has quit [Remote host closed the connection]
<jeroud>
Basically, it's useful to have your modules match the input signature of a bunch of common functors.
<laalko>
I actually have this program working in the REPL, woo. Now to figure out how to run it normally.
<jeroud>
I can't remember any examples offhand, though.
<Drup>
jeroud: the ones for Set.Make/Map.Make ;)
thomasga has joined #ocaml
reem has quit [Remote host closed the connection]
<laalko>
Wait... what.
ivan\ has quit [Read error: Connection reset by peer]
<laalko>
>Unknown directive `require'
ivan\ has joined #ocaml
<companion_cube>
#use "topfind";; first? check you have ocamlfind installed
<jeroud>
Drup: Yup. I should have remembered Set.Make considering I used it yesterday.
<sdegutis>
I don't understand what the different syntaxes of "module" are specified as.. I saw "module type X = sig ... end" and "module N : X = struct ... end" and some others.
<laalko>
companion_cube, This program works in the REPL, I'm trying to get it to run as a file now
<jeroud>
I was surprised by how comfortable OCaml felt coming back to it several months after I first learned it.
MrScout has joined #ocaml
uris77 has joined #ocaml
<laalko>
I really like OCaml so far, it's just completely different from anything I'm used to
<jeroud>
sdegutis: The first is a module type, the second is an actual module.
<sdegutis>
oh
<sdegutis>
Are there any other syntaxes for modules besides these two, jeroud?
<Drup>
sdegutis: it's the same as "type t = ...." and "let x : t = ..."
<companion_cube>
laalko: ok, you need to tell your build system (ocamlbuild?) to link against libraries you use
<Drup>
modules are like values : they have (module) types and (module) values, and the two live in different worlds.
<sdegutis>
Drup: but "sig/end" and "struct/end" are special, and this is their only use, right?
<Drup>
well, they are not really special, it's just the way you define them
<Drup>
sig is for module types, struct is for module values
<sdegutis>
ok
<laalko>
companion_cube, I'm just running ocaml ./file
<companion_cube>
laalko: I see
<companion_cube>
it can be useful for scripts, but it's not a long-term solution :)
<companion_cube>
the proper solution is compiling
<laalko>
Oh I know, I just wanna make sure it works
Kakadu has joined #ocaml
<sdegutis>
"We can use Increment to define new modules:" --- oooh, so functors are for creating new modules programmatically
<sdegutis>
right?
<Drup>
sort of
<ggole>
They are pretty much functions over modules.
<sdegutis>
um ok
<sdegutis>
So I can create a list of modules?
<jeroud>
sdegutis: More or less.
<sdegutis>
Wait, does this mean you can have an anonymous module?
<Drup>
sdegutis: you'll see that in the next chapter.
<jeroud>
sdegutis: Look at the chapter about first-class modules.
jabesed has joined #ocaml
<jeroud>
You need to turn them into named modules to use them, but you can pass them around and such.
<sdegutis>
So a module is like a Java class and a module type is like a Java interface.
<sdegutis>
(in terms of role)
<Drup>
that's an acceptable analogy
<sdegutis>
and functor is just another name for the fact that modules can act like functions?
<Drup>
modules can't act like functions
<Drup>
in your analogy, functor would be Java's generics
<sdegutis>
uhh
<Drup>
(except more awesome)
<jeroud>
A functor is to a function as a module is to a value.
Kakadu has quit []
matason has quit [Ping timeout: 246 seconds]
<laalko>
Hm, interesting
<laalko>
I'm using corebuild and it can't find Str
<Drup>
you are not loosing anything by not being able to use Str
<Drup>
:D
<Drup>
(you need to add --package str)
Kakadu has joined #ocaml
<struk|work>
companion_cube: did Containers_misc.Hashset move elsewhere recently?
<laalko>
Drup, thanks
<laalko>
Oh my god this actually works.
<laalko>
I'm shocked.
<companion_cube>
struk|work: yes, I removed it
<adrien>
pffft, breaking API!
<companion_cube>
it's explicitely stated that containers_misc is unstable :p
<jeroud>
Break all the APIs!
<struk|work>
companion_cube: doh..so whats my alternative then?
<jeroud>
(Except the ones I use.)
<companion_cube>
struk|work: do you really need a polymorphic set? :/
rgrinberg has quit [Quit: Leaving.]
<struk|work>
companion_cube: yep!
<companion_cube>
hmmmmm
<struk|work>
companion_cube: I could use a map of course but its much uglier
<companion_cube>
ok, maybe I can put it back :D
<companion_cube>
I removed really bad stuff, but HashSet was actually ok
<struk|work>
companion_cube: ok works for me.
manizzle has joined #ocaml
<companion_cube>
I'll put it back and release asap
<struk|work>
companion_cube: much appreciated
<companion_cube>
:)
<laalko>
Hmm... This program is supposed to generate random numbers and it's using the same numbers each time I run it
<laalko>
Something's very wrong :D
<Drup>
did you initialized the PRNG ? :]
<laalko>
yes
<laalko>
Random.self_init ()
<Drup>
arg !
<Drup>
(I almost felt like my teacher when I was learning programming in OCaml)
<laalko>
heh
<laalko>
Drup, That's in my main function which ends up calling the function that uses Random
<Drup>
and Random.self_init is executed much later
<nicoo>
Drup: Actually, I feel like Random shouldn't expose state in any way (i.e. self-init when the module is loaded, and re-init whenever fork() is called, or every N bytes being output), and force annoying people like C³ to use Random.State :>
<Tekk_>
laalko: dw_gen and all the other stuff are variables, not functions
<Tekk_>
I believe we talkd about this last night :)
<Drup>
nicoo: go back writing your hash combinators.
<laalko>
right right
flhs has quit [Ping timeout: 265 seconds]
<laalko>
Tekk_, It was like 1am
<Tekk_>
fair enough
<companion_cube>
nicoo: I always use Random.State
<nicoo>
Drup: They are on the other laptop, but I have them working
<companion_cube>
so it's pure diffamation
<nicoo>
companion_cube: Mmmh, I remember you saying that enforcing Random being properly initialized would break (your) things
<laalko>
yaaaay
<nicoo>
Might be mistaken
<companion_cube>
no, randomized Hashtables would
<nicoo>
laalko: Yaaay for IRC drama ?
<nicoo>
companion_cube: Ah, yes indeed
<nicoo>
My bad.
IbnFirnas has quit [Read error: Connection reset by peer]
<laalko>
Drup, I originally had that line right after the opens, but the interpreter had complained
* nicoo
hugs companion_cube
<laalko>
which is why I had thought to move it to main
<Drup>
nicoo: "yay" for randomly random.
<Drup>
I think.
<laalko>
Because I don't know what I'm doing :)
<Drup>
laalko: that's fine, we all went through that.
<laalko>
It works now tho
<companion_cube>
nicoo: :p
<nicoo>
laalko: Doing when you don't know what you are doing is usually good for learning :)
<MercurialAlchemi>
what's wrong with Random.State anyway?
<companion_cube>
nothing's wrong
<MercurialAlchemi>
it looks like the proper way to do it
<nicoo>
MercurialAlchemi: Nothing. We weren't complaining about Random.State
<nicoo>
(Was that royal we or schizophrenic we?)
BitPuffin has joined #ocaml
<Tekk_>
nicoo: who's to say that royals weren't schizophrenic?
<nicoo>
Tekk_: Or is inclusive :þ
<Tekk_>
.....interesting
<Tekk_>
nicoo: what character did you use there?
<Tekk_>
it didn't render properly in my terminal
<nicoo>
This one: þ
<nicoo>
It is an icelandic letter, and :þ looks like :P, but nicer
<Tekk_>
yeah
<nicoo>
(Yay for unicode emoji)
<companion_cube>
struk|work: release in progress
<companion_cube>
(it was about time)
<Tekk_>
oh, thorn?
<Tekk_>
þ
<Tekk_>
hmm
<Tekk_>
interesting
<Tekk_>
seems like an emacs issue rather than a terminal one. weird since I've never seen another unicode char render badly.
<struk|work>
companion_cube: its ok I already pinned
<whitequark>
companion_cube: lol "fast"
<whitequark>
i used to push fixes in fifteen minutes on my ruby parser thing, *that* was fast
<companion_cube>
would "fast" be only "5 minutes later at most" for you?
slash^ has quit [Read error: Connection reset by peer]
<Drup>
nicoo:
<Tekk_>
yeah, that one renders..
* Tekk_
shrugs
matason has joined #ocaml
<whitequark>
Drup: actually the former renders for me and yours does not
<companion_cube>
same
<Drup>
Tekk_: you mean,
<companion_cube>
ÞÞÞþþÞÞþÞþ
<nicoo>
Drup: ?
<Tekk_>
Drup: yep
<Tekk_>
Drup's
<Tekk_>
not*
<MercurialAlchemi>
neither of your emojis work in my terminal, but I think I don't have the right font
<Tekk_>
MercurialAlchemi: what terminal are you using?
<whitequark>
those are not emojis.
<MercurialAlchemi>
irssi + urxvt
<whitequark>
none of them.
<whitequark>
it's just unicode characters
<Tekk_>
MercurialAlchemi: URxvt*unicode: true
<Tekk_>
URxvt.locale: en_US.UTF-8
<Tekk_>
URxvt.imLocale: en_US.UTF-8
<Tekk_>
in your ~/.Xresources :)
<Tekk_>
(change the en_US as appropriate)
<MercurialAlchemi>
but thorn works...
<Tekk_>
oh
<Tekk_>
I dunno then
yomimono has quit [Ping timeout: 244 seconds]
zwer_c has joined #ocaml
<MercurialAlchemi>
whitequark: you have emojis in the unicode standard nowadays
<nicoo>
Drup: Ok, this one doesn't appear here. On the other hand, xfce4-terminal is stupid sometimes
zwer has quit [Ping timeout: 250 seconds]
zwer_c_w has joined #ocaml
matason has quit [Quit: leaving]
<MercurialAlchemi>
I think I'd rather have thorn work than have emojis
<Drup>
you guys are not ~unicode~aware~ yet.
<whitequark>
MercurialAlchemi: I'm aware
<MercurialAlchemi>
Drup: whitequark is aware, see
<MercurialAlchemi>
:D
<Drup>
:D
<Drup>
(especially about unicode, event in ocaml code)
<MercurialAlchemi>
s/event/even/ ?
<Drup>
even*
<sdegutis>
Is there shorthand for creating an anonymous function to pass as the last argument to another function?
zwer_c has quit [Ping timeout: 250 seconds]
<MercurialAlchemi>
that's one area where I remain blissfully unaware, on my US-ASCII cloud
<struk|work>
companion_cube: containers master worked fine for me, thanks
<Drup>
Tekk_: foo @@ bar @@ very_long_multiline_argument
reem has quit [Remote host closed the connection]
<Drup>
instead of "foo ( bar ( very_long_multiline_argument ))"
<Tekk_>
ah
<sdegutis>
oh thats kinda nice
reem has joined #ocaml
ggole has quit []
<sdegutis>
let make_person = make_lua_fn [check_string; check_int] @@ fun [ String name; Integer age ] -> ...
<sdegutis>
much nicer.
<mrvn>
Bah, don't use lists as args
<sdegutis>
mrvn: I have to have a function signature that can take any combination of types
<mrvn>
sdegutis: cps or gadts
<sdegutis>
mrvn: it has to allow for functions that take 3 strings and an int, or 2 ints and 1 stirng and 1 int, etc
<sdegutis>
mrvn: whats that?
<Drup>
mrvn: no seriously, stop
<Tekk_>
oh, anyone familiar with playing with ctypes? I can't figure out for the life of me where this is going wrong
<Drup>
he started ocaml 4 days ago
<Drup>
don't tell him about gadts
<Tekk_>
having color values corrupted somewhere in text rendering for my sdl2 binding
<sdegutis>
Drup: im clearly an ocaml epert by now
<mrvn>
Then he shouldn't be writing lua bindings
<Drup>
mrvn: I agree, but that's out of my hands
<sdegutis>
mrvn: im fully qualified to write lua bindings in anything i choose
<Drup>
but you don't have to terrify him already
<mrvn>
sdegutis: The basic idea is that you pass in functions for the check things and build the expected type of the actual function with that.
<sdegutis>
mrvn: thats fine, but then can i write a function (like "make_lua_fn") that takes a function matching any of these generated function types?
<mrvn>
sdegutis: you then get a type like this for example: val make_lua_fn : ('a -> 'b) checks -> 'a -> 'b
MrScout has quit [Remote host closed the connection]
<mrvn>
sdegutis: google for the cps based printf / scanf code for an example. That is probably the nicest way for this kind of functions.
<mrvn>
sdegutis: with lists you always get stupid warnings that your pattern matching isn't exhaustive.
<sdegutis>
mrvn: i rather liked my version
<sdegutis>
oh
<sdegutis>
i could do what someone else suggested and use function with _ -> assert false
<sdegutis>
but thats ugly too
<mrvn>
sdegutis: and what happens when I call: let make_person = make_lua_fn [check_string; check_int] @@ fun [ Integer age; String name ] -> ...?
<sdegutis>
oh wait, idea
<laalko>
Next, shall I clean up, replace / compress functions, or implement user arguments... hm...
<sdegutis>
i could have function with | _ -> wrong_types [ check_string ; check_int ]
<mrvn>
sdegutis: runtime checks suck when you can do compiletime checks instead
<sdegutis>
mrvn: you don't call this function yourself, Lua calls it
<sdegutis>
mrvn: i agree
MrScout has joined #ocaml
Denommus` has joined #ocaml
<sdegutis>
mrvn: so whats that way you said that builds up a new type?
<sdegutis>
functors or something?
<sdegutis>
mrvn: actually no you're totally and completely and utterly wrong here
Denommus has quit [Ping timeout: 245 seconds]
<sdegutis>
mrvn: the user can call this function from lua, so there is absolutely no chance that i can catch mismatched types at compile-time, ever.
MrScout has quit [Read error: Connection reset by peer]
MrScout has joined #ocaml
<MercurialAlchemi>
hmm, the drawbacks of having the current opam switch in your zsh prompt is that it makes zsh unhappy when installing a new switch
Denommus` has quit [Ping timeout: 255 seconds]
<sdegutis>
hahaha
<mrvn>
sdegutis: but at least you can make sure the given checks match the function args.
<sdegutis>
I'm seriously considering learning Haskell, but I don't know what the crap a monad is and it sounds scary. Does OCaml have them?
<mrvn>
sdegutis: not all of it
moei has joined #ocaml
<mrvn>
sdegutis: monads are verry powerfull things that lets you hide the side effects of input/output just so you can claim your language is clean and doesn't have any.
<Drup>
the appear occasionally, but let's say it's not an usual idiom like it is in haskell.
<sdegutis>
mrvn: I essentially can build up a "lua_value list" (i.e. Integer 3 :: String "foo" :: Nil :: Integer 2) in my intermediate function when handling a Lua function call to call OCaml with.
<S11001001>
mrvn: monads are not about side effects.
<Drup>
what S11001001 said.
<sdegutis>
mrvn: thus I can just do the function pattern matching and have a _ case that asserts a list of expected types
<mrvn>
S11001001: they still are used for it
<MercurialAlchemi>
monads are not scary, but they can be a bit painful
<S11001001>
mrvn: Yes. But that is a totally different relationship than the one you just suggested.
<MercurialAlchemi>
definitely not an integral part of the language like in Haskell
<Drup>
mrvn: that's an unfortunate decision by haskell people, not a fact about monads
<MercurialAlchemi>
(the really unfortunate decision is the monad transformer tower, IMHO...)
<Drup>
it's like saying "gadts are for printers" because Format/Printf are inplemented with them ...
<mrvn>
anyway, ocaml can only build a subset of the monads haskell can do.
<Drup>
not really ...
<MercurialAlchemi>
monads are like alcohol, use too many of them at once and you're going to get a bad headache
<Drup>
it's just monads are a pita to use in OCaml
<sdegutis>
so it turns out i was right all along
<sdegutis>
lua_value list is the best way to go
<companion_cube>
Drup: they just aren't as convenient, but come on, not a "pita"
<Drup>
companion_cube: parametrized over a monad takes much more code than in Haskell, so, yes, pita.
<mrvn>
sdegutis: it's the simplest but not the safest
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<mrvn>
sdegutis: and every function needs a _ -> raise Wrong_args
<sdegutis>
mrvn: it is the safest because lua
<sdegutis>
mrvn: yes but they all would have had arg-checking anyway
<sdegutis>
mrvn: otherwise let me ask you this:
<mrvn>
sdegutis: it's unsafe because it lets you give different checks than the function needs
<sdegutis>
mrvn: is there a way to inspect, at runtime, a variable list of types given to a function, and do something based on them?
<Drup>
given your knowledge of statically typed languages and OCaml, I find your very presumptuous to think that you already know the best way to do things :D
<sdegutis>
mrvn: oh also this allows me to have a function that takes both [string;string;int] and [string;int] and do two different things afaik
<mrvn>
sdegutis: I expect lua has runtime type infos and you convert them to a variant type in ocaml in some way, right?
<sdegutis>
Drup: why sir or madam, i have been using statically typed languages since before you were born
<Drup>
Java doesn't count.
<sdegutis>
Drup: assuming you're no more than 8 years old
<mrvn>
sdegutis: overloading makes it a lot more complex.
<sdegutis>
mrvn: hardly!
<Drup>
(and I'm only judging by what I see ;) )
<sdegutis>
function | [ String s ] -> do_something s | [ Integer i ] -> do_something_else i | _ -> wrong_args
<sdegutis>
or some crap
<mrvn>
sdegutis: but how do you give the checks list for that?
<sdegutis>
Drup, et al: best explanation ive seen so far on functors: "functors are like functions, but they operate on modules. To understand why they can't just be functions, you need to understand why modules can't just be normal data."
<mrvn>
except modules in ocaml are first class now
<Drup>
we should do a serie of blog post about functors
<Drup>
culminating by "functors are buritos"
<mrvn>
functors do static dispatch and first class modules do dynamic dispatch, right?
<Drup>
and, to put a cherry on the top, A paper "functors are not functors nor applicative functors."
<Drup>
(In order to settle the matter, you know)
<Drup>
rgrinberg: for next Christmas, on the 24, special edition ? :D
<mrvn>
lets write a functor factory.
<Drup>
mrvn: that's easy, you can totally do high order functors
<MercurialAlchemi>
I wrote a module factory recently
<mrvn>
MercurialAlchemi: common construct to generate unique keys/types.
<MercurialAlchemi>
well, not in my case
<MercurialAlchemi>
it was an experiment to see how easy it would be hide request-level variables from the service layer in a classic MVC-with-service pattern
<MercurialAlchemi>
-> it's cumbersome
AlexRussia has joined #ocaml
<Drup>
(as long as you can't put Y in functors, we are safe)
<mrvn>
Why? (play on words :)
icicled has joined #ocaml
<Drup>
for termination purposes :<
<Drup>
(ok, you can encode Ackermann, so practical termination is already screwed)
<mrvn>
ack 9 9;;
<icicled>
Is there an easy way to reuse the functions in Yojson.Basic.Utils with Yojson.Safe.json?
vanila has quit [Quit: Leaving]
<Drup>
MercurialAlchemi: you do realize eliom sort of do that ?
<Drup>
oh, it's not really properly hidden, you are right
<Drup>
yes, it's annoying.
<MercurialAlchemi>
Drup: no, unfortunately my free time largely vanished, and along with it my let's-study-eliom-time :(
<Drup>
:(
<MercurialAlchemi>
Drup: well, I'm not too satisfied with my solution, either, first-class modules are syntax-heavy
<Drup>
yes
<Drup>
when I tried something like that, I ended up simply creating a function returning None if outside a request and Some ... if inside a request
<Drup>
by not-so-carefully applied side effects
<MercurialAlchemi>
so you had some kind of thread-level request object?
<Drup>
it's not thread level, but yes
<MercurialAlchemi>
right
<Drup>
basically, you have some form of scoped references, you decide the scope (the request, the user, the website, ..). The headers are, for example, a request-specific reference
<Drup>
and eliom takes care of not screwing up the side effects machinery to handle that.
<Drup>
it works, but I never looked at how it's implemented n__n
<sdegutis>
I'm mostly drawn by the ecosystem and the lack of this confusing module stuff.
<Drup>
(not to say haskell is bad, to each his own :p)
<laalko>
So while ocaml-diceware in its current state was useful for learning, it's pretty much as inefficient as it could possibly be :D
<rgrinberg>
Drup: we need a vouillon reminder to merge a simple PR and we can finally make a release :D
<Drup>
hum
<Drup>
I can do that tomorrow, I think.
<scythe->
all ecosystems look better from a distance
<scythe->
(including natural ones, it looks pretty until it tries to eat you)
<scythe->
e.g. opam looks awesome but then it's a pain because everything is the wrong version or whatever
<MercurialAlchemi>
*cough* cabal *cough*
MrScout has quit [Ping timeout: 245 seconds]
<sdegutis>
MercurialAlchemi: what about cabal?
<tcpc>
*cough* *cough*
<Drup>
scythe-: everything is the wrong version ?
<MercurialAlchemi>
and don't you reinstall something
<Drup>
MercurialAlchemi: it warns you if you want to reinstall :D
<Drup>
"reinstalling is dangerous !"
<MercurialAlchemi>
yes, it tells you how many kittens it's going to chew
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
<MercurialAlchemi>
except it's schrodingger kittens, so you only got to find out if they're going to be eaten when you say "yes"
<Drup>
or rather, half an hour later
MrScout has joined #ocaml
<struktured>
ugh worst commute ever. I had to way for 5 subways to go by to get home. damn "historic" blizzard
<struktured>
*wait
<pippijn>
nyc?
<smondet>
MercurialAlchemi: sdegutis if you know of a package manager somewhere on earth dealing with opam's problems better than opam, i'd be very curious
<struktured>
pippijn: yeah, time for same ocaml though, now that I escaped the office
<smondet>
struktured: 4,5,6 lines that bad?
<struktured>
smondet: if you aren't a jerk you aint getting home any time soon
<MercurialAlchemi>
smondet: opam works for me (most of the time)
<smondet>
struktured: boss made us work from home today and tomorrow
<struktured>
smondet: it would have been fine if I left around 2 pm
Haudegen has quit [Ping timeout: 246 seconds]
<struktured>
smondet: but yeah, WFH tommorow, which means more ocaml
<smondet>
cool :)
Denommus has joined #ocaml
Haudegen has joined #ocaml
IbnFirnas has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
ontologiae has quit [Ping timeout: 246 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
osa1_ has quit [Read error: Connection reset by peer]
blandflakes has joined #ocaml
ollehar has joined #ocaml
<sdegutis>
Does OCaml have functions like take and drop from Haskell?