adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
cloudyhug has joined #ocaml
cloudyhug has left #ocaml [#ocaml]
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 240 seconds]
recj has joined #ocaml
recj has quit [Ping timeout: 250 seconds]
recj has joined #ocaml
iovec has quit []
Haudegen has quit [Remote host closed the connection]
metreo has joined #ocaml
metreo has left #ocaml [#ocaml]
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 250 seconds]
mfp has quit [Ping timeout: 244 seconds]
nopf has quit [Quit: leaving]
recj has quit [Ping timeout: 250 seconds]
Ankhers has quit [Quit: ZNC 1.6.6 - http://znc.in]
Ankhers has joined #ocaml
Jeanne-Kamikaze has joined #ocaml
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 272 seconds]
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 246 seconds]
nullifidian__ has joined #ocaml
nullifidian_ has quit [Ping timeout: 246 seconds]
recj has joined #ocaml
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 268 seconds]
KeyJoo has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Jeanne-Kamikaze has quit [Ping timeout: 250 seconds]
recj has quit [Ping timeout: 250 seconds]
pierpal has quit [Ping timeout: 250 seconds]
recj has joined #ocaml
recj has quit [Ping timeout: 268 seconds]
pierpal has joined #ocaml
ggole has joined #ocaml
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 250 seconds]
pierpal has quit [Ping timeout: 272 seconds]
recj has joined #ocaml
pierpal has joined #ocaml
zv has quit [Ping timeout: 250 seconds]
kakadu has joined #ocaml
KeyJoo has quit [Ping timeout: 245 seconds]
_whitelogger has joined #ocaml
Guest79899 has joined #ocaml
pierpal has quit [Remote host closed the connection]
tennix has joined #ocaml
tennix has quit [Client Quit]
initiumdoeslinux has joined #ocaml
pierpal has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 272 seconds]
pierpal has quit [Ping timeout: 272 seconds]
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
jnavila has joined #ocaml
mfp has joined #ocaml
pierpal has joined #ocaml
fraxamo has joined #ocaml
Guest79899 has quit [Read error: Connection reset by peer]
jao has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 250 seconds]
pierpal has quit [Ping timeout: 250 seconds]
[rg] has joined #ocaml
<[rg]> hello
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 244 seconds]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 244 seconds]
pierpal has joined #ocaml
jao has quit [Remote host closed the connection]
Haudegen has joined #ocaml
initiumdoeslinux has joined #ocaml
jao has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
KeyJoo has joined #ocaml
Armael has quit [Read error: Connection reset by peer]
Armael has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
[rg] has quit [Ping timeout: 250 seconds]
initiumdoeslinux has joined #ocaml
sonologico has quit [Ping timeout: 246 seconds]
initiumdoeslinux has quit [Ping timeout: 246 seconds]
steenuil has quit [Remote host closed the connection]
<dmbaturin> quarters: Swift is an AlmostML. :)
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<madroach> Any ctypes guru here? Is there a reason why the fields type is kept abstract in Cstubs.Types.TYPE ? This prevents me from defining views on structs in the Cstubs.Types.BINDINGS functor.
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
iovec has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
ggole has quit [Ping timeout: 252 seconds]
jnavila has joined #ocaml
gravicappa has joined #ocaml
ggole has joined #ocaml
KeyJoo has quit [Quit: KeyJoo]
mfp has quit [Ping timeout: 250 seconds]
jnavila has quit [Ping timeout: 246 seconds]
iovec has quit []
marvin2 has quit [Ping timeout: 250 seconds]
jnavila has joined #ocaml
jao has joined #ocaml
mfp has joined #ocaml
marvin2 has joined #ocaml
adh` has joined #ocaml
adh` has left #ocaml [#ocaml]
adh`` has joined #ocaml
<adh``> Hi, does anyone know when during compilation do type variables get designated as weakly polymorphic? There doesn't seem to be anything indicating this in the typedtree. I'm trying to write a transformation for automatic eta-reduction, but I need to be able to avoid turning a polymorphic function into a weakly polymorphic one.
gravicappa has quit [Ping timeout: 250 seconds]
aristos has joined #ocaml
<ggole> Type variables are weakly polymorphic when they're created, it's generalisation that makes them polymorphic
Jeanne-Kamikaze has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
<adh``> Given a type variable, how could I tell if it's weakly polymorphic?
<adh``> I know it involves comparing the level field to something, but that's as much as I can figure out.
<ggole> iirc when a variable is polymorphic it's level is some large constant
<ggole> Is this transformation intended as an optimisation?
<adh``> No, it's for teaching purposes
<octachron> adh``, after typing a type variable is generic only if its level is equal to Btype.generic_level
<ggole> I'm not sure that looking at levels like that is the right way to justify a syntactic transformation, though
<ggole> It seems as if you should be testing if the term is a syntactic value or not, since that is what determines whether or not a let-binding is polymorphic
<ggole> Assuming I've correctly understood what is going on
<octachron> the value restriction is also relaxed for covariant-only type parameters
<ggole> Oh right, I always forget about that.
<adh``> I don't have a great understanding of the relaxed value restriction, so I thought looking at types would be the simplest way to implement it
<adh``> (The intention is to suggest other ways of writing an expression for learning purposes, because students will often write, e.g., fun x y -> x + y; but not to suggest transformations that aren't actually equivalent.)
<adh``> octachron: thank you! I have an initial version working now.
ggole has quit [Quit: ggole]
fraxamo has quit [Quit: Leaving]
Jeanne-Kamikaze has quit [Ping timeout: 246 seconds]
kakadu has left #ocaml ["Konversation terminated!"]
Haudegen has joined #ocaml
adh`` has quit []
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 250 seconds]
mengu has joined #ocaml
pierpal has joined #ocaml
aristos has quit [Quit: Leaving]
pierpal has quit [Ping timeout: 240 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
pierpal has joined #ocaml
mengu has quit [Remote host closed the connection]
initiumdoeslinux has joined #ocaml
initiumdoeslinux has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 250 seconds]
kroot_ has quit [Quit: kroot_]
kroot_ has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
<quarters> hello. I was wondering hwo to extract and define a list into two parts without using pattern matching. for example, with pattern matching, I'd define the first element of ls and the rest as follows: let foo ls = match ls with x::rest -> ...
<lyxia> why do you not want to use pattern-matching, what does it even mean to do it without pattern-matching
<quarters> lyxia, ideally for less verbosity
<quarters> lyxia, from your questions, it sounds like pattern matching would be the only option for that
Haudegen has quit [Ping timeout: 246 seconds]
<lyxia> let foo = function x :: rest -> ... | [] -> ... would be a bit shorter but still that's pattern-matching, which is precisely how you decompose data in OCaml.
<lyxia> there are functions List.hd and List.tl if you're absolutely sure the list is nonempty, but these are defined using pattern-matching too.
<quarters> I'll loop back with a concrete example that I would like to refactor "without pattern matching" -- in quotes in light of what you just said, since it sounds like I'm mainly wanting to do away with the match...with syntax rather than pattern matching itself
<quarters> lyxia, I was wondering if this can be improved upon: https://pastebin.com/6YV9PDLj
<lyxia> you can match on x and y together. match x, y with | [], _ | _, [] -> [] | x' :: xs, y' :: ys -> (x', y') :: zip xs ys
<quarters> ah, ty!
<quarters> I tried to run "sum prod zip a b" which issued an error but was able to resolve it by using parens as follows: "sum (prod (zip a b))". I was wondering if there a compromise between the two since I find the latter to be too verbose for my taste
<lyxia> infix operators perhaps, sum @@ prod @@ zip a b
<lyxia> zip a b |> prod |> sum
<quarters> awesome. thx again, lyxia !
<lyxia> np
<lyxia> yw
<quarters> I noticed that when running tuareg mode, the initial indentation is off until I manually correct it. also was wondering if there's a minimal way to enable autocompletion since I don't seem to be getting that. would I need to install some packages using opam as well to enable this feature?
initiumdoeslinux has joined #ocaml
<quarters> I just found merlin. I reckon that's what's commonly used?
initiumdoeslinux has quit [Ping timeout: 246 seconds]