ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tnguyen1 has quit [Quit: tnguyen1]
louis1711 has joined #ocaml
<dmbaturin>
lewis1711: As long as you don't use factories of factories and don't connect to oracle, it's probably not enterprise enough.
tnguyen has joined #ocaml
tnguyen has quit [Client Quit]
tnguyen has joined #ocaml
<louis1711>
dmbaturin, this is ocaml. all my constructors be factories
tnguyen has quit [Client Quit]
tnguyen has joined #ocaml
tnguyen has quit [Client Quit]
tnguyen has joined #ocaml
lewis1711 has quit [Ping timeout: 272 seconds]
tnguyen has quit [Client Quit]
tnguyen has joined #ocaml
louis1711 is now known as lewis1711
tnguyen has quit [Client Quit]
mcclurmc has quit [Remote host closed the connection]
tnguyen has joined #ocaml
ncthom91 has joined #ocaml
darkf has joined #ocaml
psy_ has joined #ocaml
MrScout has quit [Ping timeout: 246 seconds]
manud has quit [Quit: manud]
knwn_ has joined #ocaml
mcclurmc has joined #ocaml
MrScout has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
manud has joined #ocaml
keen__________31 has joined #ocaml
keen__________30 has quit [Ping timeout: 240 seconds]
manud has quit [Client Quit]
martinium has quit [Quit: Leaving]
manud has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
MrScout has quit [Ping timeout: 240 seconds]
creichert has joined #ocaml
manizzle has joined #ocaml
dvb_ua has joined #ocaml
tmtwd has quit [Ping timeout: 264 seconds]
<lewis1711>
I always get stuck into this "overtyping" trap in ocaml with discriminant unions of discriminant unions. "that way the compiler can gaurantee blah blah blah". But having a flatter DU and coding my own runtime checks is much, much clear
<lewis1711>
or cleaner
<dmbaturin>
In many cases the best thing to use is a record.
<dmbaturin>
Well, at least I like them personally. :)
tennix has joined #ocaml
tennix has joined #ocaml
manud has quit [Quit: manud]
rgrinberg has joined #ocaml
tennix has quit [Ping timeout: 264 seconds]
MrScout has joined #ocaml
creichert has quit [Remote host closed the connection]
creichert has joined #ocaml
<lewis1711>
dmbaturin, or turn it inside out and use an object
tmtwd has joined #ocaml
tmtwd has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
jbrown has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
jbrown has joined #ocaml
tennix has joined #ocaml
mcclurmc has quit [Ping timeout: 255 seconds]
ollehar has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mort___ has joined #ocaml
creichert has quit [Remote host closed the connection]
creichert has joined #ocaml
DanielRichman has quit [Remote host closed the connection]
DanielRichman has joined #ocaml
iZsh has quit [Ping timeout: 244 seconds]
iZsh has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
mort___ has quit [Quit: Leaving.]
<dmbaturin>
yminsky: Turns out a russian publishing house published a translation of RWO. Do you think it should be included in the book list on ocaml.org? As a note in the original RWO section, or add a section for books in russian and put it there?
tane has joined #ocaml
DanielRichman has quit [Remote host closed the connection]
DanielRichman has joined #ocaml
DanielRi1hman has joined #ocaml
mcclurmc has joined #ocaml
DanielRichman has quit [Ping timeout: 250 seconds]
SIGILL has left #ocaml ["WeeChat 1.1.1"]
mcclurmc has quit [Ping timeout: 265 seconds]
Simn has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
oscar_toro has joined #ocaml
Kakadu has joined #ocaml
zpe has joined #ocaml
TheLemonMan has joined #ocaml
<lewis1711>
I am finding ocaml a bit unwield compared to OO languages as my project grows inside. But given that ocaml modules do everything that I use objects for, I may just simply program in a "one module per custom data-type" style.
<lewis1711>
*grows in size
MrScout has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
<dmbaturin>
lewis1711: It's pretty common to make types abstract, if you want encapsulation.
creichert has quit [Ping timeout: 246 seconds]
<lewis1711>
dmbaturin, not really even encapsulation. It's just a mental thing of code making more sense to me when procedures are next to their data for me. Even if those procedures cut across concerns
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
<ggole>
I'd like to do (module F : FOO with type 'a = ...), is that possible?
divyanshu has joined #ocaml
<ggole>
Er, (module F : FOO with type 'a t = ...)
divyanshu has quit [Quit: Computer has gone to sleep.]
ggole has quit [Read error: Connection reset by peer]
ggole has joined #ocaml
ggole has quit [Read error: Connection reset by peer]
ggole has joined #ocaml
divyanshu has joined #ocaml
ggole has quit [Ping timeout: 255 seconds]
tennix has joined #ocaml
lordkryss has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
divyanshu has joined #ocaml
ggole has joined #ocaml
grouzen has joined #ocaml
zpe has quit [Remote host closed the connection]
jonludlam has joined #ocaml
jabesed has joined #ocaml
manud has joined #ocaml
jonludlam has quit [Remote host closed the connection]
BitPuffin|osx has quit [Ping timeout: 264 seconds]
<flux>
ggole, I believe it is possible. what isn't possible is: ..with type 'a t = 'a, but other forms of rewrite afaik work..
<ggole>
Hmm, doesn't seem to. I get a parse error.
psy_ has quit [Ping timeout: 240 seconds]
<ggole>
And I (think I) need the first form anyway, so that's a non-starter. Damn.
ben_1 has joined #ocaml
manud has quit [Quit: manud]
divyanshu has quit [Quit: Computer has gone to sleep.]
psy_ has joined #ocaml
<lewis1711>
Modules have no polymorphism do they? Like I can't take advantage of the fact that lots of modules have a "to_string" function, to write some "stringify" thing?
<ggole>
You can, but it's pretty strange
octachron has joined #ocaml
<lewis1711>
ggole, how so?
<ggole>
First class modules allow you to take a module as an argument
<ggole>
lewis1711: actually, what I had in mind won't quite work as the type will escape... hmm
psy_ has quit [Max SendQ exceeded]
divyanshu has joined #ocaml
Akshay has joined #ocaml
psy_ has joined #ocaml
<lewis1711>
hmm, maybe I should be using objects instead of modules. then I can just give everything a "to_string" method and let structural typing take care of it
<lewis1711>
hmm objects vs modules is actually a hard problem in ocaml. everyone seems to modules but objects have advantages IMO. I can use structural typing, and I don't have to repeat things in the interface
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
octachron has quit [Quit: Leaving]
<lewis1711>
actually now that I think about it, what would I be missing out on by not using modules?
<lewis1711>
think there's a chapter in RWOC about this
mcclurmc has quit [Ping timeout: 272 seconds]
<lewis1711>
oh objects can't include types. hmm
psy_ has quit [Ping timeout: 240 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
zpe has joined #ocaml
psy_ has joined #ocaml
<lewis1711>
I could boil down all my modules to a private internal type though and a public function that constructs some useful object though. hmm
zpe has quit [Ping timeout: 240 seconds]
_whitelogger__ has joined #ocaml
oscar_to1o has joined #ocaml
gustav__1 has joined #ocaml
gargawel_ has joined #ocaml
hcarty has joined #ocaml
fds_ has joined #ocaml
maufred_ has joined #ocaml
c74d3 has joined #ocaml
adrien_ has joined #ocaml
noplamodo_ has joined #ocaml
oscar_toro has quit [*.net *.split]
keen__________31 has quit [*.net *.split]
c74d has quit [*.net *.split]
Haudegen has quit [*.net *.split]
ggherdov has quit [*.net *.split]
strmpnk has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
n1ftyn8_ has quit [*.net *.split]
lambdahands has quit [*.net *.split]
gargawel has quit [*.net *.split]
maufred has quit [*.net *.split]
chris2 has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
noplamodo has quit [*.net *.split]
vodkaInferno has quit [*.net *.split]
adrien has quit [*.net *.split]
hcarty_ has quit [*.net *.split]
fds has quit [*.net *.split]
MasseR has quit [*.net *.split]
reynir has quit [*.net *.split]
gustav___ has quit [*.net *.split]
_whitelogger_ has quit [*.net *.split]
mearnsh has quit [*.net *.split]
adrien_ is now known as adrien
divyanshu has joined #ocaml
srcerer has quit [Ping timeout: 260 seconds]
n1ftyn8__ is now known as n1ftyn8_
strmpnk_ is now known as strmpnk
lambdahands_ is now known as lambdahands
MasseR has joined #ocaml
ggherdov_ has joined #ocaml
keen__________31 has joined #ocaml
chris2 has joined #ocaml
ggherdov_ is now known as ggherdov
jabesed has quit [Ping timeout: 246 seconds]
emmanueloga has joined #ocaml
kushal has joined #ocaml
Asmadeus_ is now known as Asmadeus
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tennix has joined #ocaml
mcclurmc has joined #ocaml
OnkV is now known as Haudegen
tennix has quit [Ping timeout: 255 seconds]
mcclurmc has quit [Ping timeout: 244 seconds]
reynir1 is now known as reynir
ben_1 has joined #ocaml
ben_2 has joined #ocaml
ben_1 has quit [Read error: Connection reset by peer]
tennix has joined #ocaml
ben_2 has quit [Ping timeout: 244 seconds]
ben_1 has joined #ocaml
tennix has quit [Ping timeout: 264 seconds]
rand000 has joined #ocaml
zpe has joined #ocaml
nullcat_ has joined #ocaml
kdas__ has joined #ocaml
kushal has quit [Ping timeout: 240 seconds]
ben_1 has quit [Quit: Leaving.]
sh0t has joined #ocaml
oscar_to1o has quit [Quit: Lost terminal]
Hannibal_Smith has quit [Quit: Leaving]
lobo has joined #ocaml
martintrojer has joined #ocaml
ben_1 has joined #ocaml
yomimono has joined #ocaml
ben_2 has joined #ocaml
ben_1 has quit [Ping timeout: 250 seconds]
ben_2 has quit [Quit: Leaving.]
kdas__ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
<ollehar>
lewis1711: for to_string functions, I would recommend ppx_derivate
<mackwic>
> E: Field ld is not defined in schema environment
<mackwic>
do you know what would be the name of the config key ?
<adrien>
see setup.data
<adrien>
but I think it doesn't call the linker directly
<adrien>
and ocamlmklib might be involved
<mackwic>
hmm
<mackwic>
not much in setup.data, mostly ocamlopt, and the like. No reference to ocamlmklib also
<mackwic>
which output the .a, ocamlopt or ocamlmklib ?
<adrien>
ocamlmklib: it's a wrapper around a few tools
<adrien>
and ocamlc/ocamlopt will call the C toolchain tools
uris77 has joined #ocaml
toomuchtvrotsurb has joined #ocaml
uris77 has quit [Client Quit]
ygrek has joined #ocaml
<mackwic>
ok, good to know: any setup.ml made with oasis can be override with `ocaml ./setup.ml -build -ocamlopt /path/to/custom/ocamlopt`, same for flags
<mackwic>
I will try some things...
creichert has joined #ocaml
tmtwd has joined #ocaml
raboof has quit [Ping timeout: 246 seconds]
tmtwd has quit [Read error: Connection reset by peer]
raboof has joined #ocaml
tmtwd has joined #ocaml
Akshay has quit [Read error: Connection reset by peer]
Hannibal_Smith has quit [Quit: Leaving]
kushal has quit [Quit: Leaving]
swgillespie has joined #ocaml
<ggole>
Here's a fun problem for you type hackers
<ggole>
Given type (_,_) eq = Refl : ('a,'a) eq
<ggole>
Implement the signature module EqTag : sig type 'a t val create : unit -> 'a t val equal : 'a t -> 'b t -> ('a, 'b) eq option end
fold has quit [Ping timeout: 255 seconds]
<Drup>
If t is a gadt, that's grossly unsound
<ggole>
The type variable won't be generalised
<ggole>
So I don't believe it is unsound.
<ggole>
In fact the type variable being weak is the entire point of the interface
<ggole>
(Also, I have an implementation that type checks without any tricks.)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 246 seconds]
TheLemonMan has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
<Drup>
ggole: I have an implementation with first class modules + extensible types, does that count as tricks ? :D
<rbocquet>
module EqTag = struct type 'a t = A : unit t | B : 'a t -> 'a list t; let a = ref A; let create = let c = !a; a := B c; c; let rec equal a b = match a, b with A, A -> Some Refl | B x, B y -> (match equal x y with Some Refl -> Some Refl | None -> None) | _, _ -> None end
<ggole>
Drup: a gadt extensible type?
<Drup>
yes
<ggole>
That's what I did :)
<ggole>
By tricks I meant Obj or the equivalent
zaquest has quit [Ping timeout: 252 seconds]
<ggole>
rbocquet: hmm, doesn't parse?
<Drup>
and once it parses, it doesn't compile for me
tmtwd has quit [Ping timeout: 240 seconds]
<rbocquet>
ah, the a needs to be wrapped in a any type
<ggole>
Interesting approach though
zaquest has joined #ocaml
<Drup>
ggole: you know there is a similar module in Core ?