Haudegen has quit [Remote host closed the connection]
env__ has quit [Ping timeout: 260 seconds]
<benzrf>
so if you wanna expose the definition of a type, you have to paste the whole definition twice?
pierpal has joined #ocaml
<okuu>
benzrf: You have to type (hehe!) it both in the module's definition and in its signature, yes.
<benzrf>
kk
<okuu>
benzrf: Unfortunately OCaml has nothing like SML's transparent ascription.
<benzrf>
ah, i don't know sml
<benzrf>
:p
<benzrf>
i thought ocaml grew out of caml grew out of sml tho
<pierpa>
more like both grew out of proto-ml
FreeBirdLjj has joined #ocaml
env__ has joined #ocaml
<okuu>
benzrf: Opaque ascription creates abstract types out of abstract type specifications in the signature, whereas transparent ascription doesn't. OCaml doesn't have transparent ascription, but I guess destructive substitution (“with type foo := ...”) can be used for the same purposes.
env__ has quit [Ping timeout: 248 seconds]
<benzrf>
destructive substitution?
<benzrf>
actually what is type ascription for that matter >.<
env__ has joined #ocaml
<okuu>
Signature ascription (well, OCaml calls signatures “module types”), not type ascription.
<okuu>
Suppose you have “signature FOO = sig type foo val foo : foo end”. (Sorry, I am rather unimaginative about names.)
<okuu>
Argh, s/signature/module type/
<benzrf>
:)
<okuu>
Now you define “module Foo : FOO with type foo = int = struct type foo = int val foo = 0 end”. This does what you'd obviously expect.
env__ has quit [Ping timeout: 268 seconds]
<okuu>
i.e., it defines a module Foo that contains a type synonym “type foo = int” and a value “val foo : int”.
<benzrf>
w8
<benzrf>
what is 'with'
<okuu>
“FOO with type foo = int” is itself a module type.
<benzrf>
o
<okuu>
Namely, it is the module type that results from saying that, within “FOO”, the type component “foo” is no longer abstract, but rather a synonym for “int”.
<okuu>
Also, I messed up. I should have said “let foo = 0”.
* okuu
is evidently more used to SML syntax.
<okuu>
Anyhow.
<okuu>
Now suppose you instead do “module Foo : FOO with type foo := int = struct type foo = int let foo = 0 end”.
<okuu>
Now Foo no longer has a type component called “foo”.
<okuu>
Instead, it just has a value component “val foo : int”.
<okuu>
Because the type component “type foo” has been destructively assigned the type “int”.
<okuu>
Errr, destructively substituted wih the type “int”.
<okuu>
That is, “FOO with type foo := int” is also a module type, albeit one that only contains the value specification “val foo : int”.
iamtakingiteasy has joined #ocaml
iamtakingiteasy has quit [Killed (Sigyn (Spam is off topic on freenode.))]
pierpal has quit [Ping timeout: 264 seconds]
<okuu>
As is usual with SML / OCaml differences, the SML alternative (transparent ascription) is conceptually simpler, but the OCaml alternative (destructive substitution) is more powerful.
env__ has joined #ocaml
<benzrf>
o:
<benzrf>
wait, so the former example you gave doesnt work in ocaml?
<okuu>
Both examples work in OCaml.
<benzrf>
"OCaml doesn't have transparent ascription", you said - so the former isn't 'transparent ascription'?
<okuu>
The former isn't transparent ascription.
<okuu>
I was illustrating normal substitution with destructive substitution.
<okuu>
Ascription is module-land's upcasting. When you ascribe a signature to a module, what you get is a module that only keeps the components specified in the signature.
<okuu>
The difference between opaque and transparent ascription is their behavior w.r.t. abstract type specifications in signatures.
<okuu>
Note that, in the opaque ascription example, the type Foo.foo is not externally known to be int, which is why the type-checker barks when I try to compare Foo.foo with 0.
<okuu>
But in the transparent ascription example, the type Foo.foo is externally known to be int, so comparing Foo.foo with 0 works just fine.
stalled8 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
zolk3ri has quit [Quit: Lost terminal]
parcs has joined #ocaml
ziyourenxiang has quit [Ping timeout: 244 seconds]
averell- has joined #ocaml
env__ has quit [Ping timeout: 244 seconds]
zolk3ri has joined #ocaml
averell- is now known as averell
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
dhil has joined #ocaml
Ben644 has joined #ocaml
Ben644 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
FreeBirdLjj has quit [Remote host closed the connection]
olle has quit [Ping timeout: 268 seconds]
quarters has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
<quarters>
hello. I'm new to OCaml and was trying to install easy-format but am getting a compilation error and was wondering how to resolve this
sapristi_ has joined #ocaml
Khady_ has joined #ocaml
sapristi has quit [Remote host closed the connection]
Khady has quit [Ping timeout: 240 seconds]
caw_________ has quit [Ping timeout: 240 seconds]
env__ has joined #ocaml
caw_________ has joined #ocaml
aegray_ has joined #ocaml
Khady has joined #ocaml
Khady has quit [Changing host]
Khady has joined #ocaml
okuu has joined #ocaml
sapristi__ has joined #ocaml
equalunique[m]1 has joined #ocaml
wagle_ has joined #ocaml
unyu has quit [Killed (rajaniemi.freenode.net (Nickname regained by services))]
okuu is now known as unyu
shakalaka has quit [Ping timeout: 256 seconds]
aegray has quit [Ping timeout: 256 seconds]
env__ has quit [Ping timeout: 256 seconds]
sapristi_ has quit [Read error: Connection reset by peer]
wagle has quit [Read error: Connection reset by peer]
Khady_ has quit [Read error: Connection reset by peer]
rom1504 has quit [Ping timeout: 256 seconds]
equalunique[m] has quit [Ping timeout: 256 seconds]
rom1504 has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
smondet[m]1 has joined #ocaml
h11[m]1 has joined #ocaml
infinity0_ has joined #ocaml
jun_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0 has quit [Ping timeout: 256 seconds]
smondet[m] has quit [Ping timeout: 256 seconds]
h11[m] has quit [Ping timeout: 256 seconds]
jun has quit [Ping timeout: 256 seconds]
dedgrant has quit [Ping timeout: 256 seconds]
ocabot_ has quit [Ping timeout: 256 seconds]
peddie[m] has quit [Ping timeout: 256 seconds]
env__ has joined #ocaml
remix2001 has joined #ocaml
ocabot_ has joined #ocaml
remix2000 has quit [Ping timeout: 256 seconds]
peddie[m] has joined #ocaml
kandu has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
Guest16391 has quit [Ping timeout: 256 seconds]
jimt has quit [Ping timeout: 256 seconds]
jimt has joined #ocaml
Jamesofur3 has joined #ocaml
Jamesofur3 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
sapristi__ has quit [Remote host closed the connection]
sapristi__ has joined #ocaml
sapristi__ has quit [Remote host closed the connection]
<steenuil>
quarters, just give some info about your problem and somebody will respond eventually
MartesZibellina has joined #ocaml
MartesZibellina has quit [Killed (Sigyn (Spam is off topic on freenode.))]
loli has joined #ocaml
olle has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Shanmugamp717 has joined #ocaml
Shanmugamp717 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
env__ has quit [Ping timeout: 256 seconds]
NyanCat2 has joined #ocaml
NyanCat2 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
badon15 has joined #ocaml
badon15 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
env__ has joined #ocaml
env__ has quit [Ping timeout: 256 seconds]
Jesin has quit [Remote host closed the connection]
env__ has joined #ocaml
dilettante has quit [Quit: leaving]
crayfishx25 has joined #ocaml
crayfishx25 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
dilettante has joined #ocaml
env__ has quit [Ping timeout: 256 seconds]
webshinra_ is now known as webshinra
env__ has joined #ocaml
env__ has quit [Ping timeout: 268 seconds]
Guest29805 has joined #ocaml
Guest29805 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
env__ has joined #ocaml
env__ has quit [Ping timeout: 256 seconds]
monoxane29 has joined #ocaml
monoxane29 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
env__ has joined #ocaml
env__ has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Quit: leaving]
olle has quit [Ping timeout: 260 seconds]
zolk3ri has joined #ocaml
kakadu has joined #ocaml
env__ has joined #ocaml
aquiandres has quit [Ping timeout: 240 seconds]
Guest74557 has joined #ocaml
bladernr9 has joined #ocaml
bladernr9 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
Guest74557 has quit [Ping timeout: 256 seconds]
Fare has quit [Ping timeout: 240 seconds]
olle has joined #ocaml
Fare has joined #ocaml
rom1504 has quit [Quit: WeeChat 1.6]
rom1504 has joined #ocaml
rom1504 has quit [Client Quit]
rom1504 has joined #ocaml
Fare has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
vadeen has joined #ocaml
tasse25 has joined #ocaml
tasse25 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
<vadeen>
Hi, I'm trying to return a polymorphic variant from FFI. The manual say they are represented as integers if they have no arguments. But I get segfault if I return it as integer like so: CAMLreturn(Val_int(hash_variant("GenericEvent"))), why no worky?
<vadeen>
Ah nvm, think its some kernel stuff im screwing with. thanks anyways
vadeen has quit [Quit: WeeChat 1.9.1]
pierpal has quit [Ping timeout: 256 seconds]
env__ has quit [Quit: leaving]
zolk3ri has quit [Quit: leaving]
Mr_Sheesh26 has joined #ocaml
Mr_Sheesh26 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
zolk3ri has joined #ocaml
Harzilein21 has joined #ocaml
Harzilein21 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
zolk3ri has quit [Client Quit]
zolk3ri has joined #ocaml
olle has quit [Quit: Lost terminal]
profall3 has joined #ocaml
profall3 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
ChasedSpade has joined #ocaml
ChasedSpade has quit [Killed (Sigyn (Spam is off topic on freenode.))]
foddo16 has joined #ocaml
foddo16 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
kini has quit [Quit: bye]
Haudegen has joined #ocaml
wagle_ is now known as wagle
Fare has joined #ocaml
pierpa has joined #ocaml
MissionCritical has joined #ocaml
MissionCritical has quit [Killed (Sigyn (Spam is off topic on freenode.))]
kakadu has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 256 seconds]
Sousapro3 has joined #ocaml
Sousapro3 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
msm has joined #ocaml
msm has quit [Killed (Sigyn (Spam is off topic on freenode.))]
unyu has quit [Quit: Test.]
JimmyRcom has joined #ocaml
Waldo29 has joined #ocaml
Waldo29 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
Ceber14 has joined #ocaml
Ceber14 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
L0S has joined #ocaml
L0S has quit [Killed (Sigyn (Spam is off topic on freenode.))]