Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tuplanolla has quit [Quit: Leaving.]
Phandal has quit [Quit: leaving]
dnaq has quit [Ping timeout: 246 seconds]
dnaq has joined #ocaml
azimut has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raskol has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
jabuxas has quit [Ping timeout: 256 seconds]
pi3ce has joined #ocaml
omegatron has quit [Quit: Power is a curious thing. It can be contained, hidden, locked away, and yet it always breaks free.]
rgrinberg has joined #ocaml
myrkraverk__ has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk__ has quit [Remote host closed the connection]
myrkraverk__ has joined #ocaml
jabuxas has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jabuxas has quit [Ping timeout: 276 seconds]
lukstafi has joined #ocaml
rgrinberg has joined #ocaml
lukstafi has quit [Quit: Client closed]
Serpent7776 has joined #ocaml
<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.
<octachron> This is a polymorphic variant type: https://ocaml.org/manual/polyvariant.html
<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?
rgrinberg has joined #ocaml
<discocaml> <simzeking> Hello i need some help
<discocaml> <simzeking> Why this doesn't work .
<discocaml> <simzeking> Why this doesn't work ?
Anarchos has joined #ocaml
<discocaml> <Kali> what's the code? we can't help from just an error
<discocaml> <simzeking> let puis x n=
<discocaml> <simzeking> let p= ref 1 in
<discocaml> <simzeking> for k=1 to n do
<discocaml> <simzeking> p:=(!p)*x
<discocaml> <simzeking> done;
<discocaml> <simzeking> !p;;
<discocaml> <simzeking> return:
<discocaml> <simzeking> # let puis x n=
<discocaml> <simzeking> Line 4, characters 12-13:
<discocaml> <simzeking> 4 | let p= ref 1 in
<discocaml> <simzeking> ^
<discocaml> <simzeking> Error: This expression has type int but an expression was expected of type
<discocaml> <simzeking> int -> int -> int
<discocaml> <simzeking> #
<discocaml> <simzeking> it returns me that:
<discocaml> <simzeking> The command "ref" doesn't work
<discocaml> <lukstafi> What if you replace `ref` by `Stdlib.ref`?
jabuxas has quit [Ping timeout: 256 seconds]
<discocaml> <simzeking> Thank you so much @lukstafi ! What is the differents btw these ?
<discocaml> <lukstafi> Either you or someone else redefined `ref`
<discocaml> <Kali> you did not include all the code
<discocaml> <Kali> please include all the code
<discocaml> <Kali> there is at least 2 lines of code before that
<discocaml> <Kali> also, surround code with
<discocaml> <Kali> \`\`\`ocaml
<discocaml> <Kali>
<discocaml> <Kali> \`\`\`
<discocaml> <Kali> so it formats nicely
<discocaml> <simzeking> Like that ?
<discocaml> <Kali> no, i meant in discord
<discocaml> <simzeking> Ohh sorry
<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]
troydm has joined #ocaml
Tuplanolla has joined #ocaml
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
wagle has quit [Client Quit]
wagle has joined #ocaml
average has quit [Quit: Connection closed for inactivity]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bartholin has quit [Quit: Leaving]
Phandal has quit [Quit: leaving]
Ankhers has quit [Ping timeout: 256 seconds]
soni_ has quit [Ping timeout: 264 seconds]
soni_ has joined #ocaml
kuruczgy has quit [Ping timeout: 256 seconds]
_alix has quit [Ping timeout: 256 seconds]
jakzale has quit [Ping timeout: 256 seconds]
philipwhite has quit [Ping timeout: 256 seconds]
henrytill has quit [Ping timeout: 264 seconds]
arya_elfren has quit [Ping timeout: 264 seconds]
migalmoreno has quit [Ping timeout: 264 seconds]
whereiseveryone has quit [Ping timeout: 256 seconds]
pluviaq has quit [Ping timeout: 256 seconds]
toastal has quit [Ping timeout: 256 seconds]
ggb has quit [Ping timeout: 256 seconds]
b0o has quit [Ping timeout: 264 seconds]
brettgilio has quit [Ping timeout: 264 seconds]
immutable has quit [Ping timeout: 264 seconds]
lane has quit [Ping timeout: 264 seconds]
Ankhers has joined #ocaml
jakzale has joined #ocaml
kuruczgy has joined #ocaml
toastal has joined #ocaml
philipwhite has joined #ocaml
arya_elfren has joined #ocaml
henrytill has joined #ocaml
migalmoreno has joined #ocaml
ggb has joined #ocaml
pluviaq has joined #ocaml
whereiseveryone has joined #ocaml
lane has joined #ocaml
immutable has joined #ocaml
brettgilio has joined #ocaml
b0o has joined #ocaml
_alix has joined #ocaml
immutable has quit [Ping timeout: 255 seconds]
pluviaq has quit [Ping timeout: 255 seconds]
ggb has quit [Ping timeout: 255 seconds]
b0o has quit [Ping timeout: 255 seconds]
whereiseveryone has quit [Ping timeout: 255 seconds]
brettgilio has quit [Ping timeout: 255 seconds]
lane has quit [Ping timeout: 255 seconds]
_alix has quit [Ping timeout: 268 seconds]
jabuxas has joined #ocaml
mima has quit [Ping timeout: 264 seconds]