<ely-se>
less XY: I currently have type type_or_univar = Type of typ | Univar of int however I'd like to flatten it so that I don't have to double pattern match all the time
<ely-se>
but I don't want Univar in typ
<ely-se>
because univars are only created and used within one particular function, and removed before that function returns, whereas other typs are used all over the place
martintrojer has quit [Ping timeout: 250 seconds]
Haudegen has quit [Remote host closed the connection]
martintrojer has joined #ocaml
<companion_cube>
what's a univar?
<ely-se>
a unification variable
<companion_cube>
oh, ok
<ely-se>
I'm implementing type checker/inferencer
OnkV has joined #ocaml
<octachron>
ely-se: you can use explicit coercion: let y = ( x :> typ2 )
nicoo has quit [Remote host closed the connection]
<ely-se>
octachron: oy vey, how could have I missed that :D
<ely-se>
thanks!
ryanartecona has quit [Ping timeout: 260 seconds]
nicoo has joined #ocaml
<ely-se>
I'm so happy
<ely-se>
I love OCaml.
OnkV has quit [Ping timeout: 252 seconds]
<ely-se>
octachron: funfact: I just realised I don't need this at all XD
BitPuffin has quit [Ping timeout: 244 seconds]
OnkV has joined #ocaml
ryanartecona has joined #ocaml
OnkV has quit [Ping timeout: 264 seconds]
netrobyatmobile has quit [Quit: Connection closed for inactivity]
ryanartecona has quit [Quit: ryanartecona]
OnkV has joined #ocaml
<freehck>
people, how to move cursor to the end of the current expression in emacs merlin-mode?
<freehck>
I have a very long let and wanna see where it ends.
orbifx has joined #ocaml
ryanartecona has joined #ocaml
octachron has quit [Quit: Leaving]
<Khady>
gasche_: do you know if there is a way to get a warning when I have a rule like <path_with_typo/file.ml>: package(foo) that is not used (because of the typo in the path)?
<Khady>
the rule is in _tags and I talk about ocamlbuild
fluter has quit [Ping timeout: 252 seconds]
fluter has joined #ocaml
jeffmo has joined #ocaml
zpe has quit [Remote host closed the connection]
ncthom91 has joined #ocaml
zpe has joined #ocaml
ontologiae has quit [Ping timeout: 255 seconds]
zpe has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
slash^ has joined #ocaml
yomimono has joined #ocaml
shinnya has joined #ocaml
ely-se has quit [Quit: leaving]
rgrinberg2 has joined #ocaml
<Bahman>
Is there any function equivalent to `::`, for example `List.cons 1 [2;3]`?
<companion_cube>
in the next version of OCaml, yes; also found in alternative stdlib
<Bahman>
companion_cube: Alternative stdlib?
<Bahman>
The Jane Street version?
<companion_cube>
there are several stdlibs, including Core (janestreet) and Batteries (community), and several smaller ones
<companion_cube>
I think most of them have some List.cons equivalent
<theblatte>
oh wow, (::) is not even a thing :/
<Enjolras_>
that's because it's not an operator but a constructor
<Enjolras_>
and constructor are not function-like in ocaml, you cannot treat Some as a function for instance
<Bahman>
Thanks companion_cube.
<Enjolras_>
and hence you cannot treat :: as a function either
jabesed has joined #ocaml
<theblatte>
Enjolras_: right, that makes sense, silly me. I guess you cannot define your own infix constructors?
<Enjolras_>
not yet.That's the only one
<theblatte>
there's quite a bit of hardcoded stuff in ocaml :)
octachron has joined #ocaml
<groovy2shoes>
mostly due to its age
<Enjolras_>
that's totally ad-hoc indeed :)
<Enjolras_>
it breaks two rules. Constructors are prefix and start with an upper case letter
<Enjolras_>
except this one
<theblatte>
:)
FreeBirdLjj has quit [Remote host closed the connection]
ril has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
orbifx has quit [Quit: WeeChat 1.3]
nullcatxxx_ has joined #ocaml
ocp has quit [Quit: Leaving.]
jabesed has quit [Remote host closed the connection]
octachron has quit [Ping timeout: 240 seconds]
dsheets has quit [Ping timeout: 272 seconds]
ygrek_ has joined #ocaml
tane has joined #ocaml
^elyse^ has joined #ocaml
zpe_ has joined #ocaml
tane has quit [Remote host closed the connection]
zpe_ has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
BitPuffin has joined #ocaml
tane has quit [Ping timeout: 276 seconds]
libertas has quit [Quit: Lost terminal]
FreeBirdLjj has joined #ocaml
Denommus has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 255 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwatzman|work has joined #ocaml
nullcatxxx_ has joined #ocaml
mort___ has left #ocaml [#ocaml]
types has quit [Ping timeout: 246 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cypi_ is now known as Cypi
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
Kakadu has joined #ocaml
nullcatxxx_ has joined #ocaml
tane has joined #ocaml
<^elyse^>
I have this code: val mangle : (string, string, string, string) Ast.modul -> (string, string, string, string) Ast.modul
<^elyse^>
but this is quite "holy shit my eyes". is there a way to make it so that I have to write (string, string, string, string) only once instead of twice?
<^elyse^>
I could make a type alias but then I have to put that in every module structure with this signature
<ygrek_>
you can put it Ast
<companion_cube>
val mangle : (string,string,string,string) Ast.modul as 'foo -> 'foo
<companion_cube>
I think this should work :p
larhat1 has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 255 seconds]
<^elyse^>
btw, is it possible to use Tuareg but *only* for syntax highlighting, and disable everything else it offers?
<thizanne>
what else would you want to disable ?
<^elyse^>
indentation, for example
<companion_cube>
it's sooo nice to have colors in OCaml
<companion_cube>
can't wait for 4.03 to be released :p
yomimono has quit [Quit: Leaving]
<^elyse^>
reasoning: identation of Tuareg on MELPA is so horribly broken that it's unusable, and I don't want opam on my machine (I run the toolchain in a VM)
ygrek_ has quit [Ping timeout: 272 seconds]
python476 has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
sepp2k has quit [Quit: Leaving.]
larhat1 has quit [Quit: Leaving.]
chris2 has quit [Ping timeout: 272 seconds]
orbifx has joined #ocaml
darkf has quit [Quit: Leaving]
^elyse^ has left #ocaml ["Leaving"]
mort___ has joined #ocaml
Bahman has quit [Quit: Ave atque vale]
ncthom91 has joined #ocaml
pikachuyann has quit [Quit: A plus !]
kushal has quit [Quit: Leaving]
ygrek_ has joined #ocaml
rgrinberg2 has quit [Ping timeout: 255 seconds]
shinnya has joined #ocaml
jeffmo_ has joined #ocaml
jeffmo has quit [Ping timeout: 260 seconds]
jeffmo_ is now known as jeffmo
Lis has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
rgrinberg2 has joined #ocaml
Lis has quit [Client Quit]
rgrinberg2 has quit [Ping timeout: 240 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
foofoo_ has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
nullcatxxx_ has joined #ocaml
ncthom91 has joined #ocaml
mort___ has quit [Quit: Leaving.]
ohama has quit [Ping timeout: 252 seconds]
<python476>
anyone got a mail for an event about Bob Harper PFPL book 2nd edition ?
<sgeisenh>
python476: what?
<python476>
I know it's not directly OCaml related
ohama has joined #ocaml
<python476>
but Bob Harper being involved in SML .. I thought I could ask
<sgeisenh>
python476: An email? Did you sign up for a mailing list on Cambridge Press or something?
<python476>
sgeisenh: that's the thing I don't remember anything like that
<python476>
I thought it was a meetup at first
<python476>
it looks like a hangout video chat .. first time I see this
<sgeisenh>
I guess I'm just sad because I'd be interested but I didn't get an email.
<python476>
I'm trying to contact the sender to have details
<python476>
I'll ask if he can send other invitations if you want
groovy2shoes has quit [Quit: Leaving]
OnkV has quit [Ping timeout: 272 seconds]
<sgeisenh>
I'm still just kind of confused what the email is about.
<python476>
invitation from the type theory group for 'something' saturday at 0:00 (<< ??) Paris time
ohama has quit [Ping timeout: 246 seconds]
<python476>
bbl
ohama has joined #ocaml
solrize has quit [Ping timeout: 240 seconds]
slash^ has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryanartecona has quit [Quit: ryanartecona]
freehck has quit [Remote host closed the connection]
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chris2 has joined #ocaml
natimic has joined #ocaml
uvicon has quit [Quit: Leaving]
pierpa has joined #ocaml
ollehar has joined #ocaml
ollehar has quit [Client Quit]
matthewhill has joined #ocaml
matthewhill has quit [Remote host closed the connection]
Algebr has joined #ocaml
matthewhill has joined #ocaml
matthewhill has quit [Remote host closed the connection]
matthewhill has joined #ocaml
matthewhill has quit [Remote host closed the connection]
<Algebr>
I can sequence unit Lwt.t with >>= fun () -> ... but this is repetitive, how can I worked a sequence of unit Lwt.ts? Like say a list of unit Lwt.ts where I want one done right after another.
<companion_cube>
Lwt_list.iter_s
<Algebr>
derp, and I did look in Lwt_list
<Algebr>
companion_cube: This is ugly though, Lwt_list.iter_s (fun _ -> return ())[g : unit Lwt.t; h : unit Lwt.t]
<companion_cube>
fun x->x would work
<companion_cube>
but this is useful only if you have dozens of operations, I think
<companion_cube>
otherwise, let%lwt () = a in let%lwt () = b in ......
ryanartecona has joined #ocaml
ryanartecona has quit [Client Quit]
^elyse^ has joined #ocaml
<^elyse^>
Is there something like Haskell's deriving (Functor)?
<^elyse^>
possibly as a preprocessor of some sort
ryanartecona has joined #ocaml
<companion_cube>
ppx_deriving
<companion_cube>
something like ppx_deriving.map, I think
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<^elyse^>
nice :D
<^elyse^>
just found it
psy_ has quit [Ping timeout: 260 seconds]
<^elyse^>
if I can get it to work I can reduce hundreds of lines of boilerplate :p
<companion_cube>
it's dead simple, if you use 4.02.3
<companion_cube>
just depend on ppx_deriving.std, roughly, and everything works
<companion_cube>
also: ppx_deriving_yojson if you need serialization