<discocaml>
<niovel> I'm trying to print `1.0` as `"1.0"` with `Printf.printf "%#.2g" 1.0`, but it prints `"1"` instead. The same code in C _does_ print it correctly. Is this some limitation or am I using it wrongly?
bartholin has joined #ocaml
bartholin has quit [Client Quit]
<reynir>
@niovel: from the Printf documentation: g or G: convert a floating-point argument to decimal notation, in style f or e, E (whichever is more compact). Moreover, any trailing zeros are removed from the fractional part of the result and the decimal-point character is removed if there is no fractional part remaining.
<reynir>
(if I use %.2f it adds zeroes)
<discocaml>
<niovel> Indeed, but also from the printf documentation regarding the `#` flag: "For a, A, e, E, f, F, g, and G conversions, the result will always contain a decimal point"
<reynir>
ah ok that is confusing
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
average has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
olle has joined #ocaml
jabuxas has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
alexherbo2 has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
micro has quit [Ping timeout: 264 seconds]
micro has joined #ocaml
dylanj has quit [Ping timeout: 276 seconds]
steenuil_ has joined #ocaml
dylanj_ has joined #ocaml
end has quit [Read error: Connection reset by peer]
xenu has quit [Ping timeout: 276 seconds]
xenu has joined #ocaml
gdd has quit [Ping timeout: 276 seconds]
steenuil has quit [Ping timeout: 276 seconds]
steenuil_ is now known as steenuil
gdd has joined #ocaml
Square3 has joined #ocaml
end has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
dnh has joined #ocaml
romildo has joined #ocaml
romildo has quit [Client Quit]
amk has quit [Remote host closed the connection]
amk has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
fweht has joined #ocaml
amk has quit [Remote host closed the connection]
amk has joined #ocaml
bibi_ has quit [Quit: Konversation terminated!]
bibi_ has joined #ocaml
darchitect has joined #ocaml
Square3 has quit [Ping timeout: 252 seconds]
azimut_ has joined #ocaml
darchitect has quit [Quit: WeeChat 3.8]
azimut has quit [Ping timeout: 255 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
a51 has quit [Ping timeout: 255 seconds]
a51 has joined #ocaml
a51 has quit [Quit: WeeChat 4.2.1]
Phandal has joined #ocaml
adrien_ is now known as adrien
abbe__ has joined #ocaml
<abbe__>
hi!
<abbe__>
what does this type imply: [`Msg of string] ? It's from ocaml-yaml library.
<abbe__>
something like type level data structures in haskell ?
<octachron>
No, rather structural algebraic types
<olle>
Tags that don't belong to a type name
<abbe__>
I see now. Thanks! I'm fairly novice, only started yesterday.
<abbe__>
Also is one supposed to construct let* operator wherever one is using it, or is this part of some pre-defined module that one could open ? I read that documentation of that extensions, but there is no mention of it as such.
<olle>
Don't the libs define the behav of let* ?
<olle>
Others will know better than me :)
<olle>
Also compare with >>= operator
<octachron>
It depends on the library. For instance, currently for the standard library, you need to define the let-operator before using it.
<discocaml>
<._null._> They're usually predefined, but the standard library doesn't define any, so for basic types (option, result, list) you either have to use a stdlib extension/replacement or define them yourself
<abbe__>
where could one find such a stdlib extension/replacement ? any name ?
<discocaml>
<._null._> Containers is an extension, Base is a replacement (more controversial since it's a *replacement*)
<discocaml>
<._null._> Defining them yourself is pretty painless
<abbe__>
okay, thanks!
fweht has quit [Quit: Connection closed for inactivity]
Serpent7776 has quit [Ping timeout: 246 seconds]
szkl has joined #ocaml
<abbe__>
TIL Base is not Ocaml standard library shipped with it :D
alexherbo2 has quit [Remote host closed the connection]
<olle>
Base messed me up so bad...
olle has quit [Ping timeout: 268 seconds]
<discocaml>
<._null._> The standard library is called `Stdlib`
bartholin has joined #ocaml
waleee has joined #ocaml
alexherbo2 has joined #ocaml
rgrinberg has joined #ocaml
azimut_ has quit [Ping timeout: 255 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
olle has joined #ocaml
wingsorc has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
olle has quit [Ping timeout: 256 seconds]
<Phandal>
Is it more common to use Base or stick with the standard library shipping with ocaml?
<discocaml>
<simzeking> Thanks you so much both of you, i just started today to learn Caml!
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Anarchos>
is it possible to do something like «module (A: SIG with type a = b and type c = a ref» : the type c in the constraint depends on the other type a in the constraint.
corwin has joined #ocaml
<discocaml>
<simzeking> Thanks you so much for beeing fast to reply !
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]