Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 464 465 466 467 468 469 470 471 472 473 474 .. 5022
502,152 events total
2020-10-06 13:31:24 <quazimod1> i don't know how i'm gonna build a stripe wrapper when my mind's caught up in this mess
2020-10-06 13:31:26 <kuribas> the best way is to start of with really crude haskell
2020-10-06 13:31:26 <sm[m]> over the long term I think that's not true :)
2020-10-06 13:31:35 <kuribas> then as you learn more to refine it.
2020-10-06 13:31:37 <ski> (you could also express the latter rule by saying that if you have `x -> y', then you have `x ->* y' (one step). and if you have `x ->* y' and `y ->* z', then you have `x ->* z' (combine multiple steps with multiple steps. this is transitivity.) (the "zero steps" is reflexivity)'
2020-10-06 13:32:13 ski nods to sm[m]
2020-10-06 13:32:14 <sm[m]> kuribas: that's my approach also
2020-10-06 13:32:20 × berberman_ quits (~berberman@123.118.97.97) (Ping timeout: 260 seconds)
2020-10-06 13:32:26 <quazimod1> by zero steps are we talking about intermediate transformations, or computations?
2020-10-06 13:32:31 <quazimod1> what is a step, here?
2020-10-06 13:32:54 <kuribas> in fact, I find that often when I am stuck in to much refinement, it helps to start of with something dumb and basic, then gradualy rewriting it.
2020-10-06 13:33:04 <ski> a "step" is the relation `->' you started with. could be any binary relation on a set. in your case, i presume it's some kind of reduction or transition step
2020-10-06 13:33:09 berberman joins (~berberman@123.118.96.247)
2020-10-06 13:33:35 <quazimod1> ski: it's actually page 4 of http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.27.7800&rep=rep1&type=pdf
2020-10-06 13:34:20 <ski> from any binary relation `R' on a set, we can construct a binary relation `R*' that includes `R', and is both reflexive and transitive (so is a "partial order"). in fact, `R*' is the "smallest" such relation (doesn't include extra irrelevant cruft). that's why it's called the "reflexive-transitive closure"
2020-10-06 13:35:28 <ski> quazimod1 : it's standard to talk about reflexive-transitive closure, when speaking more formally about the (small-step) operational/procedural semantics of programming languages
2020-10-06 13:36:39 <ski> yea, in this situation, `x -> y' means that the expression `x' can reduce to the expression `y' "in one step". then `x ->* y' means that it can reduce, in zero or more steps
2020-10-06 13:36:45 <quazimod1> i dont have a background in this maths
2020-10-06 13:36:55 <quazimod1> does this fall into set or category theory?
2020-10-06 13:36:55 <ski> yea, that's why i'm explaining
2020-10-06 13:37:15 <ski> it's semantics of programming languages
2020-10-06 13:37:15 <quazimod1> so the 'zero' in the zero or more steps is important
2020-10-06 13:37:31 <quazimod1> why do we think abouth the zero, rather than 1 or more?
2020-10-06 13:37:36 plutoniix joins (~q@ppp-223-24-166-134.revip6.asianet.co.th)
2020-10-06 13:37:43 <ski> yea, sometimes you see `->+' for "one or more steps". that's "transitive closure" (without the reflexive part)
2020-10-06 13:37:54 <ski> but i think it's more common to want to include the possibility of zero steps
2020-10-06 13:37:56 zoom84 joins (~user@068-190-177-201.res.spectrum.com)
2020-10-06 13:38:02 zoom84 parts (~user@068-190-177-201.res.spectrum.com) ()
2020-10-06 13:38:11 <ski> well, one common use of this is to talk about confluence
2020-10-06 13:38:22 × ym555 quits (~ym@156.199.113.15) (Quit: leaving...)
2020-10-06 13:38:32 <ski> say you have an expression `(2 + 3) * (1 + 4)'. you can imagine doing the additions in either order
2020-10-06 13:38:35 <ski> so, you can go
2020-10-06 13:38:51 <ski> (2 + 3) * (1 + 4) |-> 5 * (1 + 4)
2020-10-06 13:38:55 <ski> or else you can go
2020-10-06 13:39:01 <ski> (2 + 3) * (1 + 4) |-> (2 + 3) * 5
2020-10-06 13:39:04 <quazimod1> sure
2020-10-06 13:39:23 <ski> but regardless of which path we take, we will eventually "converge" again, get back to the same spot
2020-10-06 13:39:30 <ski> (2 + 3) * (1 + 4) |-> 5 * (1 + 4) |-> 5 * 5
2020-10-06 13:39:31 <ski> vs.
2020-10-06 13:39:32 <quazimod1> skrj
2020-10-06 13:39:36 <ski> (2 + 3) * (1 + 4) |-> (2 + 3) * 5 |-> 5 * 5
2020-10-06 13:39:39 <quazimod1> sorry, dvorak, sure
2020-10-06 13:39:47 × Ariakenom quits (~Ariakenom@193.254.193.1) (Ping timeout: 240 seconds)
2020-10-06 13:40:17 <ski> so, one way to express this is that if you have `x |-> y0' and also have `x |-> y1', then there should exist some `z' such that `y0 |->* z' and `y1 |->* z'
2020-10-06 13:40:47 <ski> so, regardless of whether we go left or right, we'll eventually come to a common spot on the path, again
2020-10-06 13:41:18 <ski> however, it could be that from `y0' you can get (in some steps) to `y1' itself
2020-10-06 13:41:25 <quazimod1> ah sure, and the zero being the case that the y0 was the same as whe z anyway
2020-10-06 13:42:36 <ski> so, then we want `z' to be `y1'. so the last part then becomes `y0 |->* y1' and `y1 |->* y1'. the last thing here wouldn't work, if we didn't include "zero steps" as a possibility. we'd have to try to add one step to both (and that's not always possible, depending on how one sets things up. and setting it up so it's always possible is an extra hassle)
2020-10-06 13:42:41 <ski> yes
2020-10-06 13:42:56 <ski> anyway, this is not category theory
2020-10-06 13:43:34 <ski> (not really set theory, either, although it could use some set theory terminology)
2020-10-06 13:44:10 <carter> Algebraic combinatorics! ;)
2020-10-06 13:44:39 fendor_ joins (~fendor@t204-126.demo.tuwien.ac.at)
2020-10-06 13:45:18 <quazimod1> yeah it didn't feel like category theory but its been a few years since i looked at that, and I never got particularly far into it so idno
2020-10-06 13:45:48 <ski> quazimod1 : anyway, if you're interested, you can look at papers like this. and some of the insights or conclusions can be good to know about, from a more practical programming standpoint. but i wouldn't worry too much about not understanding things in such papers, if you're mainly interested in practical programming (e.g. in Haskell, or some other language)
2020-10-06 13:46:01 fm_ joins (~fm@p2e5335ae.dip0.t-ipconnect.de)
2020-10-06 13:46:39 × fm_ quits (~fm@p2e5335ae.dip0.t-ipconnect.de) (Client Quit)
2020-10-06 13:47:09 <quazimod1> yeah certainly agree with you, i just get interested
2020-10-06 13:47:14 × fendor quits (~fendor@e237-037.eduroam.tuwien.ac.at) (Ping timeout: 272 seconds)
2020-10-06 13:47:22 <ski> (btw, that property with `x',`y0',`y1',`z' above, confluence, is sometimes called "diamond property", since if you draw it in a diagram, it looks like a rhombus)
2020-10-06 13:48:48 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine)
2020-10-06 13:48:57 <ski> one way to think about `R*' is that its like a "list of `R's". so `a R* z' means `a R b /\ b R c /\ c R d /\ ... /\ w R x /\ x R y /\ y R z', for some (possibly zero) number of `R' steps (some "list" of `R's)
2020-10-06 13:49:35 <ski> (`A*' is also a common notation for a (possibly empty) list of elements of `A'. in Haskell, this is `[A]'. and `A+' for non-empty lists)
2020-10-06 13:49:51 fmeyer joins (~fmeyer@p2e5335ae.dip0.t-ipconnect.de)
2020-10-06 13:51:02 × drbean quits (~drbean@TC210-63-209-203.static.apol.com.tw) (Ping timeout: 272 seconds)
2020-10-06 13:51:04 <quazimod1> the binary relation in our case can be anything right?
2020-10-06 13:51:21 <ski> yes
2020-10-06 13:51:24 × fmeyer quits (~fmeyer@p2e5335ae.dip0.t-ipconnect.de) (Client Quit)
2020-10-06 13:51:36 <ski> as long as it's relating two elements from the same set
2020-10-06 13:51:55 Sgeo joins (~Sgeo@ool-18b982ad.dyn.optonline.net)
2020-10-06 13:52:02 fmeyer joins (uid257539@gateway/web/irccloud.com/x-yvvsemtlqrvsuvhi)
2020-10-06 13:52:04 <quazimod1> sure but we're free to choose a suitably diverse set right?
2020-10-06 13:52:11 <ski> yes
2020-10-06 13:52:19 <quazimod1> may i ask why it has to be the same set
2020-10-06 13:52:40 <quazimod1> if they're different sets, do we need to draw a ring around the 2 different sets & make a new set
2020-10-06 13:53:08 Lord_of_Life joins (~Lord@unaffiliated/lord-of-life/x-0885362)
2020-10-06 13:53:33 <ski> the "reflexive-transitive closure" and the "transitive closure" are ways to "make" such binary relations transitive, or both reflexive and transitive, by "adding in more related pairs" (as few as possible), until we get a relation that satisfies the desired property
2020-10-06 13:53:49 <frdg> \join #prolog
2020-10-06 13:54:25 son0p joins (~son0p@181.136.122.143)
2020-10-06 13:54:38 Super_Feeling joins (~Super_Fee@103.108.4.50)
2020-10-06 13:54:43 <ski> quazimod1 : you can do that, if you want to. you'd take the "disjoint/discriminated union" (same things as variant/sum type, and part of "algebraic data type") of the two sets/types, to get one that "includes the elements of both"
2020-10-06 13:54:44 Super_Feeling1 joins (~Super_Fee@103.108.4.50)
2020-10-06 13:54:44 × Super_Feeling1 quits (~Super_Fee@103.108.4.50) (Client Quit)
2020-10-06 13:55:01 <ski> this is what a "bipartite graph" does, for the nodes/vertices, e.g.
2020-10-06 13:55:09 <ski> frdg : haha :)
2020-10-06 13:55:18 <ski> (it's actually ##prolog)
2020-10-06 13:55:50 <frdg> heh thanks
2020-10-06 13:56:30 <Super_Feeling> hey guys, is haskell is the right way to start learning about fp? the syntax is so hard, that i get confused all the time and concepts don't make sense
2020-10-06 13:56:47 <ski> quazimod1 : usually, people would say that you take a "union" of the two sets. but more commonly, that's not what you want. in case there's no common element to the two sets, it makes no difference, but if there might be common elements, then usually you'd want the "sum type" version. in math, people often (clumsily) express this as saying you union a set with "a copy" of another set
2020-10-06 13:57:15 × tbreslein quits (~tbreslein@2a02:8108:140:44f8::3cc4) (Remote host closed the connection)
2020-10-06 13:57:33 <maerwald> Super_Feeling: yes
2020-10-06 13:57:49 <ski> (this is another example of people in mathematics usually conflating subsets (/ material sets) with sets/types/sorts (/ structural sets))
2020-10-06 13:58:19 justan0theruser is now known as justanotheruser
2020-10-06 13:58:23 <ski> Super_Feeling : is Haskell your first programming language ?
2020-10-06 13:59:22 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 2.9)
2020-10-06 13:59:32 <quazimod1> Super_Feeling: are you me?
2020-10-06 13:59:35 <quazimod1> from back in time
2020-10-06 13:59:57 hackage hills 0.1.2.7 - Generate STL models from SRTM elevation data. https://hackage.haskell.org/package/hills-0.1.2.7 (djf)
2020-10-06 14:00:31 <quazimod1> ski: my brain farted when you said that a bartite graph does this
2020-10-06 14:00:39 <ski> heh, why ? :)

All times are in UTC.