NingaLeaf has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
NingaLeaf has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 252 seconds]
Lis has joined #ocaml
jeffmo has quit [Quit: jeffmo]
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
AltGr has joined #ocaml
pacmann has quit [Remote host closed the connection]
igoroliveira has joined #ocaml
jonludlam has quit [Ping timeout: 250 seconds]
swgillespie has joined #ocaml
djellemah_ has joined #ocaml
djellemah has quit [Ping timeout: 240 seconds]
BitPuffin|osx has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jmasseo>
how do you do ci/cd in ocaml?
<jmasseo>
jenkins or do you have special tools?
python476 has quit [Quit: Page closed]
nullcatxxx_ has joined #ocaml
mcmillhj has joined #ocaml
<dmbaturin>
jmasseo: I don't think there are any CI tools specially for ocaml. Jenkins works for anything though.
__uu___ has joined #ocaml
yaewa has joined #ocaml
__uu__ has quit [Ping timeout: 265 seconds]
moei has quit [Ping timeout: 265 seconds]
jeffmo has joined #ocaml
python476 has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
swgillespie has joined #ocaml
yaewa has quit [Quit: Leaving...]
jeffmo has quit [Quit: jeffmo]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Quintasan has quit [Remote host closed the connection]
Quintasan has joined #ocaml
Quintasan has joined #ocaml
ygrek has joined #ocaml
darkf has joined #ocaml
swgillespie has joined #ocaml
struktured has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 260 seconds]
BitPuffin|osx has quit [Ping timeout: 260 seconds]
mac10688 has quit [Ping timeout: 240 seconds]
Guest58 has joined #ocaml
Algebr has joined #ocaml
Algebr has quit [Remote host closed the connection]
tmtwd has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
moei has joined #ocaml
MercurialAlchemi has joined #ocaml
djellemah_ is now known as djellemah
MercurialAlchemi has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
tmtwd has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Ping timeout: 246 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
__uu___ has quit [Read error: Connection timed out]
__uu__ has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
zpe has joined #ocaml
xfighter1188 has joined #ocaml
<xfighter1188>
anybody home
freehck has joined #ocaml
FreeBird_ has joined #ocaml
Lis has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
swgillespie has quit [Client Quit]
rbocquet has joined #ocaml
Haudegen has joined #ocaml
xfighter1188 has quit []
psy_ has joined #ocaml
kushal has joined #ocaml
<Guest58>
um?
toolslive has joined #ocaml
ely-se has joined #ocaml
<adrien>
is there anybody out there?
<def`>
nop
<adrien>
no Pink Floyd? ='(
toolslive has quit [Ping timeout: 252 seconds]
<python476>
always pink floyd
<adrien>
:)
orbifx has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
<MercurialAlchemi>
it's all empty spaces here
psy_ has quit [Ping timeout: 240 seconds]
psy_ has joined #ocaml
shinnya has joined #ocaml
kalzz has quit [Ping timeout: 264 seconds]
<MercurialAlchemi>
looking at react + redux is funny
<MercurialAlchemi>
you have this feeling of watered-down FRP mixed with HTML problems
<MercurialAlchemi>
still beats raw jquery, though
kalzz has joined #ocaml
<MercurialAlchemi>
and JS "pattern-matching" is a switch with strings
<ely-se>
Is :> used a lot in OCaml?
<companion_cube>
not usually
<companion_cube>
although it depends on your style, I guess
<companion_cube>
if you use a lot of objects and subtyping...
<MercurialAlchemi>
also with "private"
<companion_cube>
yep, private aliases are a nice case of subtyping :)
<MercurialAlchemi>
it's awesome
<MercurialAlchemi>
like getting your cake and eating it
<ely-se>
Why is there not a function "upcast" of which the result type is inferred?
* MercurialAlchemi
kicks Javascript in the ribs
mort___ has joined #ocaml
<ely-se>
like let x : t = upcast y;; instead of let x = y :> t;;
Guest58 has quit [Ping timeout: 240 seconds]
<ely-se>
or would that yield inference problems?
<companion_cube>
well, see by yourself :)
<companion_cube>
often , the typechecker emits a warning "this ground coercion is not principal"
kalzz has quit [Ping timeout: 268 seconds]
<ely-se>
lol, what
<ely-se>
I expected a type error for this: let upcast (x : 'a) : 'b = (x :> 'b);;
<ely-se>
but I got: 'b -> 'b
<companion_cube>
it unifies 'a with 'b
Guest58 has joined #ocaml
<ely-se>
can I specify that 'a must be a subtype of 'b?
<ely-se>
like U upcast<T, U>(x: T) where T : U in C#
Kakadu has joined #ocaml
<companion_cube>
oh, a generic upcast? I don't think you can do that
<companion_cube>
or rather, :> is there precisely to do that
<ely-se>
yeah, but :> requires spelling the result type; it can't be inferred
<companion_cube>
in general, yes, subtyping cannot be inferred
<companion_cube>
(in OCaml)
<companion_cube>
what you can do, if you want, is an upcast function for each subtype
<companion_cube>
(not a generic one)
<ely-se>
:(
MercurialAlchemi has quit [Quit: Lost terminal]
kalzz has joined #ocaml
<companion_cube>
otoh they are really quick to write :p
<ely-se>
F# has this funky thing called "inline" which is basically like C++ templates
<ely-se>
the definition of an inline function is not type-checked immediately, but rather at every call-site, after type parameter substitution.
<flux>
so, a macro? sounds like doable with ppx?
<ely-se>
people use it because there's no other way to abstract over types that support arithmetic
MercurialAlchemi has joined #ocaml
<ely-se>
let add x y = x + y in (add 1 2, add 1.0 2.0) // type error
<ely-se>
let inline add x y = x + y in (add 1 2, add 1.0 2.0) // OK
jonludlam has joined #ocaml
<companion_cube>
ppx isn't very well adapted to writing macros
<companion_cube>
it doesn't work between distinct files, for instance
__uu___ has joined #ocaml
<ely-se>
I've always wanted a statically-typed language (properly, not bolt on top of something like mypy or core.typed) with a small implementation that I can use for stuff like build scripts.
__uu__ has quit [Ping timeout: 240 seconds]
<ely-se>
Don't want to have to install GHC for running a build script.
<ely-se>
Coincidentally I've also always wanted to implement H-M type inference. :^)
<MercurialAlchemi>
yeah, but it's not easy to do
<MercurialAlchemi>
the shell is stringly typed
<Guest58>
Nix(OS)?
<MercurialAlchemi>
Guest58: er
<companion_cube>
yeah, I want a typed, clean shell
<python476>
I think es shell was stat. typed
<MercurialAlchemi>
I wouldn't say the nix language would be my dream language for anything, let alone shell scripts
<fds>
Oh, sort of false alarm. I realised what it was.
<fds>
My answer was correct, but it wasn't what they were expecting (min_index with two elements with the same value, my code gave the 'wrong' one)
<companion_cube>
oh, but it's a kind of bug then, if your answer matches the spec ;)
toolslive has joined #ocaml
<fds>
The exercise says: Write a function min_index : int array -> int that returns the index of the minimal element of a.
<fds>
It doesn't sya the first minimal element!
<fds>
(I was walking backwards through the array so I could pass Array.length-1 as the starting index)
<companion_cube>
yes, and the spec is a bit wrong, "the" minimal element isn't well defined in your case
* fds
nods.
<companion_cube>
I mena, checking that your answer is correct should not be `fun x -> x == my_min_function array`
obadz has joined #ocaml
ggole has joined #ocaml
_andre has joined #ocaml
<toolslive>
any statistics on the evolution of opam package acceptance lead time ?
<companion_cube>
lead time?
<toolslive>
the time between submission of the pull request, and the actual merge
<companion_cube>
oh. From my experience it's between 5 minutes and 2 days, in general
<companion_cube>
(sometimes the maintainers are busy)
<toolslive>
yes, I have witnessed 5 minutes as well, but that was a long time ago
libertas has quit [Ping timeout: 250 seconds]
toolslive has quit [Remote host closed the connection]
libertas has joined #ocaml
Guest58 has quit [Ping timeout: 260 seconds]
destrius has quit [Ping timeout: 250 seconds]
destrius has joined #ocaml
<larhat>
Hi, what is best way to build/install ocaml _app_ that uses opam packages? of course one can write makefile and install all deps there, but that doesn't seem right. the desire is to be able to use clean system/env (build server), run `make install`, get all dependencies, required for build, build project, using oasis and produce executable.
toolslive has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
<MercurialAlchemi>
larhat: I'd say the cleanest way would be to have it as an opam package :)
<larhat>
MercurialAlchemi: are there any conventions for app? should one use their own opam repo with pinned versions or it will depend on specific case?
<MercurialAlchemi>
I'd say it depend on your use case
<MercurialAlchemi>
but people who work with large OCaml codebases may be able to give you hints
<MercurialAlchemi>
(I'm not one of them)
<toolslive>
you want to be as flexible as possible (so pin as less as possible), but sometimes you can't avoid it. for example, you use dynlink based plugins and the api needs to have an exact match
<larhat>
toolslive: thanks, will check arakoon for inspiration %)
adrien has quit [Quit: leaving]
adrien has joined #ocaml
<MercurialAlchemi>
the traditionally tricky problem (also known as "the cabal issue") is what the hell do you do with upper bounds
<MercurialAlchemi>
do your dependencies use semver?
<toolslive>
we use semver, and arakoon is on the bottom. it becomes trickier when your application has an arakoon plugin fe.
<MercurialAlchemi>
yeah, but I mean, if one of your dependencies (something innocuous, like, say, lwt) bumps its major version, opam will let users happily install this version of arakoon, even though it's not going to compile
<MercurialAlchemi>
(assuming lwt uses semver, and arakoon is affected by the API change, obviously)
struktured has quit [Ping timeout: 240 seconds]
Guest___ has joined #ocaml
Guest___ has left #ocaml [#ocaml]
Guest___ has joined #ocaml
Guest___ has left #ocaml [#ocaml]
lolisa has joined #ocaml
Guest___ has joined #ocaml
Guest___ has left #ocaml [#ocaml]
prepor has joined #ocaml
<toolslive>
well, lwt doesn't use semver
<toolslive>
and we've been hit by that.
<MercurialAlchemi>
of course if your dependency doesn't use semver, it goes from "hard" to "can't do"
<MercurialAlchemi>
ideally there would be a build server somewhere which would test an opam package against a range of dependencies...
<toolslive>
so you start pinning, and then some time in the future, you have 2 unrelated apps that cannot possibly coexist.
AltGr has left #ocaml [#ocaml]
<toolslive>
the build infrastructure for opam already does something: it checks different compiler versions
<prepor>
Hello. @larhat asked this question for me :) I want to publish my app via binaries, not via opam. So I don't have any problems with strict dependencies. Basically my question is how to embed version number (with git commit) to opam-manifest and to my binaries.
<prepor>
Ok I think it easier to publish app without push it to opam, only by binaries
<prepor>
And anyone who wants to use it with opam can just pin it. Alright? :)
Guest58 has joined #ocaml
<toolslive>
we embed the commit hash into the binary
<toolslive>
and the specific versions of the dependencies that were used at compile time. so basically, you force ocamlbuild to genereate an ml file containing the information
iZsh has quit [Ping timeout: 240 seconds]
stephe has quit [Ping timeout: 240 seconds]
<toolslive>
the reason is clear: we don't trust ops to provide us the correct version info in a bug report.
eagleflo has quit [Ping timeout: 240 seconds]
eagleflo has joined #ocaml
stephe has joined #ocaml
fold1 has quit [Ping timeout: 240 seconds]
jeffmo has joined #ocaml
rgrinberg has joined #ocaml
iZsh has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
libertas has quit [Ping timeout: 240 seconds]
BitPuffin has joined #ocaml
<MercurialAlchemi>
toolslive: sounds like a job for nixos :)
<toolslive>
yes, you would like nix as a package manager; unfortunately, your users always seem to prefer something like CentOS
<MercurialAlchemi>
(to be fair, and typing this from a nixos box, I wouldn't say nixos really mature yet...)
<MercurialAlchemi>
(but there is a great OS hiding in there, maybe it will see the light of the day at some point)
BitPuffin has quit [Ping timeout: 255 seconds]
mort___1 has joined #ocaml
mort___ has quit [Ping timeout: 246 seconds]
mort___1 has quit [Ping timeout: 244 seconds]
freehck has quit [Remote host closed the connection]
freehck has joined #ocaml
stomp has quit [Ping timeout: 240 seconds]
_2can has quit [Ping timeout: 240 seconds]
stomp has joined #ocaml
_2can has joined #ocaml
BitPuffin has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
toolslive has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
Korhonen has quit [Changing host]
Korhonen has joined #ocaml
Korhonen has left #ocaml ["Men are my passion"]
mort___ has joined #ocaml
toolslive has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
libertas has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
fold1 has joined #ocaml
ncthom91 has joined #ocaml
octachron has joined #ocaml
englishm_ has joined #ocaml
tmtwd has joined #ocaml
englishm_ has quit [Client Quit]
ely-se has quit [Quit: leaving]
toolslive has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
toolslive has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 255 seconds]
AlexRussia has joined #ocaml
kdas_ has quit [Quit: Leaving]
freehck has quit [Quit: BB everybody. C u later at home! Holiday's tomorrow! Hooray! :)]
<charpi`>
I am a beginner in ocaml and this book helped me. After it is just matter to practise and read some code.
<charpi`>
I have a background in FP, so it helps a lot
<sgeisenh>
__uu___: check out #ocamlmooc
toolslive has quit [Ping timeout: 252 seconds]
sepp2k has joined #ocaml
zpe has quit [Remote host closed the connection]
cross has joined #ocaml
toolslive has joined #ocaml
slash^ has joined #ocaml
darkf has quit [Quit: Leaving]
igoroliveira has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
<jmasseo>
i'm also doing the course albiet slowly
yomimono has joined #ocaml
nullcatxxx_ has joined #ocaml
jeffmo has quit [Quit: jeffmo]
Denommus has joined #ocaml
ygrek has joined #ocaml
pacmann has joined #ocaml
pacmann has quit [Remote host closed the connection]
pacmann has joined #ocaml
orbifx has quit [Quit: WeeChat 1.3]
Haudegen has quit [Ping timeout: 264 seconds]
tane has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
octachron has quit [Quit: Leaving]
Haudegen has joined #ocaml
<fds>
jmasseo: Didn't the course say an estimated 2 hours of work per week? I think they underestimated that!
MercurialAlchemi has joined #ocaml
jeffmo has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
Guest58 has quit [Ping timeout: 250 seconds]
nullcatxxx_ has joined #ocaml
<dmbaturin>
fds: Course workload estimate are always very rough. :)
kushal has quit [Quit: Leaving]
* fds
nods.
lolisa has quit [Quit: meow]
^elyse^ has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
kushal has joined #ocaml
<bernardofpc>
gasche_: cc forgot to paste this on the reddit, so I guess I can do it here: http://pastebin.com/tnEcrxpd -> utop started on a "small" terminal ($COLUMNS) produces this kind of output for the result. The input is not mangled (as far as I have tested, even if I sometimes have bad moments with copy-paste larger than $LINES) but the toplevel response is wrongly spaced
jonludlam has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
yomimono has quit [Ping timeout: 250 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
<python476>
__uu___: just in case, a few people gathered at #ocamlmooc
<python476>
I agree that the slides and videos are short and lack a lot of context
<python476>
they should address that in future revisions..
<python476>
brb
nullcatxxx_ has joined #ocaml
ggole has quit [Ping timeout: 260 seconds]
Algebr has joined #ocaml
Algebr has left #ocaml [#ocaml]
python476 has quit [Quit: Page closed]
swgillespie has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
kdas_ has joined #ocaml
jonludlam has joined #ocaml
kushal has quit [Ping timeout: 244 seconds]
nullcatxxx_ has joined #ocaml
python476 has joined #ocaml
Kakadu has quit [Quit: Page closed]
BitPuffin has quit [Ping timeout: 246 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_andre has quit [Quit: leaving]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
toolslive has quit [Ping timeout: 252 seconds]
toolslive has joined #ocaml
Guest58 has joined #ocaml
charpi`` has joined #ocaml
charpi` has quit [Ping timeout: 240 seconds]
hugomg has joined #ocaml
prepor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toolslive has quit [Ping timeout: 252 seconds]
mort___ has joined #ocaml
kdas_ has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Ping timeout: 255 seconds]
prepor has joined #ocaml
Guest58 has quit [Ping timeout: 250 seconds]
Kakadu has joined #ocaml
pacmann has quit [Remote host closed the connection]
jgjl has joined #ocaml
toolslive has joined #ocaml
ollehar has joined #ocaml
<j0sh>
can gadts be used in pattern guards?
larhat1 has joined #ocaml
<ollehar>
ach, no I get link errors with llvm instead.
<ollehar>
*now
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
prepor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
<ollehar>
j0sh: don't know, try?
<companion_cube>
j0sh: how do you mean?
<ollehar>
any tips for this?
<ollehar>
/home/olle/.opam/4.02.1/lib/llvm/./libllvm_bitwriter.a(bitwriter_ocaml.o): In function `llvm_write_bitcode_to_memory_buffer':
<ollehar>
bitwriter_ocaml.c:(.text+0x61): undefined reference to `LLVMWriteBitcodeToMemoryBuffer'
yomimono has joined #ocaml
<j0sh>
ollehar: i am trying, can't seem to get the syntax right (if its possible at all)
<ollehar>
j0sh: did you check the manual for gadt?
<ollehar>
otherwise, post pastebin and let people correct it.
<j0sh>
companion_cube: typically you can use a gadt to constrain the top level of a let, but can they also be used to constrain specific branches in a pattern match, like a guard?
prepor has joined #ocaml
<j0sh>
ollehar: yeah, making a reduced example
<companion_cube>
but a guard is only a boolean expression
<j0sh>
companion_cube: yeah i guess, a 'guard like' match is more of what i'm looking for
<companion_cube>
no, y ou must write Int instead of y
<companion_cube>
and you don;'t deal with int64, do you?
<j0sh>
companion_cube: doh, you're right, can deconstruct Y right there
<j0sh>
(also thanks for containers... i'm loving the linq functions)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<companion_cube>
wow, really?
<companion_cube>
I'm surprised someone else uses this! Are you using 0.13?
<j0sh>
companion_cube: yeah, not sure what version... whatever was in opam as of a few months ago?
<j0sh>
yes, 0.13
<companion_cube>
heh, last release was 6 weeks a go
<companion_cube>
ago*
taigi100 has joined #ocaml
<taigi100>
hey
<companion_cube>
ok, because CCLinq changed in 0.13 :)
sepp2k has quit [Quit: Leaving.]
<j0sh>
i've been working on a SQL-like DSL and i'm trying to decide whether to emit actual SQL or just do all the munging in CCLinq :)
<j0sh>
i am using it as-is for other reporting features also, which has been very nice. works out-of-the-box with js_of_ocaml
<companion_cube>
nice to hear confirmation of that — I took care of keeping containers 100% Ocaml
<companion_cube>
OCaml*
<companion_cube>
making CCLinq emit SQL would be non-trivial, but very interesting (and closer to the initial LINQ)
<j0sh>
well i was thinking more of using CCLinq instead of actually executing SQL queries (allows me to offload some of the work to the client, thanks to js_of_ocaml)
<companion_cube>
oh ok
<companion_cube>
that's indeed easier
<j0sh>
but then i'd lose some advantages in eg, query optimizations. and *some* stuff has to be in SQL to constrain the result set that's returned to the client,anyway
rgrinberg has joined #ocaml
<companion_cube>
o/ rgrinberg
nullcatxxx_ has joined #ocaml
tane has quit [Quit: Verlassend]
slash^ has quit [Read error: Connection reset by peer]
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hugomg has quit [Ping timeout: 244 seconds]
tibor_ has joined #ocaml
<tibor_>
Hi
nchambers has joined #ocaml
<tibor_>
I have the following problem: I have a function x with two parameter the first it is of data type and the second is a function. This function has also two parameters "z" and "h". How can I specify the type of x? let x (a: data) (b : z -> h -> ret_type) : ret_type2 = impl in let f (z: data) (h:data) -> data in x a f
taigi100 has quit [Ping timeout: 246 seconds]
<companion_cube>
you have specified the type of x already
yomimono has quit [Quit: Leaving]
<companion_cube>
let x (a:data) (b:...) : ret_type2 = .... defines x and specifies its type
<companion_cube>
if you want to expose the tpe of x (say, in a .mli file): val x : data -> (z -> h -> ret_type) -> ret_type2
<tibor_>
thank you :)
<tibor_>
but I have the following error: This expression has type data-> ('a->'b->'c) but an expression was expected of type data-> ('a->'b->'c) -> 'd -> 'e
<tibor_>
Why?
<sgeisenh>
tibor_: you have a syntax error in the snippet you included
<sgeisenh>
tibor_: it would be hard to diagnose your type error without seeing a snippet that parses
<tibor_>
I'm sorry
<tibor_>
let x (a: data) (b : z -> h -> ret_type) : ret_type2 = (*some implementation*) in let f (z: data) (h:data) : data = (*some implementation*) in x a f
<companion_cube>
ok, then x is only a local function
<tibor_>
yes
<companion_cube>
btw, you c annot write such an expression at toplevel
<sgeisenh>
assuming a has type data, f has type data -> data -> data so x a f doesn't typecheck
<sgeisenh>
"x a" would expect an argument of type "z -> h -> ret_type"
<mrvn>
and FYI you don't have to annotate the types.-
Haudegen has quit [Ping timeout: 240 seconds]
<tibor_>
Yes this is the problem, because I would like to have as last parameter a function
<companion_cube>
that's what you already do, except f arguments have the wrong type
<tibor_>
Why f is not correct?
<companion_cube>
because you give it two 'data' when it needs z and h
<companion_cube>
and it should return ret_type
<sgeisenh>
if the end of your code snippet was annotated as "f (z : z) (h : h) : ret_type = (* some_implementation *) in x a f" then it might typecheck
Denommus has quit [Read error: Connection reset by peer]
jonludlam has quit [Ping timeout: 240 seconds]
<tibor_>
let x (a: data) (b : (data -> data -> data) option) : ret_type2 = (*some implementation*) in let f (z: data) (h:data) : data = (*some implementation*) in x a (Some f)
<tibor_>
is correct?
<sgeisenh>
yes, everything looks fine there
<sgeisenh>
assuming that you have a variable a with type data
<tibor_>
yes I have
<sgeisenh>
its typically considered bad style to shadow names like that because it makes the code confusing to read
<tibor_>
I have the following error: This expression has type data-> ('a->'b->'c) but an expression was expected of type data-> ('a->'b->'c) -> 'd -> 'e
<sgeisenh>
without more information, there isn't much we can do
<tibor_>
I know, but I have a huge amount of code and this is the only solution to ask my questions
<sgeisenh>
you can post a larger snippet on something like pastebin
<sgeisenh>
well, im not sure that i can give you a correct solution
<sgeisenh>
but i can fix the type error
<sgeisenh>
if you change the end of your "let func1 ..." to "(replace_vars: ('a-> 'b -> 'c) option) (_) : (list_failesc_context * proof)"
<sgeisenh>
it will typecheck
hugomg has joined #ocaml
<sgeisenh>
the compiler was expecting one more argument
Haudegen has quit [Ping timeout: 255 seconds]
ncthom91 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 265 seconds]
<sgeisenh>
does that make sense?
<tibor_>
thank you very much sgeisenh :)
<tibor_>
Yes
<sgeisenh>
no problem
<tibor_>
You have saved my life (a lot of time) now
ril has joined #ocaml
Haudegen has joined #ocaml
lobo has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sgeisenh>
automated theorem proving for a school assignment?
<companion_cube>
waat
welterde has quit [Quit: WeeChat 0.4.3]
jackweirdy has joined #ocaml
<jackweirdy>
Hey folks, I just updated to the latest xcode and now everything is on fire :/
Denommus has joined #ocaml
<jackweirdy>
From a pretty standard ocamlbuild call, I get this error:
<jackweirdy>
ld: building for iOS simulator, but linking in object file built for OSX, file '/Users/jack/.opam/4.02.3/lib/ocaml/std_exit.o' for architecture x86_64
<jackweirdy>
Then I tried updating my opam packages, but then the compilation of the newest ocamlfind failed with the same error, and now I can't compile anything at all
<jackweirdy>
Judging by here: http://karp.id.au/post/xcode_7_linker_rules/ It looks like BSD ld changed how it inferred architecture for build. Has anyone else been bitten by this?
<companion_cube>
maybe you can try to opam sw reinstall 4.02.3
<companion_cube>
(recompile the compiler)
<jackweirdy>
Crikey, we're through the looking glass now! I'll give that a spin, thanks
<jackweirdy>
Trying other commands, I keep getting the error "[ERROR] No global config file found for switch 4.02.3. Switch broken ?"
<companion_cube>
yeah, the switch failed to reinstall
<companion_cube>
so, updating xcode must have replaced a lot of libraries, but ocaml failing to build like that is... bad
j14159 has left #ocaml [#ocaml]
<jackweirdy>
I burned it from space, removed ~/.opam and the setup line in my bash_profile, now reinstalling
nullcatxxx_ has joined #ocaml
<jackweirdy>
Wow, even opam reinstallation crashes
<companion_cube>
I suppose even a very simple ocaml program fails to compile or link?
<jackweirdy>
Yeah, everything's b0rked
<jackweirdy>
Reinstalling opam from scratch I get:
<jackweirdy>
Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ./libunix.a(socketaddr.o) has no symbols
<jackweirdy>
I'll try installing through brew :)
<companion_cube>
have you tried rebooting, just in case?