Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-21 18:15:52 xiinotulp joins (~q@ppp-223-24-94-215.revip6.asianet.co.th)
2021-03-21 18:16:05 <rybern> edmundnoble sure, it is possible to go too far with modularity, you can get a sort of false generalization.. but sometimes that isn't a problem, and that's the case I'm asking about. E.g. in my applications, I have almost never cared about the order on the stack
2021-03-21 18:16:08 <hpc> leaderCount * 2 > totalCount
2021-03-21 18:16:14 <monochrom> I think "lift2 (<$>) (,) readFile" uses ((->) String) for lift2, and IO for fmap.
2021-03-21 18:16:21 <hpc> or fromIntegral leaderCount > fromIntegral totalCount * 0.5
2021-03-21 18:16:29 <monochrom> I would consider it a smartass solution.
2021-03-21 18:16:59 DevTurks[m] joins (turkdevops@gateway/shell/matrix.org/x-wvhgcgjcsihqdnpv)
2021-03-21 18:17:21 × Vadrigar quits (~Vadrigar@ip5b417208.dynamic.kabel-deutschland.de) (Ping timeout: 246 seconds)
2021-03-21 18:17:54 <Shiranai> monochrom: thanks it was driving me insane that someone can just read that
2021-03-21 18:18:10 <hpc> as long as you aren't counting more than 2**52 votes, using Double instead of Int is probably fine :P
2021-03-21 18:18:26 <ski> maralorn : i guess that i was aiming at was that `foo :: (String,Int) -> Bool' or `foo :: Person -> Bool' with `data Person = MkPerson {name :: String,age :: Int}' would have just as much (or little) claim to being "a function that takes two arguments" as `foo :: String -> (Int -> bool)' does. (and clearly there's a difference between the former two, and "a function that takes one argument and returns a
2021-03-21 18:18:32 <ski> function that accepts another argument"). but i'm sorry if what you meant was consonant with this, and i managed to interpret it otherwise, and make it sound like you didn't
2021-03-21 18:18:37 × CrazyPyt_ quits (~crazypyth@98.122.164.118) ()
2021-03-21 18:18:41 <monochrom> Oh, I have math talent and training, that's how I managed. :)
2021-03-21 18:19:00 ezrakilty joins (~ezrakilty@97-113-58-224.tukw.qwest.net)
2021-03-21 18:19:06 <ski> @where Data61
2021-03-21 18:19:06 <lambdabot> Data61 Functional Programming Course <https://github.com/data61/fp-course>,<https://qfpl.io/links/2017-october-fp-course/> by Tony Morris,Mark Hibberd. Also see the channel #qfpl
2021-03-21 18:19:09 <rybern> anyway, gotta run, thanks for the conversation
2021-03-21 18:19:14 × plutoniix quits (~q@ppp-27-55-75-62.revip3.asianet.co.th) (Ping timeout: 256 seconds)
2021-03-21 18:19:17 <edmundnoble> Ah me too hehe
2021-03-21 18:19:29 × rybern quits (18c25abd@cpe-24-194-90-189.nycap.res.rr.com) (Quit: Connection closed)
2021-03-21 18:19:33 <edmundnoble> I think we were getting somewhere, too
2021-03-21 18:20:06 <monochrom> ski, data61 is once again renamed to system-f because the company is now called system-f, it may be a different company or it may be a spinoff of data61 or ...
2021-03-21 18:20:10 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
2021-03-21 18:20:24 <ski> hm. i forget what the previous name was
2021-03-21 18:20:31 <monochrom> I have decided to just call it "the Morris course" because that's the only real invariant.
2021-03-21 18:20:40 <monochrom> nicta
2021-03-21 18:20:45 <ski> oh, right
2021-03-21 18:20:57 × chenshen quits (~chenshen@2620:10d:c090:400::5:1038) (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
2021-03-21 18:21:10 <ski> @where NICTA
2021-03-21 18:21:11 <lambdabot> https://github.com/nicta/course
2021-03-21 18:21:14 <monochrom> http://www.vex.net/~trebla/haskell/learn-sources.html#problem-set-by-tony-morris-et-al. :)
2021-03-21 18:21:36 pavonia joins (~user@unaffiliated/siracusa)
2021-03-21 18:22:29 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-03-21 18:22:44 ski . o O ( "QFPL lives in UTC+10 and speaks Zulu time. | UBT ~ Unethical Brisbane Time. There is a possibility that it is UTC+10" )
2021-03-21 18:23:09 × __minoru__shirae quits (~shiraeesh@77.94.25.47) (Ping timeout: 256 seconds)
2021-03-21 18:23:37 __minoru__shirae joins (~shiraeesh@77.94.25.47)
2021-03-21 18:25:17 <monochrom> Shiranai: And I should be saying ((->) FilePath) instead of ((->) String) for better clarity.
2021-03-21 18:26:37 <monochrom> It is a bit sad that FilePath and String are the same thing, so (filename, filecontent) and (filecontent, filename) have the same type, so if you use the wrong order you won't notice it.
2021-03-21 18:26:59 <Shiranai> monochrom: hey I've tried to parse the types of the function earlier and I'm stucked: `:t lift2 (<$>)` gets me `lift2 (<$>) :: (Applicative k1, Functor k2) => k1 (a -> b) -> k1 (k2 a) -> k1 (k2 b)`. Replacing k1 here with `(->) a` I get `lift2 (<$>) :: (Functor k) => (a -> (a -> b)) -> (a -> (k a)) -> (a -> (k2 b))`
2021-03-21 18:27:06 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2021-03-21 18:27:27 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-03-21 18:27:36 <Shiranai> but here `(,) :: a -> b -> (a, b)`
2021-03-21 18:27:44 <edmundnoble> You're mixing up your `a`'s
2021-03-21 18:28:01 <Shiranai> so they don't seem to fit
2021-03-21 18:28:08 <monochrom> Consider (,) :: FilePath -> String -> (FilePath, String)
2021-03-21 18:28:12 <edmundnoble> There are two unrelated type variables in the "replaced" type signature you gave for lift2
2021-03-21 18:28:37 <edmundnoble> That have the same name, a
2021-03-21 18:28:41 <Shiranai> edmundnoble: so k` is not `(->) a` but say `(-> c)`?
2021-03-21 18:28:59 <edmundnoble> That would help yes
2021-03-21 18:28:59 <monochrom> a = String = FilePath. b = (FilePath, String). k = k2 = IO
2021-03-21 18:29:22 × Lycurgus quits (~niemand@98.4.116.165) (Quit: Exeunt)
2021-03-21 18:30:22 <Shiranai> Ok then following monochrom `lift2 (<$>) :: (Functor k) => (FilePath -> (FilePath -> (FilePath, String)) -> (FilePath -> (IO FilePath)) -> (FilePath -> (IO (FilePath, String)))`
2021-03-21 18:30:48 <monochrom> This is why I call it a smartass solution.
2021-03-21 18:30:59 <Shiranai> ohhh but they are using the fact that FilePath = string
2021-03-21 18:31:05 <Shiranai> that's kinda cheating
2021-03-21 18:31:32 <Shiranai> or am I understanding incorrectly?
2021-03-21 18:31:45 <monochrom> You are understanding it perfectly now.
2021-03-21 18:32:05 minoru_shiraeesh joins (~shiraeesh@109.166.57.171)
2021-03-21 18:32:36 <Shiranai> haha doubt it but I think I'm closer now, key thing I was missing is `b` is `(FilePath, String)`, thank you again!
2021-03-21 18:32:57 × __minoru__shirae quits (~shiraeesh@77.94.25.47) (Ping timeout: 264 seconds)
2021-03-21 18:33:16 × frozenErebus quits (~frozenEre@94.129.70.18) (Ping timeout: 276 seconds)
2021-03-21 18:34:05 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2021-03-21 18:34:25 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-03-21 18:37:03 ixlun joins (~matthew@109.249.184.133)
2021-03-21 18:37:45 <hololeap> :t liftA2 (<$>) (,)
2021-03-21 18:37:47 <lambdabot> Functor f => (a1 -> f a2) -> a1 -> f (a1, a2)
2021-03-21 18:39:38 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds)
2021-03-21 18:40:41 chenshen joins (~chenshen@2620:10d:c090:400::5:1038)
2021-03-21 18:41:47 <joel135> Is this some strength thing?
2021-03-21 18:42:21 × darjeeling_ quits (~darjeelin@122.245.217.128) (Ping timeout: 265 seconds)
2021-03-21 18:44:38 <joel135> Hm! "Applicative functors are the programming equivalent of lax monoidal functors with tensorial strength in category theory." Didn't know that.
2021-03-21 18:45:45 <ski> looks like `strength' with `graph'
2021-03-21 18:46:42 × tenniscp25 quits (~tenniscp2@134.196.209.118) ()
2021-03-21 18:48:21 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-03-21 18:48:41 <ski> @let graph :: Arrow ar => ar a b -> ar a (a,b); graph f = arr id &&& f; cograph :: ArrowChoice ar => ar a b -> ar (Either a b) b; cograph f = f ||| arr id
2021-03-21 18:48:43 <lambdabot> Defined.
2021-03-21 18:49:02 <joel135> What's graph?
2021-03-21 18:49:10 <joel135> Oh
2021-03-21 18:49:12 Pickchea joins (~private@unaffiliated/pickchea)
2021-03-21 18:49:33 <ski> the graph of a morphism, as a subobject of the product of its domain and codomain
2021-03-21 18:49:38 <unyu> Never mind “graph”, what exactly is a “cograph”?
2021-03-21 18:50:10 <ski> the corresponding factor object of the coproduct of the domain and codomain of a morphism
2021-03-21 18:50:21 <unyu> Oh, you meant “graph” in the sense of “graph of a function”, rather than graph theory's graphs...
2021-03-21 18:50:28 <ski> yes
2021-03-21 18:50:52 <ski> a cograph is more or less a table of input-output mappings of a function
2021-03-21 18:51:40 <ski> or, depicting the domain and codomain as two ovals, or lines, with arrows from one to the other indicating the individual element mappings
2021-03-21 18:52:24 <ski> putting each element of the codomain into an equivalence class with the elements of the domain mapping to it (construing the domain and codomain to be disjoint), gives you the factor object
2021-03-21 18:53:04 ph88 joins (~ph88@2a02:8109:9e00:7e5c:d4b6:e9e6:3cda:8e26)
2021-03-21 18:53:13 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2021-03-21 18:53:31 <unyu> When you say “factor object”, do you mean “quotient object”?
2021-03-21 18:53:34 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-03-21 18:53:38 <ski> (so, regarding the "maps to" arrows as graph edges (in the other sense of "graph"), you're taking the connected components)
2021-03-21 18:53:43 <ski> yes, that's the same thing
2021-03-21 18:53:53 <unyu> Your use of the term “factor” somehow reminded me of exact sequences...
2021-03-21 18:54:02 malumore joins (~malumore@151.62.127.88)
2021-03-21 18:55:13 darjeeling_ joins (~darjeelin@122.245.208.187)
2021-03-21 18:55:40 motersen joins (~user@2001-4dd1-d88a-0-5338-d0f4-6eda-2a0f.ipv6dyn.netcologne.de)
2021-03-21 18:56:41 <ski> (but i dislike the term "quotient" in this context, since it's not a quotient really. it corresponds to the multiplier, not to the multiplicand, in a multiplication. consider e.g. normal subgroups and corresponding factor groups. the normal subgroup is the multiplicand (which is "replicated"), the factor group is the multiplier/quotient (the "pattern"/"count" of the replication). see
2021-03-21 18:56:47 <ski> <https://en.wikipedia.org/wiki/Quotition_and_partition>)

All times are in UTC.