Logs: freenode/#haskell
| 2020-10-28 22:17:32 | <jle`> | i thiiink it should be possible actually |
| 2020-10-28 22:17:32 | <koz_> | I mean, yeah. Your starting value is the mempty. |
| 2020-10-28 22:17:38 | <jle`> | just use foldM to get [m a] |
| 2020-10-28 22:17:42 | <jle`> | and foldMapA id |
| 2020-10-28 22:17:45 | <koz_> | Lol. |
| 2020-10-28 22:17:47 | <koz_> | Ah yes. |
| 2020-10-28 22:17:51 | <koz_> | 'Hack everythign into list'. |
| 2020-10-28 22:18:00 | <koz_> | Aka 'how all of Foldable works'. |
| 2020-10-28 22:18:50 | <koz_> | Although realistically, by its very nature, 'toList' falls out of Traversable even if Foldable weren't a thing. |
| 2020-10-28 22:19:29 | <koz_> | (or heck, toX, where X is some linear collection with concatenation and emptiness as concepts) |
| 2020-10-28 22:19:45 | <koz_> | (or heck, it doesn't even technically have to be a _linear_ collection) |
| 2020-10-28 22:19:54 | → | matt57 joins (d57a8ff0@host213-122-143-240.range213-122.btcentralplus.com) |
| 2020-10-28 22:24:08 | × | __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving) |
| 2020-10-28 22:24:18 | <jle`> | yeah, Foldable is baby Traversable :) |
| 2020-10-28 22:25:16 | <koz_> | And basically, we get 'emptiness and concatenation' as a special case of Monoid. |
| 2020-10-28 22:25:29 | <koz_> | Basically, it really is all traverse and monoids all the way down. |
| 2020-10-28 22:25:33 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 2020-10-28 22:27:22 | × | remexre quits (~nathan@207-153-38-50.fttp.usinternet.com) (Read error: Connection reset by peer) |
| 2020-10-28 22:28:21 | → | britva joins (~britva@2a02:aa13:7240:2980:1ce4:625f:f093:45ef) |
| 2020-10-28 22:30:24 | × | ichimaru quits (~ichimaru@45.63.97.131) (Quit: ichimaru) |
| 2020-10-28 22:31:13 | → | remexre joins (~nathan@207-153-38-50.fttp.usinternet.com) |
| 2020-10-28 22:37:05 | × | son0p quits (~son0p@181.136.122.143) (Quit: Lost terminal) |
| 2020-10-28 22:37:22 | × | matt57 quits (d57a8ff0@host213-122-143-240.range213-122.btcentralplus.com) (Remote host closed the connection) |
| 2020-10-28 22:39:25 | × | bitmagie quits (~Thunderbi@200116b8069fbf008d925686a233d598.dip.versatel-1u1.de) (Quit: bitmagie) |
| 2020-10-28 22:39:34 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-10-28 22:39:52 | × | knupfer quits (~Thunderbi@200116b82c88900065f627a2dcebe201.dip.versatel-1u1.de) (Remote host closed the connection) |
| 2020-10-28 22:40:01 | → | knupfer joins (~Thunderbi@200116b82c88900041e2bae31fea6a53.dip.versatel-1u1.de) |
| 2020-10-28 22:40:29 | → | christo joins (~chris@81.96.113.213) |
| 2020-10-28 22:44:56 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-10-28 22:45:07 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 265 seconds) |
| 2020-10-28 22:45:44 | → | day joins (~Unknown@unaffiliated/day) |
| 2020-10-28 22:47:48 | × | fendor quits (~fendor@91.141.3.89.wireless.dyn.drei.com) (Remote host closed the connection) |
| 2020-10-28 22:48:24 | × | cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Quit: leaving) |
| 2020-10-28 22:48:44 | → | mmohammadi9812 joins (~mmohammad@2.178.160.31) |
| 2020-10-28 22:50:44 | × | justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 240 seconds) |
| 2020-10-28 22:53:24 | → | p8m joins (p8m@gateway/vpn/protonvpn/p8m) |
| 2020-10-28 22:55:49 | × | vk3wtf quits (~doc@14-202-30-62.static.tpgi.com.au) (Quit: WeeChat 2.7.1) |
| 2020-10-28 22:56:20 | → | vk3wtf joins (~doc@14-202-30-62.static.tpgi.com.au) |
| 2020-10-28 22:57:37 | × | DataComputist quits (~lumeng@static-50-43-26-251.bvtn.or.frontiernet.net) (Quit: Leaving...) |
| 2020-10-28 22:58:07 | × | xsperry quits (~as@unaffiliated/xsperry) () |
| 2020-10-28 22:58:49 | × | jakob_ quits (~textual@p200300f49f1622000181680b896afdc3.dip0.t-ipconnect.de) (Quit: My Laptop has gone to sleep. ZZZzzz…) |
| 2020-10-28 22:59:32 | → | jakob_ joins (~textual@p57b0eae0.dip0.t-ipconnect.de) |
| 2020-10-28 22:59:52 | × | crestfallen quits (~john@128.32.176.159) (Quit: Leaving) |
| 2020-10-28 23:01:55 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving) |
| 2020-10-28 23:06:09 | → | crestfallen joins (~john@128.32.176.159) |
| 2020-10-28 23:06:25 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:1c75:523e:ddcb:cd98) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-28 23:06:52 | × | britva quits (~britva@2a02:aa13:7240:2980:1ce4:625f:f093:45ef) (Quit: This computer has gone to sleep) |
| 2020-10-28 23:07:26 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:1c75:523e:ddcb:cd98) |
| 2020-10-28 23:09:35 | × | errst quits (~errst@unaffiliated/tirej) (Quit: Lost terminal) |
| 2020-10-28 23:10:56 | → | britva joins (~britva@2a02:aa13:7240:2980:1ce4:625f:f093:45ef) |
| 2020-10-28 23:11:37 | → | ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) |
| 2020-10-28 23:12:27 | × | knupfer quits (~Thunderbi@200116b82c88900041e2bae31fea6a53.dip.versatel-1u1.de) (Ping timeout: 268 seconds) |
| 2020-10-28 23:15:41 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:1c75:523e:ddcb:cd98) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-28 23:15:49 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2020-10-28 23:16:00 | → | Tario joins (~Tario@201.192.165.173) |
| 2020-10-28 23:16:04 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2020-10-28 23:17:10 | <crestfallen> | Hi .. I understand most of this paste. it clarifies that (->) is not a morphism (I guess a morphism cannot be binary?) ; and that fmap for Functor (-> r) is composition. So generally fmap is a morphism, perhaps the most basic one? https://termbin.com/evcw |
| 2020-10-28 23:17:43 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 2020-10-28 23:18:40 | <crestfallen> | I see how the expansion of (->) r (fmap) is composition. |
| 2020-10-28 23:19:04 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-10-28 23:21:02 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection) |
| 2020-10-28 23:21:35 | <crestfallen> | so my question is, if the above is correct, are there morphisms more simple than fmap? |
| 2020-10-28 23:21:59 | × | britva quits (~britva@2a02:aa13:7240:2980:1ce4:625f:f093:45ef) (Quit: This computer has gone to sleep) |
| 2020-10-28 23:22:10 | <bsima> | how do i convert a Decimal to a Float or Int? |
| 2020-10-28 23:22:17 | × | ulidtko|k quits (~ulidtko@193.111.48.79) (Remote host closed the connection) |
| 2020-10-28 23:22:33 | <Axman6> | what's a Decimal? |
| 2020-10-28 23:22:36 | → | ulidtko|k joins (~ulidtko@193.111.48.79) |
| 2020-10-28 23:22:38 | <bsima> | Data.Decimal |
| 2020-10-28 23:22:39 | <ghoulguy> | probably: realToFrac and truncate |
| 2020-10-28 23:22:56 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:1c75:523e:ddcb:cd98) |
| 2020-10-28 23:23:06 | <ghoulguy> | truncate or round, depending on which behavior you want |
| 2020-10-28 23:23:39 | <Axman6> | :t realToFrac |
| 2020-10-28 23:23:40 | <lambdabot> | (Real a, Fractional b) => a -> b |
| 2020-10-28 23:24:21 | <crestfallen> | or are there morphisms I've probably come across before? |
| 2020-10-28 23:24:27 | <bsima> | i think realToFrac is what I wanted, thanks |
| 2020-10-28 23:24:48 | × | falafel quits (~falafel@71-34-132-121.clsp.qwest.net) (Ping timeout: 272 seconds) |
| 2020-10-28 23:25:34 | <crestfallen> | also I'm trying to see if and how (->) r is partial application |
| 2020-10-28 23:25:58 | <crestfallen> | a bit confused.. |
| 2020-10-28 23:26:41 | <Axman6> | it's a partial application of the type (->) but doesn't represent partial application of functions to values - ((->) r) is all functions which can accept an r |
| 2020-10-28 23:26:43 | <lyxia> | crestfallen: I'm not sure what you mean by "morphism" |
| 2020-10-28 23:27:03 | <crestfallen> | https://termbin.com/evcw lyxia it's the blurb at the top |
| 2020-10-28 23:27:45 | <crestfallen> | all functions which can accept an r Axman6 ... |
| 2020-10-28 23:27:53 | <lyxia> | crestfallen: I don't find that paste particularly good, notably because it starts by using the word "morphism" in an unconventional way, if it makes sense at all. |
| 2020-10-28 23:28:23 | <crestfallen> | really ok. lyxia thanks, what about below the paragraph though? |
| 2020-10-28 23:29:47 | → | falafel joins (~falafel@71-34-132-121.clsp.qwest.net) |
| 2020-10-28 23:30:17 | <lyxia> | The important part is that ((->) r) is a mapping from types to types, that's the first condition for something to be in the Functor class in Haskell. |
| 2020-10-28 23:30:59 | × | christo quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2020-10-28 23:31:15 | <lyxia> | But it's worth mentioning that the Functor class in Haskell is itself a restriction of amuch more general idea of functors in category theory, where they don't necessarily map types to types. |
| 2020-10-28 23:31:49 | → | mdrjr1 joins (~mdrjr@217.146.82.202) |
| 2020-10-28 23:32:25 | <lyxia> | So this paragraph is talking in terms of categories about the very restricted notion of Functor in Haskell, that's bound to mix up ideas and confuse people. |
| 2020-10-28 23:32:44 | <crestfallen> | yeah, i.e. an object doesn't need to be a type. like it can be a group I think lyxia |
| 2020-10-28 23:32:51 | × | Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection) |
| 2020-10-28 23:33:13 | × | ChaiTRex quits (~ChaiTRex@gateway/tor-sasl/chaitrex) (Quit: ChaiTRex) |
| 2020-10-28 23:33:30 | → | ChaiTRex joins (~ChaiTRex@gateway/tor-sasl/chaitrex) |
| 2020-10-28 23:35:04 | → | christo joins (~chris@81.96.113.213) |
| 2020-10-28 23:36:34 | <monsterchrom> | Who wrote that? |
| 2020-10-28 23:36:43 | × | Unhammer quits (~Unhammer@gateway/tor-sasl/unhammer) (Ping timeout: 240 seconds) |
| 2020-10-28 23:36:56 | <crestfallen> | thanks lyxia and Axman6 monsterchrom one sec |
| 2020-10-28 23:37:33 | <lyxia> | monsterchrom: did you change your nick |
| 2020-10-28 23:37:41 | <monsterchrom> | There is a reason in a 1st-year linear algebra course we don't go "use the Yoneda lemma to prove that every elementary row operation is representable by multiplying by a matrix", even though it is totally true. |
All times are in UTC.