2025/02/11

Newest at the top

2025-02-11 19:31:44 +0100 <EvanR> the next in the pattern would be something of the form (Traversable t, Functor f) => t (f a) -> f (t a)
2025-02-11 19:31:30 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) TheCoffeMaker
2025-02-11 19:30:53 +0100 <monochrom> OK yeah sequenceA.
2025-02-11 19:30:52 +0100 <haskellbridge> <alexfmpe> * only works when there's
2025-02-11 19:30:42 +0100 <lambdabot> (Traversable t, Applicative f) => t (f a) -> f (t a)
2025-02-11 19:30:41 +0100 <EvanR> :t sequenceA
2025-02-11 19:30:36 +0100 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
2025-02-11 19:30:35 +0100 <EvanR> :t sequence
2025-02-11 19:30:30 +0100jespada(~jespada@2800:a4:2230:3e00:3974:82a3:7f20:1404) jespada
2025-02-11 19:29:41 +0100 <monochrom> If you accept sequence, then traverse is just sequence and fmap.
2025-02-11 19:29:32 +0100 <haskellbridge> <alexfmpe> * suitable combining
2025-02-11 19:29:25 +0100JeremyB99(~JeremyB99@2607:fb90:d362:29:704c:ca03:6a71:2d6c) (Ping timeout: 268 seconds)
2025-02-11 19:29:22 +0100 <monochrom> You can then go ambitious and say "but liftA10 is always 10. can I make it variable length?". Answer: sequence accepts an arbitary list so it's variable length. (The compromise is that we only have homogeneous lists, so the input list has to be homogeneous, whereas liftA10 is OK with 10 different types.)
2025-02-11 19:29:15 +0100 <haskellbridge> Traverse is fmap followed by sequence, so it's kind of foldMap with applicative
2025-02-11 19:29:13 +0100 <haskellbridge> <alexfmpe> Yeah, I'd say sequence is basically folding with applicative, but with a fold function that preserves the original structure.
2025-02-11 19:27:34 +0100 <monochrom> Remember how you can DIY liftA10, liftA11, liftA12 etc by pure and a lot of liftA2?
2025-02-11 19:27:04 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) peterbecich
2025-02-11 19:26:52 +0100 <monochrom> It may be useful motivate why one would want it.
2025-02-11 19:26:32 +0100 <monochrom> If I'm allowed to illustrate sequence instead: sequence [foo, goo, hoo] = liftA2 (:) foo (liftA2 (:) goo (liftA2 (:) hoo (pure [])))))
2025-02-11 19:25:48 +0100ljdarj(~Thunderbi@user/ljdarj) ljdarj
2025-02-11 19:25:40 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2025-02-11 19:24:48 +0100lisbeths(uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-02-11 19:24:18 +0100JeremyB99(~JeremyB99@2607:fb90:d362:29:704c:ca03:6a71:2d6c)
2025-02-11 19:24:09 +0100JeremyB99(~JeremyB99@172.59.98.128) (Remote host closed the connection)
2025-02-11 19:23:50 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) (Remote host closed the connection)
2025-02-11 19:23:46 +0100 <justsomeguy> Maybe I just have to write it out on paper.
2025-02-11 19:23:32 +0100 <justsomeguy> At this point the examples make sense, but I'm not sure how they evaluate.
2025-02-11 19:22:37 +0100JeremyB99(~JeremyB99@172.59.98.128)
2025-02-11 19:21:46 +0100 <monochrom> If it helps: traverse is impure fmap.
2025-02-11 19:21:14 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-11 19:20:19 +0100Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-02-11 19:18:05 +0100 <EvanR> a generalization of mapM
2025-02-11 19:17:49 +0100lockywolf(~lockywolf@coconut.lockywolf.net) lockywolf
2025-02-11 19:16:54 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2025-02-11 19:16:44 +0100jespada(~jespada@2800:a4:2230:3e00:3974:82a3:7f20:1404) (Quit: My Mac has gone to sleep. ZZZzzz…)
2025-02-11 19:15:12 +0100 <ncf> or https://en.wikibooks.org/wiki/Haskell/Traversable
2025-02-11 19:14:37 +0100 <ncf> justsomeguy: did you see https://wiki.haskell.org/Typeclassopedia#Traversable ?
2025-02-11 19:12:37 +0100 <justsomeguy> Can someone help me understand what Traversable is all about?
2025-02-11 19:11:35 +0100justsomeguy(~justsomeg@user/justsomeguy) justsomeguy
2025-02-11 19:11:15 +0100JeremyB99(~JeremyB99@pal-210-106-73.itap.purdue.edu) (Read error: Connection reset by peer)
2025-02-11 19:10:15 +0100Anushka(~Anushka@101.0.63.190) (Quit: Client closed)
2025-02-11 19:10:12 +0100alfiee(~alfiee@user/alfiee) (Ping timeout: 244 seconds)
2025-02-11 19:08:50 +0100JeremyB99(~JeremyB99@pal-210-106-73.itap.purdue.edu)
2025-02-11 19:07:47 +0100Googulator(~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu)
2025-02-11 19:07:31 +0100Googulator(~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed)
2025-02-11 19:05:59 +0100alfiee(~alfiee@user/alfiee) alfiee
2025-02-11 19:05:47 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-02-11 19:05:23 +0100lxsameer(~lxsameer@Serene/lxsameer) (Ping timeout: 245 seconds)
2025-02-11 18:59:38 +0100misterfish(~misterfis@84.53.85.146) (Ping timeout: 252 seconds)
2025-02-11 18:59:14 +0100lockywolf(~lockywolf@coconut.lockywolf.net) (Ping timeout: 248 seconds)