2024/05/14

Newest at the top

2024-05-14 12:26:56 +0200ubert(~Thunderbi@2a02:8109:ab8a:5a00:d77a:cc4d:acdd:ee1e)
2024-05-14 12:24:40 +0200_bo(~bo@198.red-83-56-252.dynamicip.rima-tde.net) (Ping timeout: 260 seconds)
2024-05-14 12:22:13 +0200bo_(~bo@198.red-83-56-252.dynamicip.rima-tde.net)
2024-05-14 12:15:08 +0200 <probie> I wouldn't mind such behaviour to allow elision of names in a system where all arguments are named arguments
2024-05-14 12:14:15 +0200titibandit(~titibandi@user/titibandit)
2024-05-14 12:06:56 +0200yin(~yin@user/zero)
2024-05-14 12:06:07 +0200 <cheater> you're right, hold up, let me implement a parser and a type checker real quick
2024-05-14 12:05:30 +0200yin(~yin@user/zero) (Ping timeout: 268 seconds)
2024-05-14 12:00:21 +0200 <ski> but i don't want to discourage you from pondering it, if you want to
2024-05-14 11:59:55 +0200 <ski> like, if you can elaborate this in a workable fashion, i'd be interested in taking a look .. i'm just saying i'm not seeing how it could work, in a way i'd consider reasonable
2024-05-14 11:58:04 +0200random-jellyfish(~developer@user/random-jellyfish) (Ping timeout: 260 seconds)
2024-05-14 11:56:18 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Quit: WeeChat 4.2.1)
2024-05-14 11:55:09 +0200 <ncf> the unordered arguments thing sounds like it would also be garbage wrt type inference
2024-05-14 11:53:16 +0200 <ski> yes
2024-05-14 11:52:52 +0200 <ski> anyway, using records (or labelled multi-arity functions, if available) is one workable approach. what OCaml does, labelled curried arguments, also works
2024-05-14 11:52:40 +0200 <lortabac> if you swap two arguments by mistake and it's obvious enough, an IDE may suggest inverting them
2024-05-14 11:52:01 +0200 <lortabac> I think it would be nice to have this feature as an IDE action, but not baked in the language
2024-05-14 11:51:52 +0200 <danse-nr3> one can also have f (default'{ arg = type })
2024-05-14 11:51:26 +0200 <danse-nr3> dunno, i just use product types and that gives me 99% of the functionality
2024-05-14 11:51:21 +0200 <ski> danse-nr3 : <https://en.wikipedia.org/wiki/Hanlon's_razor>
2024-05-14 11:51:10 +0200 <lortabac> you can select a record field by type if there is no ambiguity
2024-05-14 11:50:54 +0200 <lortabac> IIRC generic-lens does something similar to what cheater is proposing
2024-05-14 11:50:45 +0200 <ski> danse-nr3 : yea, that's basically that one
2024-05-14 11:50:23 +0200 <ski> perhaps i'd understand it better, cheater, if you made a simple prototype type checker (and maybe parser, if you wish)
2024-05-14 11:49:59 +0200 <danse-nr3> i remember occam's as "the simplest explanation is also the most likely" ... but it is lost in the mists of time. Maybe that was misreferenced
2024-05-14 11:49:14 +0200 <ski> "Don't attribute to malice, what can be adequately explained by ignorance/stupidity."
2024-05-14 11:48:51 +0200 <danse-nr3> v
2024-05-14 11:48:46 +0200 <ski> no, it's not the same thing
2024-05-14 11:48:39 +0200 <danse-nr3> huh i knew it as occam's razor... or is it different?
2024-05-14 11:48:24 +0200 <ski> i genuienly don't know how you are envisioning this to work
2024-05-14 11:48:02 +0200 <cheater> no
2024-05-14 11:47:56 +0200 <ski> Hanlon's razor
2024-05-14 11:47:39 +0200 <cheater> stop being confused on purpose
2024-05-14 11:47:23 +0200 <ski> `x',`y',`z',`a',`b',`c' here are meta-variables, standing for arbitrary expressions. there's no a-priori associatiation of these, to the types `X',`Y',`Z',`A',`B',`C' .. if you mean just actual variable names `x',`y',`z',`a',`b',`c' .. then that's very limited, doesn't scale, isn't really composable
2024-05-14 11:46:27 +0200 <cheater> it was all part of the same example
2024-05-14 11:46:10 +0200 <cheater> it was an example in the context of what i said before about the type signature
2024-05-14 11:45:53 +0200 <ski> not in the application, you did not
2024-05-14 11:45:42 +0200 <cheater> i specifically typed out their types ski
2024-05-14 11:45:35 +0200 <danse-nr3> still with this stuff? What is wrong with my suggestion to use a product type?
2024-05-14 11:45:23 +0200 <ski> what if the types of `x',`y',`z' are the same as the types of `a',`b',`c' (respectively) ?
2024-05-14 11:45:23 +0200 <cheater> at that point it's easy to figure out which piece goes in which hole
2024-05-14 11:45:04 +0200 <cheater> i'm talking about the fact that most often with functions in haskell you either have arguments that all have different types, or just a small amount amount of arguments of equal types, which can be represented as a tuple (or, uncurried, with -> )
2024-05-14 11:44:48 +0200 <cheater> i'll disagree with that last one
2024-05-14 11:44:25 +0200 <ski> (at least not, if you want the language to be sane)
2024-05-14 11:44:05 +0200 <ski> (can't reaally provide them, out of order, without labelling them)
2024-05-14 11:43:49 +0200 <cheater> yes. not what i'm talking about
2024-05-14 11:43:41 +0200 <ski> it's labelled arguments, which you can provide out of order
2024-05-14 11:43:16 +0200 <cheater> yeah that's not really what i'm talking about
2024-05-14 11:40:46 +0200 <ski> cheater : <https://ocaml.org/manual/5.2/lablexamples.html>
2024-05-14 11:38:23 +0200deriamis(deriamis@ec2-54-187-167-69.us-west-2.compute.amazonaws.com)