Logs: liberachat/#haskell
| 2021-07-13 17:53:21 | → | thonkpod joins (~thonkpod@user/thonkpod) |
| 2021-07-13 17:55:56 | <maerwald> | we should have defined all our tools as microservices |
| 2021-07-13 17:56:31 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-13 17:56:33 | <maerwald> | I mean, we're almost there, LSP, neovim, ... |
| 2021-07-13 17:56:47 | <maerwald> | docker |
| 2021-07-13 17:56:57 | <maerwald> | just send a HTTP request to ghc |
| 2021-07-13 17:57:03 | <int-e> | maerwald: https://blog.davetcode.co.uk/post/21st-century-emulator/ |
| 2021-07-13 17:57:33 | → | hrnz joins (~ulli@irc.plumbing) |
| 2021-07-13 17:57:39 | <maerwald> | unix is dead, now is HTTP and json APIs |
| 2021-07-13 17:58:07 | <Rembane> | POSIX over REST? |
| 2021-07-13 17:58:18 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-07-13 17:58:52 | × | derelict quits (~derelict@user/derelict) (Ping timeout: 245 seconds) |
| 2021-07-13 17:59:26 | <maerwald> | but does it scale? |
| 2021-07-13 18:01:22 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 272 seconds) |
| 2021-07-13 18:02:04 | <monochrom> | The "is this actully possible?" section is, I don't know, interesting or more jokes. So, reinventing copy-on-write, out-of-order execution, and speculative execution but for microservices? |
| 2021-07-13 18:02:31 | × | silverwhitefish quits (~hidden@47.202.102.10) (Remote host closed the connection) |
| 2021-07-13 18:02:59 | <Rembane> | Sounds like modern JS |
| 2021-07-13 18:03:00 | → | silverwhitefish joins (~hidden@47.202.102.10) |
| 2021-07-13 18:03:09 | × | silverwhitefish quits (~hidden@47.202.102.10) (Client Quit) |
| 2021-07-13 18:03:18 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 255 seconds) |
| 2021-07-13 18:03:53 | <int-e> | monochrom: it's absolutely a joke |
| 2021-07-13 18:03:55 | → | silverwhitefish joins (~hidden@47.202.102.10) |
| 2021-07-13 18:04:07 | × | chris-the-slurpa quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-13 18:04:16 | × | warnz quits (~warnz@2600:1700:77c0:5610:9856:f279:a598:9845) (Remote host closed the connection) |
| 2021-07-13 18:05:52 | <int-e> | especially if you take "any instruction which changes the program counter" literally |
| 2021-07-13 18:06:22 | → | qbt joins (~edun@user/edun) |
| 2021-07-13 18:07:34 | → | chris-the-slurpa joins (~chris@81.96.113.213) |
| 2021-07-13 18:09:36 | × | vk3wtf quits (~doc@124.168.198.139) (Ping timeout: 272 seconds) |
| 2021-07-13 18:11:05 | × | eight quits (~eight@user/eight) (Quit: leaving) |
| 2021-07-13 18:11:06 | × | Vajb quits (~Vajb@2001:999:62:1d53:26b1:6c9b:c1ed:9c01) (Read error: Connection reset by peer) |
| 2021-07-13 18:12:09 | → | finsternis joins (~X@23.226.237.192) |
| 2021-07-13 18:12:15 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-13 18:13:28 | <yin[m]> | i know there's a --warnings flag in ghcid that lets you run your function even with warnings, but is there a way to supress the warnings within ghcid (independently from ghci)? |
| 2021-07-13 18:15:05 | → | derelict joins (~derelict@user/derelict) |
| 2021-07-13 18:15:46 | <tomsmeding> | maerwald: surely not webscale |
| 2021-07-13 18:17:36 | → | Bayes joins (~Bayes@user/bayes) |
| 2021-07-13 18:18:15 | <tomsmeding> | yin[m]: tell ghcid to pass -w to ghci? |
| 2021-07-13 18:18:19 | <tomsmeding> | https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flags.html#warnings |
| 2021-07-13 18:18:52 | → | son0p joins (~ff@181.136.122.143) |
| 2021-07-13 18:20:20 | <Bayes> | so I have a function that "stitches up" all other smaller functions, i.e. an end-user facing function taking several arguments that will run a whole things. What's the best practice in a functional programming here? have the front-end user to pass functions and call them sequentially in my code as needed, or maybe wrap around each of the inner |
| 2021-07-13 18:20:20 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 2021-07-13 18:20:20 | <Bayes> | functions sequentially one by one to always have a one-argument function? |
| 2021-07-13 18:20:50 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-13 18:21:16 | <dminuoso> | Can you perhaps present this as code? |
| 2021-07-13 18:21:29 | <Bayes> | I was really trying to do that and I have a mess in my mind :D |
| 2021-07-13 18:21:47 | <Bayes> | I'm trying to write some pseudocode that's simple enough to show what I'm trying to do |
| 2021-07-13 18:22:10 | <dminuoso> | Yes, even that would be helpful. |
| 2021-07-13 18:23:17 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-13 18:23:47 | <EvanR> | there's the 'congiguration monoid' pattern where you have a type for the massive up front argument to your massive function. And you begin with default config and just tweak parts by monoiding |
| 2021-07-13 18:23:49 | → | warnz joins (~warnz@104-55-100-55.lightspeed.lsvlky.sbcglobal.net) |
| 2021-07-13 18:23:53 | <EvanR> | configuration monoid |
| 2021-07-13 18:26:59 | <Bayes> | dminuoso https://paste.tomsmeding.com/efuXPVxV |
| 2021-07-13 18:27:06 | <Bayes> | that's how my code looks like |
| 2021-07-13 18:27:35 | <Bayes> | but I have this very strong intuition deep down me that tells me that's ugly and completely antifunctional programming |
| 2021-07-13 18:27:49 | <dminuoso> | Bayes: Does the return type vary between each function? |
| 2021-07-13 18:28:03 | <dminuoso> | I guess it sort of does, considering step_three |
| 2021-07-13 18:29:08 | <Bayes> | we can assume for the moment that all functions have the same return type |
| 2021-07-13 18:29:40 | <dminuoso> | If we can, then EvanR is right. |
| 2021-07-13 18:29:57 | <Bayes> | as in any of these two will return the same type: step_two_alt_a, step_two_alt_b |
| 2021-07-13 18:30:18 | <dminuoso> | If not, you could perhaps use an indexed monad |
| 2021-07-13 18:30:24 | <dminuoso> | Ah |
| 2021-07-13 18:30:28 | <Bayes> | configuration monoid? that's cool will look it up |
| 2021-07-13 18:30:35 | <dminuoso> | Bayes: but step1 might produce a different output? |
| 2021-07-13 18:30:36 | <EvanR> | dunno if that's really what it's called |
| 2021-07-13 18:30:36 | × | myShoggoth quits (~myShoggot@97-120-70-214.ptld.qwest.net) (Ping timeout: 276 seconds) |
| 2021-07-13 18:31:13 | <Bayes> | yeah, step1 might produce a different output type than step2 and step3 |
| 2021-07-13 18:31:24 | <EvanR> | and yeah, it seems unweildy to do and at risk of becoming a terrible API like jQuery |
| 2021-07-13 18:31:44 | <dminuoso> | Bayes: Are there clear stages that a user has to choce (say because first you have a bunch of (potentially parametrized) functions going from `A` to `B`, and then you have a bunch of (potentially parametrized) functions going from `B` to C`, and so forth? |
| 2021-07-13 18:32:13 | <hseg> | ok, so I *can* just roll my own http://ix.io/3sTP, but it seems like there should be a standard solution for this |
| 2021-07-13 18:32:14 | <dminuoso> | (Such that at some point you provide some initial A, and the users specification would give a sort of `A -> D` specification using your bunch of functions? |
| 2021-07-13 18:32:23 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.0.1) |
| 2021-07-13 18:32:50 | <Bayes> | yeah, in this case it's a "closed set" of options so you could enumerate a small-ish set of combinations |
| 2021-07-13 18:33:13 | <Bayes> | EvanR oh I know my code is ... not nice |
| 2021-07-13 18:33:17 | <dminuoso> | Bayes: I see. I would perhaps describe this with an IxState monad. |
| 2021-07-13 18:33:37 | <Bayes> | EvanR is this what you mean by "configuration monoid" https://medium.com/@jonathangfischoff/the-partial-options-monoid-pattern-31914a71fc67 ? |
| 2021-07-13 18:33:37 | <dminuoso> | This gives you a sort of imperative language, without having to explicitly tie "previous layers" into the function calls |
| 2021-07-13 18:33:45 | <dminuoso> | Then you could simply do: |
| 2021-07-13 18:34:02 | <dminuoso> | do { step1; step2 "foo"; step3 10 True } |
| 2021-07-13 18:34:15 | <dminuoso> | And each step is an IxState action that changes the underlying state type |
| 2021-07-13 18:34:28 | <dminuoso> | Then you can simply provide a bunch of combinators for the user to choose |
| 2021-07-13 18:35:44 | × | Patternmaster quits (~georg@li1192-118.members.linode.com) (Remote host closed the connection) |
| 2021-07-13 18:35:50 | <Bayes> | uhm that's not too different from what I'm doing, but just instead of taking the three functions in as arguments I'll get it all resolved for the end user |
| 2021-07-13 18:37:22 | <Bayes> | so you have like three layers, the bottom layer with all the step functions, the middle layer with the function that stitch them up together, and the top layer which is just a bunch of one-line combinations |
| 2021-07-13 18:41:21 | <Bayes> | thanks dminuoso |
| 2021-07-13 18:41:30 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 2021-07-13 18:41:38 | <Bayes> | I think this is enough to get me going |
| 2021-07-13 18:41:55 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 2021-07-13 18:46:00 | × | o1lo01ol1o quits (~o1lo01ol1@bl7-89-228.dsl.telepac.pt) (Remote host closed the connection) |
| 2021-07-13 18:47:47 | → | wallymathieu joins (~wallymath@81-234-151-21-no94.tbcn.telia.com) |
| 2021-07-13 18:48:38 | <hseg> | any ideas how to get http://ix.io/3sTP from standard libraries? |
| 2021-07-13 18:51:17 | → | cfricke joins (~cfricke@user/cfricke) |
| 2021-07-13 18:52:25 | <yin[m]> | apparently not |
| 2021-07-13 18:52:32 | → | kilolympus joins (~kilolympu@cpc92710-cmbg20-2-0-cust265.5-4.cable.virginm.net) |
| 2021-07-13 18:53:05 | <yin[m]> | is notElem more performant than (not . elem) or something? hlint is really picky with it |
| 2021-07-13 18:53:19 | <maerwald> | no, hlint is just annoying |
| 2021-07-13 18:53:34 | <kilolympus> | I always wondered the same for concatMap and (concat . map) |
| 2021-07-13 18:54:42 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds) |
| 2021-07-13 18:56:22 | → | eight joins (~eight@user/eight) |
| 2021-07-13 18:56:22 | × | eight quits (~eight@user/eight) (Client Quit) |
| 2021-07-13 18:56:41 | <EvanR> | in haskell you get used to such 'spelling differences' not mattering. Then you go back to the real world and shake your head |
All times are in UTC.