Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-07 10:33:11 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds)
2021-04-07 10:34:56 <tomsmeding> [exa]: | grep -v '^ *|' | grep -v '\^\^\^'
2021-04-07 10:35:19 <merijn> tbh, more control over error output would be nice anyway
2021-04-07 10:35:56 <tomsmeding> perhaps that will come with the internal diagnostics refactors that are currently going on
2021-04-07 10:38:01 <Gurkenglas> I want to minimize a function with multiple inputs. Should I use Haskell? Does one use the same libraries for this that one uses to train a neural network?
2021-04-07 10:39:24 <merijn> And the error reporting logic is (well, was a few years ago, at least) fairly hackable
2021-04-07 10:39:48 <merijn> So I don't think "inhibit code sample from errors" would be a hard or controversial feature
2021-04-07 10:40:18 <merijn> Gurkenglas: Well, depends a bit on "do you know *anything* about the function?"
2021-04-07 10:41:01 <tomsmeding> Gurkenglas: does your function have a computable derivative (and do you have it written out or do you need automatic differentiation)? If so, would gradient descent be sufficient? Or would you want a genetic algorithm, or some other specific algorithm? Or do you want a batteries-included optimisation toolkit that figures it all out by itself?
2021-04-07 10:41:12 <merijn> There's a whole numerical theory field of maths on analysing things and things like linear solver, derivatives, etc.
2021-04-07 10:41:33 <Gurkenglas> tomsmeding, the latter
2021-04-07 10:41:54 <tomsmeding> Gurkenglas: then find the toolkit, and choose the language that the toolkit supports :p
2021-04-07 10:41:56 <tomsmeding> not the other way round
2021-04-07 10:42:16 <merijn> Yeah, that
2021-04-07 10:42:59 <Gurkenglas> merijn, each function is specified by a short definition, not necessarily constructive (because "min" is an allowed term in the hypothetical DSL). If the toolkit tries solving it analytically first thats fine
2021-04-07 10:43:03 <tomsmeding> and note that which toolkit is best depends on the properties of your function
2021-04-07 10:43:04 <fendor> [exa], maybe you want -fno-caret-diagnostics?
2021-04-07 10:43:16 lotuseater joins (~user@p200300e787030b0000a24874ceb5ca88.dip0.t-ipconnect.de)
2021-04-07 10:43:28 <tomsmeding> Gurkenglas: have you tried mathematica or wolfram-alpha?
2021-04-07 10:43:41 <Gurkenglas> tomsmeding, surely there's a toolkit thats worse only by a constant than the others because it calls them?
2021-04-07 10:43:42 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-07 10:43:45 <tomsmeding> or matlab or maple or
2021-04-07 10:44:01 johs parts (sid246410@gateway/web/irccloud.com/x-vwtcqxowszipwyyc) ()
2021-04-07 10:44:19 <tomsmeding> Gurkenglas: no algorithm can minimise all functions optimally, which approach is best depends on what you know about your function
2021-04-07 10:44:29 <tomsmeding> and note that a combination of algorithms is still an algorithm
2021-04-07 10:44:50 <merijn> Something, something, No Free Lunch theorem
2021-04-07 10:45:01 <Gurkenglas> Ideally, the approach would leave me able to help when the toolkit doesn't find an answer alone, and the language wouldn't drive me insane when I build a job on that.
2021-04-07 10:45:34 zebrag joins (~inkbottle@aaubervilliers-654-1-2-51.w83-200.abo.wanadoo.fr)
2021-04-07 10:46:00 <Gurkenglas> oh i suppose there is actually no better way to combine two toolkits than running them both if one makes absolutely no assumptions about the function (or set of functions)
2021-04-07 10:46:37 <tomsmeding> Gurkenglas: the function that is 1 on Q and 0 on R\Q is also a function
2021-04-07 10:46:45 <tomsmeding> "no assumptions" is strong :p
2021-04-07 10:47:18 <tomsmeding> but, the point is, find the framework, and I know very little about actual real-world libraries :p
2021-04-07 10:47:19 <Gurkenglas> tomsmeding, yea and some of the libraries would assume such functions forbidden and some wouldn't and the metatoolkit would presumably converge to using the one t hat doesn't
2021-04-07 10:47:31 <tomsmeding> true
2021-04-07 10:48:11 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
2021-04-07 10:48:13 <tomsmeding> try mathematica, and if that doesn't work: determine what exactly is the component of your language that mathematica can't handle, and focus your search on that
2021-04-07 10:48:56 <tomsmeding> all the "usual" stuff in analytical math is covered by mathematica
2021-04-07 10:49:03 × stree quits (~stree@68.36.8.116) (Ping timeout: 260 seconds)
2021-04-07 10:50:02 <fendor> is `Eq b => b` less polymorphic than just `a`?
2021-04-07 10:50:36 <tomsmeding> there are less types that fit
2021-04-07 10:51:15 <fendor> yeah
2021-04-07 10:52:27 <merijn> You don't know that :p
2021-04-07 10:52:29 × timCF quits (~i.tkachuk@200-149-20-81.sta.estpak.ee) (Quit: leaving)
2021-04-07 10:52:46 <Taneb> If I have a function with type "forall a. a -> Bool", I know that it's constant
2021-04-07 10:53:28 <Taneb> If I have a function with type "forall a. Eq a => a -> Bool", it could be constant, or it could be something like \x -> x == x, which might not be constant for some Eq instances
2021-04-07 10:55:24 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-07 10:56:12 carp joins (5c17283b@host-92-23-40-59.as13285.net)
2021-04-07 10:59:55 <mniip> well it is certainly of the form \x -> f (x == x), for some f :: Bool -> Bool
2021-04-07 11:00:03 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 248 seconds)
2021-04-07 11:00:11 × pavonia quits (~user@unaffiliated/siracusa) (Quit: Bye!)
2021-04-07 11:00:31 jacks2 joins (~bc8134e3@199.204.85.195)
2021-04-07 11:00:53 <Taneb> Yes
2021-04-07 11:02:24 Alleria joins (~textual@mskresolve-a.mskcc.org)
2021-04-07 11:02:34 stree joins (~stree@68.36.8.116)
2021-04-07 11:02:47 Alleria is now known as Guest48425
2021-04-07 11:04:07 <jacks2> Taneb, what do you mean? \x -> x == x should always return True, assuming non-broken Eq instance
2021-04-07 11:04:27 <mniip> that's an assumption
2021-04-07 11:04:35 <Taneb> jacks2: I'm not assuming a non-broken Eq instance
2021-04-07 11:04:40 <Taneb> > (\x -> x == x) (0/0)
2021-04-07 11:04:41 <lambdabot> False
2021-04-07 11:05:33 <jacks2> Taneb, I'm not sure I see the point in not assuming that. particularly when answering questions from someone new to haskell
2021-04-07 11:05:56 <Taneb> jacks2: I don't think fendor's new to Haskell? I'm sure I've seen their username a lot before
2021-04-07 11:08:30 <fendor> I am not new T_T just wanted to confirm it before going down a rabbit hole of wrong assumptions
2021-04-07 11:10:12 <jacks2> broken Eq instances have nothing to do with Eq a being less polymorphic than a
2021-04-07 11:10:14 <merijn> fendor: I mean, you're gonna need a definition of "more/less polymorphic" first
2021-04-07 11:10:44 <merijn> People are all reacting from their gut idea of what "less polymorphic" means
2021-04-07 11:10:49 <merijn> But that seems counterproductive
2021-04-07 11:11:31 <Taneb> jacks2: I was justifying that forall a. a has different properties to forall a. Eq a
2021-04-07 11:11:40 <merijn> Is "polymorphism" measured by the cardinality of the types that can "fit" (whatever that means) into a type variable?
2021-04-07 11:11:43 <Taneb> *+ => a
2021-04-07 11:12:13 <merijn> If yes, then you can't say anything about "Foo a => a" vs "a", because there's no reason Foo's cardinality *can't* include all possible types
2021-04-07 11:12:21 <merijn> Consider "instance Foo a where ..."
2021-04-07 11:12:29 <fendor> merijn, ghc manual didnt define it more detailed
2021-04-07 11:12:33 <merijn> So clearly cardinality doesn't make sense
2021-04-07 11:12:48 <fendor> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/pragmas.html?highlight=specialisation#specialize-pragma
2021-04-07 11:12:51 <merijn> But I wouldn't know what else to use
2021-04-07 11:13:34 × vs^ quits (vs@ip98-184-89-2.mc.at.cox.net) ()
2021-04-07 11:14:19 <merijn> fendor: I'm not sure there's a hard definition of that terminology
2021-04-07 11:14:33 <merijn> Ask in #ghc (and update the docs when you find out ;))
2021-04-07 11:15:01 <fendor> ok, will do!
2021-04-07 11:17:47 vv8 joins (~egp_@128-71-69-136.broadband.corbina.ru)
2021-04-07 11:18:24 × kiweun quits (~kiweun@2607:fea8:2a62:9600:e8b5:adb7:6f5d:778c) (Remote host closed the connection)
2021-04-07 11:21:14 × __minoru__shirae quits (~shiraeesh@5.101.59.224) (Ping timeout: 246 seconds)
2021-04-07 11:22:47 kiweun joins (~kiweun@2607:fea8:2a62:9600:c64:2029:5aee:a1f3)
2021-04-07 11:28:09 <joel135> There's also the word "parametric".
2021-04-07 11:29:12 Iryon joins (~Iryon@185-12-21-77.sigma.jaslo.pl)
2021-04-07 11:32:24 × xff0x quits (~xff0x@2001:1a81:52c6:f900:b4b3:1e00:bd22:9f8d) (Ping timeout: 246 seconds)
2021-04-07 11:33:11 × kiweun quits (~kiweun@2607:fea8:2a62:9600:c64:2029:5aee:a1f3) (Remote host closed the connection)
2021-04-07 11:33:24 <tomsmeding> merijn: well the set of types that can unify with 'forall a. Eq a => a' is certainly a subset of those that unify with 'forall a. a'; whether that subset is a _proper_ subset is irrelevant I'd say
2021-04-07 11:33:30 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-07 11:33:36 xff0x joins (~xff0x@2001:1a81:52c6:f900:8bb9:4c7a:ec7:b51f)
2021-04-07 11:34:09 <tomsmeding> whereas the inverse subset relation only holds if you further assume that there is an 'instance Eq a where'
2021-04-07 11:34:51 <tomsmeding> but if you start assuming things about which instances exist, your "more polymorphic than" relation suddenly got a lot murkier
2021-04-07 11:34:55 __minoru__shirae joins (~shiraeesh@5.101.59.224)
2021-04-07 11:36:15 <tomsmeding> I'd say type scheme A is less polymorphic than type scheme B if for all sets possible of instance declarations in scope, any type that can fit in a hole of type A can also fit in a hole of type B
2021-04-07 11:36:16 <merijn> tomsmeding: It's irrelevant if you treat define "more/less" as a subset relationship, yes. But not if you use cardinality
2021-04-07 11:36:27 <merijn> tomsmeding: Hence my "you need to define more/less polymorphic first"
2021-04-07 11:36:34 <tomsmeding> very true
2021-04-07 11:37:43 <tomsmeding> though the cardinality definition makes no sense to me anyway
2021-04-07 11:37:46 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds)

All times are in UTC.