Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
malc_ has quit [Quit: leaving]
MrScout has quit [Remote host closed the connection]
sailorswift has joined #ocaml
jeffmo has quit [Quit: jeffmo]
larhat1 has joined #ocaml
jeffmo has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
larhat1 has quit [Quit: Leaving.]
jeffmo has quit [Quit: jeffmo]
claudiuc has quit [Remote host closed the connection]
sgnb`` has joined #ocaml
sgnb` has quit [Ping timeout: 244 seconds]
ygrek has quit [Ping timeout: 246 seconds]
tmtwd has joined #ocaml
darkf has joined #ocaml
samrat has joined #ocaml
low-profile has quit [Ping timeout: 246 seconds]
vishesh has quit [Ping timeout: 250 seconds]
low-profile has joined #ocaml
vishesh has joined #ocaml
tmtwd has quit [Remote host closed the connection]
Algebr has quit [Remote host closed the connection]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
psy_ has quit [Ping timeout: 272 seconds]
jeffmo has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
MercurialAlchemi has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
low-profile has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
psy_ has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
samrat has quit [Ping timeout: 264 seconds]
low-profile has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
contempt has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 255 seconds]
contempt has joined #ocaml
sigjuice has quit [Ping timeout: 246 seconds]
psy_ has quit [Read error: Connection reset by peer]
sigjuice has joined #ocaml
keen________ has joined #ocaml
keen_______ has quit [Ping timeout: 244 seconds]
Norelec has joined #ocaml
xificurC has joined #ocaml
ivali has joined #ocaml
ivali has quit [Ping timeout: 244 seconds]
ggole has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
AlexRussia_ has joined #ocaml
psy_ has joined #ocaml
izaak has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
<flux>
well, the deprecation mechanism was only introduced quite lately
<flux>
perhaps it will work in the future.
<flux>
ie. Array.create
<ggole>
Why did they deprecate it -_-
Haudegen has joined #ocaml
<def`>
ggole: the convention is
<def`>
- creation function taking a default element are named "make"
<def`>
- creation function taking a initialisation function are named "init"
* ggole
looks at Hashtbl.create, Queue.create
<def`>
:DDD
<def`>
I just repeat what I have heard, I don't say its consistent (after all, that's the standard lib)
<ggole>
Stack.create! Everything mutable is called create!
<ggole>
Yeah, fair enough. I do find it irritating though.
<def`>
you don't have too look too far (other modules), … Array.make_float
BitPuffin|osx has quit [Ping timeout: 252 seconds]
psy_ has quit [Ping timeout: 244 seconds]
<ggole>
Buffer.create, Weak.create
<ggole>
But not Array.create -_-
<ggole>
JUST PICK ONE
<def`>
:')
Norelec has left #ocaml ["Leaving"]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
izaak has quit [Quit: izaak]
izaak has joined #ocaml
izaak has quit [Client Quit]
sh0t has joined #ocaml
<flux>
indeed, someone might say it would be reasonable to first make the rest of the interface uniform and only then deprecate the old..
<flux>
but I bet someone somewhere was just itching to make use of the new decrecated-feature ;-)
paradoja has joined #ocaml
creichert has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
oscar_toro has quit [Quit: Lost terminal]
sailorswift has joined #ocaml
slicefd has joined #ocaml
ely-se has joined #ocaml
kolko has joined #ocaml
sh0t has quit [Ping timeout: 264 seconds]
ely-se has quit [Quit: leaving]
grouzen has quit [Ping timeout: 246 seconds]
grouzen has joined #ocaml
paradoja has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
paradoja has joined #ocaml
ollehar1 has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
ollehar1 has quit [Ping timeout: 255 seconds]
kakadu has joined #ocaml
ollehar has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
paradoja has quit [Remote host closed the connection]
<gpietro>
ggole, I am trying to read your file on github...i have problems with the syntax I think:
<gpietro>
type 'a arith = AInt : int arith | AFloat : float arith what does this exactly declare?
troydm has quit [Ping timeout: 264 seconds]
<gpietro>
it's not clear the annotation after : , why do I need 'a if I don't use it?
dsheets has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
<kakadu>
it seems it is called GADTs
Haudegen has joined #ocaml
izaak has joined #ocaml
pootler has quit [Ping timeout: 246 seconds]
msch has quit [Ping timeout: 246 seconds]
msch has joined #ocaml
pootler has joined #ocaml
<gpietro>
yeah Kakadu it's what I am trying to learn
<gpietro>
now i understand what I asked before :)
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
izaak has quit [Quit: izaak]
martintrojer has quit [Ping timeout: 240 seconds]
martintrojer has joined #ocaml
<flux>
gpietro, you don't need 'a if you don't use it, you can replace it with _
<gpietro>
yeah flux :) thanks
<gpietro>
I am tryin to write a pretty print for data of type _ arith, something like: let pprintA a = match a with | AInt -> printf "AInt" | AFloat -> printf "AFloat"
<gpietro>
but i get an error
<gpietro>
is there something obious i am not getting?
<flux>
gpietro, you need to make that function explicitly polymorphic re. the gadt argument
<flux>
let pprintA : type a. a arith -> unit = fun a -> match a with | AInt -> printf "AInt" | AFloat -> printf "AFloat"
<flux>
another kind of implementation where you actually make use of the gadt:
<flux>
let add : type a. a arith -> a -> a -> a = fun a -> match a with | AInt -> (+) | AFloat -> (+.)
martintrojer has quit [Ping timeout: 255 seconds]
<gpietro>
mmm I guess I am having problems already with the syntax...
<gpietro>
are u giving ocaml type annotations to ease the whole pocess?
ollehar has quit [Ping timeout: 245 seconds]
<flux>
the polymorphism of gadts cannot be inferred, so it needs to be annotated
<gpietro>
oh ok.
<gpietro>
flux is there some tutorial you would suggest on these things? Not the standard ocaml guide cause i read it already...
<flux>
though perhaps the other links are useful as well, I haven't read them
martintrojer has joined #ocaml
tane has joined #ocaml
AltGr has left #ocaml [#ocaml]
ollehar has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
psy_ has joined #ocaml
grouzen has quit [Ping timeout: 246 seconds]
troydm has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
ely-se has joined #ocaml
ely-se has quit [Client Quit]
_andre has joined #ocaml
psy_ has quit [Read error: No route to host]
psy_ has joined #ocaml
AlexRussia_ has quit [Ping timeout: 252 seconds]
slicefd has quit [Quit: Leaving]
tmtwd has joined #ocaml
ollehar has joined #ocaml
BitPuffin has joined #ocaml
yomimono has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
nullcatxxx_ has joined #ocaml
martintrojer has quit [Ping timeout: 250 seconds]
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
larhat has quit [Quit: Leaving.]
martintrojer has joined #ocaml
zpe_ has quit [Ping timeout: 245 seconds]
larhat has joined #ocaml
martintrojer has quit [Ping timeout: 260 seconds]
larhat has quit [Client Quit]
martintrojer has joined #ocaml
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
<gpietro>
is it possible to have in a mly file
<gpietro>
an polymorphic starting point of the grammar?
<gpietro>
/usr/bin/ocamlyacc: e - the start symbol 'stmts' has a polymorphic type
sepp2k has joined #ocaml
larhat has joined #ocaml
<gpietro>
can't i something like: %type <'a Ast.expr> stmts in a .mly file?
<gpietro>
because if I fix 'a to int or to something else then the whole point is missed i think
nullcatx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux>
my guess is 'no', as the documentation never mentions the word polymorphic
<flux>
and neither does the menhir documentation
<flux>
so you're out of luck.
nullcatxxx_ has joined #ocaml
<flux>
maybe some dynamic typing approach would help here.
<ggole>
You'll probably need an existential wrapper there
<ggole>
type any_expr = Expr : 'a expr -> any_expr
<ggole>
(For reasons beyond just .mly having trouble with polymorphism.)
igoroliveira has joined #ocaml
<gpietro>
mmm
<gpietro>
ggole, should i write that in the .ml;y?
<ggole>
Where you defined your expression type
<ggole>
Since you're likely to need it elsewhere
<gpietro>
oh
<gpietro>
sorry ggole can you please explain why would I need that?
<ggole>
You need some way to say "this expression has a type, but I don't know what it is"
<flux>
but he does know the type as I understand it..
<flux>
I'm not sure how one would create 'a typed parsers though
<flux>
you need to pass in some constructor functions or other parameters, right?
<ggole>
If you are parsing arbitrary expressions from a file/string/whatever, you don't know what their type is
<ggole>
So what type would you give the parsing function?
<gpietro>
well i am probably being very naive...but if i lex the INT token then i want it to be an int expression...
<gpietro>
if i parse the FLOAT token than i want it to be a float expression
<gpietro>
if i have 0 + 0 then since the first 0 is an int the whole expression should be as well
<gpietro>
0 + 0.0 shouldn-t parse...
<ggole>
Well, you won't be able to construct such a tree: with GADTs the type system will force you to be type correct
<ggole>
The question is how to type the parse function
<ggole>
What you can't do is state the type in terms of the type of the source, like this: val parse : 'a source -> 'a expr
<ggole>
Because source files are dumb untyped data
<gpietro>
but then how do people do these kind of things?
<gpietro>
if i give you:
<ggole>
You might think "well, how about source -> 'a expr", but that isn't right: it would allow the caller of the parser to decide the type at which to use the expression
<ggole>
This is why you need an existential wrapper
<gpietro>
mm
<ggole>
(This is all part of the fun of programming with GADTs.)
<flux>
soo, how do you get the value out of such a type?
<ggole>
You write a function that is polymorphic in the type variable
<ggole>
eg, eval
<ggole>
(If you want to pull out a specific type you can do that, of course partially.)
<flux>
so how does an eval function for type t = A: 'a -> t look like?
<ggole>
let rec eval : type a . a expr -> a = ...
<flux>
hmm, but that should mention the type any_expr?
<_obad_>
<_obad_>
<ggole>
Well, you would use eval after unwrapping the any_expr
<adrien>
it depends on a server that isn't started?
zpe has joined #ocaml
<MercurialAlchemi>
or firewalled, maybe
noze has joined #ocaml
<noze>
so, does ocamlbuild's -j actually do anything?
<Unhammer>
I don't even use persistence that I know of
<adrien>
noze: yes! but ocamlbuild has troubles finding out what can be built in parallel
<noze>
adrien: can i help?
<Unhammer>
waat
<Unhammer>
ok that was ugly; I had to rm /usr/local/var/data/myproject/ocsipersist/socket
<Unhammer>
(noticed it was trying that one from passing -V to ocsigenserver.opt)
martintrojer has quit [Read error: Connection reset by peer]
<adrien>
noze: it's an issue which comes from its design unfortunatelyu
martintrojer has joined #ocaml
<noze>
or lack thereof :]
<noze>
thanks for the info adrien
moei has quit [Quit: Leaving...]
<Drup>
there is clearly a design in ocamlbuild
<Drup>
the quality and merit of this design can be questioned, but there is clearly one.
<Algebr>
Can I expect compare to work exactly the same for aliased types? ie type thing = string
<Drup>
compare works on the runtime reprsentation, so, yes
BitPuffin has quit [Ping timeout: 245 seconds]
<Algebr>
also true for =, correct?
<Drup>
yes
tmtwd has joined #ocaml
AlexRussia_ has quit [Read error: Connection reset by peer]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest38 has joined #ocaml
Guest38 has quit [Client Quit]
<MercurialAlchemi>
ccube's gen is really pure goodness
Guest38 has joined #ocaml
NingaLeaf has joined #ocaml
lordkryss has joined #ocaml
<MercurialAlchemi>
you can transform to your heart's content without worries
<MercurialAlchemi>
of course, you can also transform your way to write-only code this way...
<Drup>
MercurialAlchemi: as cherry on the cake, it's going to benefit really well from flambda
<MercurialAlchemi>
cool
<MercurialAlchemi>
still working on this game, but I gave on the idea of open records
<MercurialAlchemi>
I stay with my "column store" made of maps
<^elyse^>
OCaml is nice.
<^elyse^>
I should reuse it.
<MercurialAlchemi>
s/gave/gave up/
kakadu has joined #ocaml
mahem1 has left #ocaml [#ocaml]
* MercurialAlchemi
looks at the api of cmdliner with dismay
noze has quit [Ping timeout: 264 seconds]
creichert has joined #ocaml
mea-culp` has joined #ocaml
mea-culpa has quit [Ping timeout: 246 seconds]
<adrien>
:D
<MercurialAlchemi>
ok, it's really flexible, but uuuugh
<Drup>
but, but, applicative functors !
slash^ has quit [Read error: Connection reset by peer]
zpe has quit [Remote host closed the connection]
<ggole>
You mean, it's really flexible *therefore* uuuugh?
<MercurialAlchemi>
well, let's put it that way
<MercurialAlchemi>
it's a good way to make sure you don't have too many newbies around
<MercurialAlchemi>
I'm sure the errors from the compiler are really helpful, too
sh0t has joined #ocaml
izaak has quit [Quit: izaak]
<MercurialAlchemi>
it makes me think of a comic I'd do if I could draw comics
<MercurialAlchemi>
it would go like that
<MercurialAlchemi>
"Perl: it doesn't work but you don't understand why"
<MercurialAlchemi>
"Haskell: it works but you don't understand why"
<MercurialAlchemi>
(and when it doesn't work, god help you)
<Drup>
Perl: It runs, it doesn't work and I don't understand why
<Drup>
Haskell: It doesn't even compile, and I don't understand why
<Drup>
fixed that :]
<MercurialAlchemi>
:)
<MercurialAlchemi>
you also have: Haskell: it works, but only in the future due to laziness
<MercurialAlchemi>
OCaml: it works, but only on one core
izaak has joined #ocaml
obadz has joined #ocaml
samrat has quit [Ping timeout: 260 seconds]
<octachron>
or "Haskell: it works, you don't understand why. There is a memory leak, you really don't understand why"
<MercurialAlchemi>
Haskell: it works, but you can't refactor it
<tane>
refactoring is just not necessary. it all works out of the box :)
Muzer has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 245 seconds]
<Drup>
MercurialAlchemi: refactoring is not a big deal in haskell most of the time
<MercurialAlchemi>
depends how you've setup your monad stack and if you wrote enough boilerplate that removing or adding a layer won't result in a nuclear explosion
Muzer has joined #ocaml
Haudegen has joined #ocaml
shinnya has joined #ocaml
Muzer has quit [Excess Flood]
Muzer has joined #ocaml
zpe has joined #ocaml
BitPuffin|osx has joined #ocaml
obadz has quit [Remote host closed the connection]
Muzer has quit [Excess Flood]
_andre has quit [Quit: leaving]
Muzer has joined #ocaml
tmtwd has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
Muzer has quit [Excess Flood]
Muzer has joined #ocaml
grouzen has quit [Ping timeout: 265 seconds]
Simn has quit [Quit: Leaving]
ggole has quit []
Muzer has quit [Excess Flood]
greves has quit [Ping timeout: 260 seconds]
awkwardusername2 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
Muzer has joined #ocaml
xificurC has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 255 seconds]
MrScout has quit [Ping timeout: 246 seconds]
MrScout has joined #ocaml
zpe has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
^elyse^ has quit [Quit: Leaving...]
sepp2k has quit [Quit: Leaving.]
ygrek has joined #ocaml
claudiuc has joined #ocaml
claudiuc has quit [Read error: Connection reset by peer]
octachron has quit [Quit: Leaving]
claudiuc has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
w0rp has quit [Ping timeout: 250 seconds]
w0rp has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
mea-culp` has quit [Remote host closed the connection]
jeffmo has quit [Ping timeout: 246 seconds]
contempt has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
kakadu has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 244 seconds]
SHODAN has quit [Read error: Connection reset by peer]
SHODAN has joined #ocaml
rgrinberg has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
tmtwd has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
<Algebr>
say you have type a = {mutable name: string} type b = {name : string}. Can one be used for another? Like in module signatures like ```with a := b```
<Drup>
No.
<rgrinberg>
Drup: do you have ppx_import installed?
<Drup>
worst case, it's one opam install away
<Drup>
why ?
<Drup>
(hi, how were the holidays ? :p)
<rgrinberg>
mind trying to load it with merlin for me?