thomasga has quit [Read error: Connection reset by peer]
<introom>
companion_cube: so I can basically view it as a workaround as the actual return type cannot be determined statically.
<companion_cube>
it's not a workaround, it's to be able to specify a case where you cannot return something of type 'a
<companion_cube>
so you return either Some value of None
<companion_cube>
(see the case with a hashtable lookup)
metasyntax has joined #ocaml
<companion_cube>
and the possibility of retuning None is visible in the type, which is 'a option instead of 'a
tane has joined #ocaml
<alexey>
You can think about val f : 'a -> 'b option as about a function which may or may not return the value of type 'b
<introom>
should I view 'b option as a whole?
<alexey>
yes, as 'b list for example
travisbrady has joined #ocaml
<introom>
nice
<alexey>
there's no magic in option, it's just convenience; you can do it yourself:
<alexey>
# type 'a myoption = Nothing | Something of 'a ;;
<alexey>
type 'a myoption = Nothing | Something of 'a
<alexey>
# Something 3 ;;
<alexey>
- : int myoption = Something 3
<alexey>
# Nothing ;;
<alexey>
- : 'a myoption = Nothing
sgnb has joined #ocaml
ollehar has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<introom>
yes.
<introom>
but how do I view the relation of 'a myoption and int myoption. Can I consider the former one superset? or these twos are just paralled.
<skchrko>
`a myoption is general type and int myoption is concrete type
<alexey>
but yes, 'a myoption is kind of superset
cago has joined #ocaml
<alexey>
# let f x default = match x with | Something x -> x | Nothing -> default ;;
<alexey>
val f : 'a myoption -> 'a -> 'a = <fun>
<alexey>
f would gladly accept both int myoption and string myoption, for example
<alexey>
# f (Something 1) 0 ;;
<alexey>
- : int = 1
<alexey>
# f Nothing 0 ;;
<alexey>
- : int = 0
<alexey>
# f (Something "foo") "bar" ;;
<alexey>
- : string = "foo"
<orbitz>
They are not subtypes though
<orbitz>
As far as I understand
<alexey>
Well, they are (unless you're using the different notion of subtype than I do): everything that accepts 'a myoption would accept int myoption
<orbitz>
hrm maybe, i'm not a type theorsist so i'll keep my mouth shut
<alexey>
neither am I, so you may be right :)
walter has joined #ocaml
<mrvn>
orbitz: f : 'a .... is called polymorphic
<mrvn>
Maybe it helps if you think to 'a myoption as the type and int myoption as a concret instance of the type.
<alexey>
OCaml at least thinks that int myoption is a subtype of 'a myoption:
<alexey>
# (Nothing : int myoption :> 'a myoption) ;;
<alexey>
- : int myoption = Nothing
<alexey>
# (Nothing : int myoption :> string myoption) ;;
<alexey>
Error: Type int myoption is not a subtype of string myoption
thomasga1 has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
ggole has quit [Ping timeout: 246 seconds]
ulfdoz has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
ggole has joined #ocaml
pygmalion has joined #ocaml
pygmalion has quit [Ping timeout: 245 seconds]
darkf has quit [Quit: Leaving]
ineol has quit [Quit: ineol]
Yoric1 has joined #ocaml
Yoric has quit [Remote host closed the connection]
redfire has joined #ocaml
osnr has quit [Quit: Leaving.]
yezariaely1 has joined #ocaml
yezariaely has quit [Ping timeout: 264 seconds]
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
mort___ has quit [Ping timeout: 276 seconds]
thomasga1 has quit [Client Quit]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
ygrek has joined #ocaml
tane has quit [Quit: Verlassend]
spearalot has quit [Quit: leaving]
Yoric1 has quit [Ping timeout: 240 seconds]
introom has quit [Remote host closed the connection]
yezariaely has joined #ocaml
yezariaely1 has quit [Ping timeout: 259 seconds]
yezariaely has quit [Ping timeout: 256 seconds]
ineol has joined #ocaml
cago has quit [Ping timeout: 244 seconds]
hkBst has quit [Quit: Konversation terminated!]
ocp has joined #ocaml
redfire has quit [Quit: WeeChat 0.4.0]
f[x] has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
<Drup>
We should have a bot than can evalute ocaml expression.
<adrien_oww>
"xavierbot"
csakatoku has quit [Remote host closed the connection]
<Drup>
:D
<orbitz>
if i could get seccomp2 to work i could make a bot to do it unfortauntely i'm dumb
skchrko has quit [Quit: Leaving]
<adrien_oww>
you can restrict the environment
<adrien_oww>
or lxc
<orbitz>
i was under the impression seccomp2 was supposed to be the start of the art
<adrien_oww>
why not but it's going to be more complicated
<adrien_oww>
seccomp restricts the syscalls you can do
<adrien_oww>
so you setup everything, open a communication pipe with your "controlling" process, then enter the restricted mode and you can't open() anymore
<adrien_oww>
lxc starts your stuff in a container
<adrien_oww>
so you can still do everything but you're in a container
<adrien_oww>
different uses
<adrien_oww>
lxc is simple to setup but requires some administration and a filesystem
<adrien_oww>
seccomp is simple to setup but requires you to code
<orbitz>
seccomp2 seemed simpler because it sounded like all I hadto do was making a wrapper program that would set things up and then exec the real program
<orbitz>
which i wrote, but didn't seem t oworkon my system and I ddin't have the time to really debug
mika1 has quit [Quit: Leaving.]
<adrien_oww>
there are going to be users of seccomp2 but probably far less diverse than users of lxc
<adrien_oww>
which means less howtos, examples, ...
<adrien_oww>
heading home
ulfdoz has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 276 seconds]
eikke has quit [Ping timeout: 246 seconds]
srcerer_ is now known as srcerer
yezariaely has joined #ocaml
ollehar has quit [Ping timeout: 276 seconds]
osa1 has joined #ocaml
eikke has joined #ocaml
mye has quit [Quit: mye]
ollehar has joined #ocaml
yezariaely has quit [Ping timeout: 256 seconds]
ontologiae_ has joined #ocaml
ontologiae has quit [Ping timeout: 276 seconds]
ontologiae_ has quit [Ping timeout: 240 seconds]
pango_ has joined #ocaml
pango has quit [Read error: Operation timed out]
gnuvince has joined #ocaml
eikke has quit [Read error: Operation timed out]
Arsenik has joined #ocaml
csakatoku has joined #ocaml
pango_ is now known as pango
csakatoku has quit [Ping timeout: 256 seconds]
ollehar has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Ping timeout: 260 seconds]
dsheets has quit [Ping timeout: 246 seconds]
osa1 has quit [Quit: Konversation terminated!]
eikke has joined #ocaml
gnuvince has quit [Remote host closed the connection]
gnuvince has joined #ocaml
tane has joined #ocaml
ontologiae_ has joined #ocaml
jayprich has joined #ocaml
Yoric has joined #ocaml
Drup has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 252 seconds]
Drup has joined #ocaml
ttamttam1 has quit [Quit: ttamttam1]
mye has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
amiller__ has quit [Read error: Connection reset by peer]
amiller has joined #ocaml
amiller has quit [Read error: Connection reset by peer]
jayprich has quit [Ping timeout: 240 seconds]
amiller has joined #ocaml
mattrepl has joined #ocaml
ontologiae_ has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
UncleVasya has joined #ocaml
f[x] has quit [Ping timeout: 246 seconds]
mattrepl has quit [Quit: mattrepl]
ggole has quit []
so has quit [Ping timeout: 268 seconds]
so has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
smondet has quit [Ping timeout: 240 seconds]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
Breadmonster has quit [Quit: Leaving]
UncleVasya has quit [Read error: Connection reset by peer]
osa1 has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
jayprich has joined #ocaml
_andre has quit [Quit: leaving]
ocp has joined #ocaml
srcerer_ has joined #ocaml
osa1_ has joined #ocaml
ocp has quit [Client Quit]
gereedy has quit [Ping timeout: 240 seconds]
osa1 has quit [Read error: Connection reset by peer]
srcerer has quit [Ping timeout: 240 seconds]
gereedy has joined #ocaml
osnr has quit [Quit: Leaving.]
travisbrady has quit [Quit: travisbrady]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
ineol has quit [Quit: ineol]
ontologiae_ has joined #ocaml
troydm has quit [Remote host closed the connection]
troydm has joined #ocaml
tane has quit [Quit: Verlassend]
osa1_ is now known as osa1
mattrepl has joined #ocaml
domsj has joined #ocaml
contempt has quit [Ping timeout: 245 seconds]
Simn has quit [Ping timeout: 245 seconds]
contempt has joined #ocaml
dsheets has joined #ocaml
travisbrady has joined #ocaml
thomasga has joined #ocaml
csakatoku has joined #ocaml
jayprich has quit [Quit: jayprich]
csakatoku has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
domsj has quit [Ping timeout: 246 seconds]
thomasga has quit [Quit: Leaving.]
Yoric has quit [Ping timeout: 240 seconds]
breakds has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
osnr has quit [Quit: Leaving.]
Drup has quit [Ping timeout: 240 seconds]
ontologiae_ has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
csakatoku has joined #ocaml
osnr has quit [Client Quit]
Drup has joined #ocaml
thomasga has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 240 seconds]
mfp has quit [Ping timeout: 240 seconds]
steshaw has joined #ocaml
mfp has joined #ocaml
osa1 has quit [Ping timeout: 256 seconds]
Arsenik has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 240 seconds]
mye has quit [Quit: mye]
HaikuUser has joined #ocaml
<HaikuUser>
i want to compile f.ml into f.cmx and to link it against a former f.o file , is it possible ?
<mrvn>
No, you can only link files starting with l. :)
cdidd has quit [Ping timeout: 276 seconds]
<HaikuUser>
mrvn i already did it
<HaikuUser>
but those generated names are so painful...
cdidd has joined #ocaml
<mrvn>
ever use oasis?
<mrvn>
linking everything together is a job for the build system.
<HaikuUser>
mrvn i recall that ocamlopt generates f.o from f.ml....
<HaikuUser>
that is confusing with my previous f.c file....
<mrvn>
HaikuUser: yeah, call it f_stubs.c
<HaikuUser>
mrvn i yhought i could avoid it...
<mrvn>
nope
<HaikuUser>
mrvn ok thanks
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
srcerer_ is now known as srcerer
mort___ has quit [Quit: Leaving.]
dsheets has quit [Ping timeout: 246 seconds]
walter has quit [Quit: This computer has gone to sleep]
csakatoku has quit [Remote host closed the connection]
ollehar has joined #ocaml
shinnya has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
Neros has quit [Quit: No Ping reply in 180 seconds.]