Sonarman has quit [Read error: 104 (Connection reset by peer)]
mr_pengy has joined #ocaml
__DL__ has quit ["Bye Bye"]
mfurr has joined #ocaml
<vincenz>
Hi
<mfurr>
hello
<vincenz>
ow's it going
<vincenz>
How even
<mfurr>
pretty good... you?
<vincenz>
Likewise
<mr_pengy>
I am trying to simulate church booleans with simple ocaml expressions.. I can define true, false, and, or and not. My xor is behaving strangely, though. :-(
<Smerdyakov>
How odd, since you can define it in terms of those others.
<mr_pengy>
if I define xor as: let xorx = fin a b -> a (notx b) (b tru fls);; it works
<Smerdyakov>
Also, you can't do Church booleans very well with ML.
<mr_pengy>
if I define it as let xorx = fun a b -> a (notx b) b;; it fails
<mr_pengy>
why not?
<Smerdyakov>
Predicative polymorphism only
<Smerdyakov>
Try using the same "boolean" in "if"s with bodies of different types.
<mr_pengy>
I have to admit I don't understand predicative polymorphism very well.
<mr_pengy>
I'm trying to work through Types and Programming Languages.. I thought it might be easier to play with lambda calculus by making ML expressions, but I guess I can only go so far there
<Smerdyakov>
Do you know what prenex normal form is for predicate calculus?
<mr_pengy>
not off the top of my head, I just looked up the definition and it makes some sense. I think you're several levels above me in theoretical stuff
<Smerdyakov>
OK, do you mean that you now understand what predicative polymorphism is?
<mr_pengy>
no, sorry, I understand prenex normal form.. I don't understand predicative polymorphism
<Smerdyakov>
With predicative polymorphism, all types must be in prenex normal form.
<Smerdyakov>
Not every type has a prenex normal form, because we don't allow existential quantifiers, only universal.
<Smerdyakov>
(And no built-in equivalent of negation, either.)
<mr_pengy>
okay that sorta makes sense, I'm having a little trouble making the jump to how I would define a type in prenex normal form. My understanding of prenex is basically that you can define the expression as a list of qualifiers followed by the expression, without having qualifiers within the expression. I have never tried to define a type this way (I haven't gotten far in TAPL yet).
<mr_pengy>
are they always "forall", or can there be some that are "exists" ?
<Smerdyakov>
Always "forall" in ML.
<Smerdyakov>
I think that might not quite be the reason for this, though.
<Smerdyakov>
I guess there is always a prenex normal form if you start with only forall's, but it's the fact that polymorphic values only come from let's that gets in the way.
<mr_pengy>
I think I will understand some of this better when I get further into this book, I see that it talks about predicative and impredicative much later on
<mr_pengy>
time to get some sleep, thanks very much for the information and for your patience, Smerdyakov.. nite!
mr_pengy has quit ["ERC Version 5.0.1 $Revision: 1.726.2.3 $ (IRC client for Emacs)"]
mfurr has quit ["Client Exiting"]
ulfdoz has joined #ocaml
ulfdoz_ has quit [Read error: 60 (Operation timed out)]
cjohnson has quit [""We live like penguins in the desert...""]
Morphous has joined #ocaml
gim has quit [sterling.freenode.net irc.freenode.net]
Nutssh has quit [sterling.freenode.net irc.freenode.net]
Amorphous has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
Nutssh has joined #ocaml
tintin has quit [Remote closed the connection]
tintin has joined #ocaml
Walnutssh has joined #ocaml
gim_ has joined #ocaml
Nutssh has quit [Read error: 110 (Connection timed out)]
gim has quit [Connection timed out]
Morphous has quit [Read error: 110 (Connection timed out)]
tintin has quit [Read error: 60 (Operation timed out)]
Herrchen has joined #ocaml
Snark has joined #ocaml
nml has joined #ocaml
<nml>
hi all - i'm an ocaml newbie looking for some advice...
<ulfdoz>
re
<nml>
re? (i'm pretty new at irc too ;o)
<nml>
anyway, how do i use a module from another file? I'm looking for somethink like #include
<nml>
(being a c guy)
<vincenz>
no need to #include it
<vincenz>
ModuleName.function
<nml>
looking through the manual seems to indicate that its implicit with the dot syntax
<vincenz>
or...if you want to bypass that
<vincenz>
open ModuleName;
<nml>
i'm trying to modify the calculator exmpale from the reference manual, but the yacc grammar keeps on giving me 'unbound constructor' errors
<nml>
even though i give modulename.constructor in %type
<mflux>
it's Modulename, not modulename
<mflux>
hm, although that would give some other error
<nml>
mflux: yes, sorry, although i do have that in my file
<nml>
in parser.mly: %token <Ast.constint> INT
<mflux>
have you compiled the Modulename before parser.ml?
<nml>
i've compiled the ml to a cmo
<nml>
i've been playing a little with an mli file?
<nml>
do i need to compile that too?
<mflux>
hmm, if you have an mli file then maybe yes, I infact haven't much used those ;)
<mflux>
it should produce a .cmi-file
<nml>
do i need an mli file? I just want my parser to produce a type defined in a different file...
<nml>
that didn't seem to help either
<mflux>
.mli is not required, a .ml can produce both .cmo and .cmi
<nml>
compiling the mli file
<mflux>
and .mli can be generated from .ml with ocamlc -i
<mflux>
how are you compiling the parser?
<nml>
thats cool - thanks
<mflux>
with ocamlc -c ?
<nml>
yup, ocamlyacc for mly -> ml and ocamlc -c for ml -> cmo
<mflux>
and you have files modulename.cmo and modulename.cmi (lowecase m) before trying that latter?
<nml>
yes
<mflux>
how about ocamlc -o foo modulename.ml parser.ml?
<nml>
i still get: 'Unbound type constructor Ast.constint'
<nml>
i have to go. Thanks for your help mflux, i'll try to figure out whats going on (something simple, no doubt) later...
nml has quit []
<Snark>
slt
<Snark>
is it normal that the debian libnumerix-ocaml-dev package doesn't contain numerix.cmxa ?
<Snark>
it used to contain it
Submarine has joined #ocaml
<mflux>
have you checked out the bug reports for the package?
cognominal has quit [Read error: 60 (Operation timed out)]
ianxek has joined #ocaml
<Snark>
mflux: I asked if it's normal precisely to submit one if it isn't ;-)
Snark has quit [Read error: 60 (Operation timed out)]
Snark has joined #ocaml
vezenchio has joined #ocaml
Amorphous has joined #ocaml
Msandin has joined #ocaml
mlh has joined #ocaml
__DL__ has joined #ocaml
Msandin has quit [Read error: 60 (Operation timed out)]
TeXitoi has joined #ocaml
Submarine has quit ["Leaving"]
<Amorphous>
hi. is it possible to cross-compile from linux for win32 with ocaml?
<mflux>
snark, hmh, missing .cmxa would indicate one cannot produce native binaries with it, and if earlier versions did have it, in my opinion it would indicate a bug..
<TeXitoi>
Amorphous: using wine?
<Amorphous>
TeXitoi: not an option :( i want to get around a bug in cygwin. so i want to use mingw but mingw has this command line length limit....
<Amorphous>
under windows
mlh has left #ocaml []
Antonov100 has joined #ocaml
Antonov100 has left #ocaml []
<Snark>
mflux: reported
<Snark>
I downloaded the source package, compiled it, then copied numerix.cmxa and numerix.a in place: problem solved.
_JusSx_ has joined #ocaml
smimou has joined #ocaml
tintin has quit [Remote closed the connection]
Banana has quit ["brb"]
Banana has joined #ocaml
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
TeXitoi has joined #ocaml
Submarine has joined #ocaml
_JusSx_ has quit ["leaving"]
cognominal has joined #ocaml
pango__ has joined #ocaml
_JusSx_ has joined #ocaml
pango_ has quit [Read error: 110 (Connection timed out)]
mfurr has joined #ocaml
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
TeXitoi has joined #ocaml
TeXitoi_ has joined #ocaml
gildor has joined #ocaml
<gildor>
hi all
<gildor>
i have big problems with undefined symbols when linking against library produced by camlidl
ecraven has joined #ocaml
<ecraven>
hello all
<ecraven>
have people here heard of f-sharp?
<ecraven>
(aka f#)
<Smerdyakov>
Yes. I have to wage a campaign to be able to use it this summer in my MSR internship. ;)
<ecraven>
how does it compare to ocaml? i've been asked to do a bit of work in it..
TeXitoi has quit [Read error: 110 (Connection timed out)]
<Smerdyakov>
I don't know. I haven't even looked at it yet.
<Smerdyakov>
I'm just assuming it's similar enough to be worth using.
<Smerdyakov>
(Compared to C#!)
<ecraven>
hehe, that's a safe bet
derfvc has quit [Read error: 131 (Connection reset by peer)]
ecraven has quit ["bbl"]
ganjalink has joined #ocaml
ganjalink has quit ["Quit rulez !"]
Snark has quit ["Leaving"]
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
vezenchio has joined #ocaml
Herrchen has quit ["good night"]
cjohnson has joined #ocaml
Submarine has quit ["Leaving"]
_JusSx_ has quit ["leaving"]
__DL__ has quit [Remote closed the connection]
vodka-goo has joined #ocaml
TeXitoi_ has quit ["leaving"]
monochrom has joined #ocaml
ianxek has quit ["Leaving"]
cjohnson has quit [""We live like penguins in the desert...""]
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
smimou has quit ["?"]
_shawn has joined #ocaml
bzzbzz has joined #ocaml
shawn_ has quit [Read error: 110 (Connection timed out)]
eviltoylet has joined #ocaml
<eviltoylet>
can anyone tell me if there's a such thing as nested "match __ with __" statements? or anything that is representative of that behavior?
<vodka-goo>
you can do nested match with
<vodka-goo>
but use ( .. ) or begin .. end, or you'll be tricked
<eviltoylet>
use ( ) around the nested match with?
<vodka-goo>
in "match a with B -> match a with A -> .. | C -> ..", the C clause is for the first match
<vodka-goo>
"match a with B -> (match a with A -> .. | C -> ..)" is better
<vodka-goo>
I mean, depending on what you want...
<vodka-goo>
I just say this cause people are sometimes disappointed about that
<vodka-goo>
is it an answer to your question ?
<eviltoylet>
yah, let me try it out!
<vodka-goo>
or did I misunderstand ?
<eviltoylet>
is there an alternative to a nested match?
<vodka-goo>
what do you wanna do ?
<vodka-goo>
maybe you just want complex patterns ? like match l with a::(_,b)::c::_ -> ... ?
<eviltoylet>
hrmm, well i want to match an input, and if its matched, i want to run a function and match what it returns
<vodka-goo>
so you really need nested match
<eviltoylet>
ahh got it.
<eviltoylet>
many thanks vodka
<vodka-goo>
and don't see what a workaround could be..
<eviltoylet>
that's exactly what i want :0
<vodka-goo>
vodka is good for you :D
<eviltoylet>
lol
<eviltoylet>
whats the goo part?
<vodka-goo>
penguin
<vodka-goo>
did you want complex patterns ? if so, I'm lost...
<vodka-goo>
the penguin is good for you too, btw :)
<eviltoylet>
... are you talking to me?
<vodka-goo>
yes
<vodka-goo>
I'm just afraid you believe my "complex pattern" example is the kind of thing you need, cause I don't believe it
<eviltoylet>
oh no, nested is good. i was just wondering if it worked because ocaml was spitting back at me an error.
<vodka-goo>
ok cool
<eviltoylet>
so thats why i was wondering if there was another metho di could try
<Smerdyakov>
eviltoylet, there are no "statements" in OCaml.
<Smerdyakov>
eviltoylet, it is a 'match' _expression_, and you can "nest" it like any other expression, without any special syntax.
<vodka-goo>
everything is the same kind of thing
<vodka-goo>
it's homogeneous
<vodka-goo>
one more good thing here :p
<eviltoylet>
ahh got it
<eviltoylet>
still in the imperative mind state :)
derfvc has joined #ocaml
<Smerdyakov>
It's not any different than "nested switch statements" in C.
cjohnson has joined #ocaml
<monochrom>
I used to fight with people who use "statement" and "command" interchangeably.