2024-06-30 00:00:12 +0200 | <geekosaur> | I'll agree with that |
2024-06-30 00:00:34 +0200 | <geekosaur> | for that matter, I have no formal CS training and barely any programming training (I once took a fortran course) |
2024-06-30 00:01:27 +0200 | <zzz> | that being said, i recognise the importance of knowing |
2024-06-30 00:02:21 +0200 | <geekosaur> | but in this case, I'll also argue that many of the rules you have to know about aren't just from the Report; they're from how early GHC devs chose to implement them and the resulting technical debt |
2024-06-30 00:02:30 +0200 | <geekosaur> | cf. Integer behavior |
2024-06-30 00:02:52 +0200 | <geekosaur> | and you can't get that even from the GHC manual |
2024-06-30 00:04:12 +0200 | <geekosaur> | much of it you have to get by reading the source to the ghc-bignum package |
2024-06-30 00:05:21 +0200 | <geekosaur> | which you won't even know about unless you get curious about ghc-pkg --global output, or pay very close attention to ghc release notes |
2024-06-30 00:07:29 +0200 | aaronv | (~aaronv@user/aaronv) (Ping timeout: 268 seconds) |
2024-06-30 00:11:00 +0200 | aaronv | (~aaronv@user/aaronv) |
2024-06-30 00:11:48 +0200 | mikess | (~mikess@user/mikess) (Ping timeout: 268 seconds) |
2024-06-30 00:16:26 +0200 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2024-06-30 00:38:19 +0200 | emm | (~emm@user/edmeme) (Ping timeout: 268 seconds) |
2024-06-30 00:46:10 +0200 | xdminsy | (~xdminsy@117.147.70.231) (Quit: Konversation terminated!) |
2024-06-30 00:46:24 +0200 | aaronv | (~aaronv@user/aaronv) (Remote host closed the connection) |
2024-06-30 00:46:36 +0200 | xdminsy | (~xdminsy@117.147.70.231) |
2024-06-30 00:46:43 +0200 | aaronv | (~aaronv@user/aaronv) |
2024-06-30 00:48:30 +0200 | mikess | (~mikess@user/mikess) |
2024-06-30 01:01:07 +0200 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
2024-06-30 01:07:11 +0200 | mikess | (~mikess@user/mikess) (Ping timeout: 264 seconds) |
2024-06-30 01:10:53 +0200 | acidjnk_new3 | (~acidjnk@p200300d6e714dc64f17ffbaa6306596b.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2024-06-30 01:17:10 +0200 | aaronv | (~aaronv@user/aaronv) (Ping timeout: 268 seconds) |
2024-06-30 01:17:59 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-06-30 01:27:20 +0200 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-06-30 01:28:32 +0200 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2024-06-30 01:29:25 +0200 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 256 seconds) |
2024-06-30 01:30:58 +0200 | aaronv | (~aaronv@user/aaronv) |
2024-06-30 01:34:48 +0200 | justsomeguy | (~justsomeg@user/justsomeguy) |
2024-06-30 01:41:01 +0200 | madeleine-sydney | (~madeleine@c-71-229-185-228.hsd1.co.comcast.net) (Remote host closed the connection) |
2024-06-30 01:42:10 +0200 | alexherbo2 | (~alexherbo@2a02-8440-3216-58a7-4198-eabe-8a40-71c0.rev.sfr.net) (Remote host closed the connection) |
2024-06-30 01:55:06 +0200 | OscarZ | (~oscarz@mobile-access-5d6ab7-137.dhcp.inet.fi) |
2024-06-30 01:55:16 +0200 | pavonia | (~user@user/siracusa) (Read error: Connection reset by peer) |
2024-06-30 01:57:52 +0200 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2024-06-30 01:59:01 +0200 | pavonia | (~user@user/siracusa) |
2024-06-30 02:01:48 +0200 | OscarZ | (~oscarz@mobile-access-5d6ab7-137.dhcp.inet.fi) (Quit: Leaving) |
2024-06-30 02:14:40 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-06-30 02:25:30 +0200 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-06-30 02:26:23 +0200 | mhatta | (~mhatta@www21123ui.sakura.ne.jp) (Remote host closed the connection) |
2024-06-30 02:29:07 +0200 | onliner10_ | (uid656258@user/onliner10) (Quit: Connection closed for inactivity) |
2024-06-30 02:32:53 +0200 | mhatta | (~mhatta@www21123ui.sakura.ne.jp) |
2024-06-30 02:39:02 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2024-06-30 02:39:30 +0200 | califax | (~califax@user/califx) (Remote host closed the connection) |
2024-06-30 02:41:04 +0200 | califax | (~califax@user/califx) |
2024-06-30 02:44:44 +0200 | ft | (~ft@i5C743B07.versanet.de) (Ping timeout: 268 seconds) |
2024-06-30 02:45:59 +0200 | ft | (~ft@mue-88-130-107-007.dsl.tropolys.de) |
2024-06-30 02:46:51 +0200 | phma | (~phma@host-67-44-208-9.hnremote.net) (Read error: Connection reset by peer) |
2024-06-30 02:47:20 +0200 | phma | (~phma@2001:5b0:215d:ae38:bf89:58e8:737e:e16c) |
2024-06-30 02:51:49 +0200 | hololeap | progress-bot |
2024-06-30 02:52:35 +0200 | progress-bot | hololeap |
2024-06-30 03:13:17 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 240 seconds) |
2024-06-30 03:17:41 +0200 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 240 seconds) |
2024-06-30 03:25:03 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-06-30 03:26:04 +0200 | mikess | (~mikess@user/mikess) |
2024-06-30 03:33:42 +0200 | rvalue | (~rvalue@user/rvalue) |
2024-06-30 03:35:50 +0200 | nek0 | (~nek0@user/nek0) |
2024-06-30 03:45:19 +0200 | dcoutts | (~duncan@2a02:8012:ae9a:0:9a7e:1cf5:7c51:c650) (Ping timeout: 246 seconds) |
2024-06-30 03:47:48 +0200 | dcoutts | (~duncan@2a02:8012:ae9a:0:9a7e:1cf5:7c51:c650) |
2024-06-30 03:51:22 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-06-30 03:57:13 +0200 | rosco | (~rosco@175.136.155.137) |
2024-06-30 04:05:04 +0200 | op_4 | (~tslil@user/op-4/x-9116473) (Remote host closed the connection) |
2024-06-30 04:05:35 +0200 | op_4 | (~tslil@user/op-4/x-9116473) |
2024-06-30 04:08:25 +0200 | nadja | (~dequbed@banana-new.kilobyte22.de) (Ping timeout: 246 seconds) |
2024-06-30 04:09:19 +0200 | nadja | (~dequbed@banana-new.kilobyte22.de) |
2024-06-30 04:10:56 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2024-06-30 04:11:33 +0200 | dyniec | (~dyniec@dybiec.info) (Quit: WeeChat 4.2.2) |
2024-06-30 04:12:55 +0200 | aaronv | (~aaronv@user/aaronv) (Ping timeout: 268 seconds) |
2024-06-30 04:14:47 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-06-30 04:17:43 +0200 | aaronv | (~aaronv@user/aaronv) |
2024-06-30 04:28:23 +0200 | joeyadams | (~joeyadams@2603:6010:5100:2ed:77d8:7bd:e37b:39ff) |
2024-06-30 04:32:55 +0200 | aaronv | (~aaronv@user/aaronv) (Ping timeout: 272 seconds) |
2024-06-30 04:33:29 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) |
2024-06-30 04:37:42 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) (Client Quit) |
2024-06-30 04:38:03 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) |
2024-06-30 04:42:30 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) (Client Quit) |
2024-06-30 04:42:45 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) |
2024-06-30 04:44:23 +0200 | td_ | (~td@i5387091C.versanet.de) (Ping timeout: 264 seconds) |
2024-06-30 04:45:50 +0200 | td_ | (~td@i5387093F.versanet.de) |
2024-06-30 04:54:55 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) (Quit: leaving) |
2024-06-30 04:55:53 +0200 | nhar | (~noah@c-73-237-54-185.hsd1.ga.comcast.net) |
2024-06-30 04:57:23 +0200 | bilegeek | (~bilegeek@2600:1008:b057:7524:18e9:1f68:5cd:444a) |
2024-06-30 04:59:01 +0200 | <nhar> | hello world! |
2024-06-30 04:59:36 +0200 | <nhar> | is this the right place to ask questions? |
2024-06-30 05:03:40 +0200 | aaronv | (~aaronv@user/aaronv) |
2024-06-30 05:04:49 +0200 | <mauke> | well, one of them |
2024-06-30 05:05:00 +0200 | <mauke> | (hopefully they're haskell related) |
2024-06-30 05:05:45 +0200 | <nhar> | oh good! My setup works! (first time IRC user...wasn't sure my Nix setup worked). |
2024-06-30 05:05:53 +0200 | <nhar> | I do have a Haskell question though: |
2024-06-30 05:06:25 +0200 | <nhar> | I am trying to write a function with the following type: traverseJoin :: (Monad t, Traversable t, Applicative f) => (a -> f (t b)) -> t a -> m (t b) |
2024-06-30 05:07:30 +0200 | <mauke> | that looks wrong, even without the typo |
2024-06-30 05:08:02 +0200 | <nhar> | How so? I'm not trying to write an instance for `traverse` if that's what you mean |
2024-06-30 05:08:21 +0200 | <mauke> | where does that m come from? |
2024-06-30 05:08:40 +0200 | <nhar> | that's a typo, it should be f |
2024-06-30 05:08:54 +0200 | <mauke> | ah |
2024-06-30 05:09:14 +0200 | <nhar> | essientially I'm looking for something that optimizes: join <$> traverse f x |
2024-06-30 05:11:53 +0200 | <joeyadams> | :t \f x -> join <$> traverse f x |
2024-06-30 05:11:54 +0200 | <lambdabot> | (Monad m, Traversable m, Applicative f) => (a1 -> f (m a2)) -> m a1 -> f (m a2) |
2024-06-30 05:14:29 +0200 | <joeyadams> | :t concatMap |
2024-06-30 05:14:30 +0200 | <lambdabot> | Foldable t => (a -> [b]) -> t a -> [b] |
2024-06-30 05:19:22 +0200 | <joeyadams> | So are you asking if there's a generalized concatMap that isn't specialized to returning a list? |
2024-06-30 05:20:54 +0200 | <nhar> | kind of. I am looking for something that is like traverse but instead of the function returning pure values wrapped in the Applicative it returns new sub-trees of the data structure your traverse that would be stitched in "on the way up" |
2024-06-30 05:21:21 +0200 | <nhar> | traverse (f :: a -> m (t b)) x :: m (t (t b)) |
2024-06-30 05:21:49 +0200 | <nhar> | and so join <$> traverse f x :: m (t b) |
2024-06-30 05:22:03 +0200 | madhavanmiui | (~madhavanm@2409:40f4:1030:9d51:8000::) |
2024-06-30 05:22:13 +0200 | <nhar> | the `join <$>` part has to crawl through t again just to perform the join |
2024-06-30 05:27:44 +0200 | robertm | (robertm@lattice.rojoma.com) (Quit: WeeChat 3.8) |
2024-06-30 05:30:19 +0200 | robertm | (robertm@lattice.rojoma.com) |
2024-06-30 05:34:02 +0200 | <joeyadams> | To make this easier to think about, I'll specialize f to [] and t to Tree, giving: traverseJoin :: (a -> [Tree b]) -> Tree a -> [Tree b] |
2024-06-30 05:34:47 +0200 | <nhar> | good idea |
2024-06-30 05:35:37 +0200 | madhavanmiui | (~madhavanm@2409:40f4:1030:9d51:8000::) (Quit: Quit) |
2024-06-30 05:35:45 +0200 | <Leary> | nhar: Perhaps you can use `Monoid (t b)` rather than `Monad t`? |
2024-06-30 05:35:51 +0200 | <Leary> | :t \f -> getAp . foldMap (Ap . f) |
2024-06-30 05:35:52 +0200 | <lambdabot> | forall k (t :: * -> *) (f :: k -> *) (a1 :: k) a2. (Foldable t, Monoid (Ap f a1)) => (a2 -> f a1) -> t a2 -> f a1 |
2024-06-30 05:39:31 +0200 | <nhar> | that kind of works..however: instance (Applicative f, Monoid a1) => Monoid (Ap f a1) |
2024-06-30 05:39:54 +0200 | <nhar> | that would require a Monoid instance for `b` in my signature for traverseJoin |
2024-06-30 05:41:25 +0200 | <Leary> | Not if `Monoid (t b)` is satisfied regardless of `b`. |
2024-06-30 05:42:39 +0200 | justsomeguy | (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.6) |
2024-06-30 05:43:14 +0200 | <Leary> | The other option is Alternative. |
2024-06-30 05:43:17 +0200 | <Leary> | :t \f -> getAp . fmap getAlt . foldMap (Ap . fmap Alt . f) |
2024-06-30 05:43:18 +0200 | <lambdabot> | forall k (f1 :: * -> *) (t :: * -> *) (f2 :: k -> *) (a1 :: k) a2. (Foldable t, Applicative f1, Monoid (Alt f2 a1)) => (a2 -> f1 (f2 a1)) -> t a2 -> f1 (f2 a1) |
2024-06-30 05:43:50 +0200 | <nhar> | Leary: true. but to be more transparent my `t` type is an AST and I don't see a reasonable way to make a Monoid or Alternative instance for that |
2024-06-30 05:44:18 +0200 | <nhar> | data Exp a = Var a | Lam VarName (Exp a) | App (Exp a) (Exp a) |
2024-06-30 05:44:39 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 264 seconds) |
2024-06-30 05:46:27 +0200 | <nhar> | I'm pretty sure at minimum I'll need Traversable t becuase Traversable is what re-constructs the original AST I'm folding over |
2024-06-30 05:49:43 +0200 | <Leary> | If you really want to optimise `join <$> traverse f x` for that, you're probably best off just writing it by hand. |
2024-06-30 05:51:15 +0200 | <nhar> | yeah...I think you're right. And if I need to make a new typeclass. Thanks for the help! |
2024-06-30 05:57:23 +0200 | <nhar> | wait...I think I figured out a better approach: \x h -> lift x >>= h :: (MonadTrans f, Monad t) => (a -> f (t a)) -> t a -> f (t b) |
2024-06-30 06:05:19 +0200 | <mauke> | (MonadTrans f, Monad t) => t a -> (a -> f t b) -> f t b |
2024-06-30 06:12:35 +0200 | CrunchyFlakes | (~CrunchyFl@ip92348280.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-06-30 06:13:09 +0200 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2024-06-30 06:15:17 +0200 | CrunchyFlakes | (~CrunchyFl@ip92348280.dynamic.kabel-deutschland.de) |