Logs: freenode/#haskell
| 2021-03-21 01:01:26 | → | twk- joins (~thewormki@unaffiliated/twk-) |
| 2021-03-21 01:03:13 | × | elliott_ quits (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 260 seconds) |
| 2021-03-21 01:09:20 | <hololeap> | i'm thinking about an API written in haskell, which would be the backend for a collaborative to-do list, accessed through a browser. when an item is in the process of being edited, access to the item should be restricted to that person. |
| 2021-03-21 01:09:56 | <hololeap> | my question is: would STM be suitable for locking items in the backend or would i need to use a more traditional locking system |
| 2021-03-21 01:10:14 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-21 01:10:41 | × | forgottenone quits (~forgotten@176.42.24.127) (Quit: Konversation terminated!) |
| 2021-03-21 01:12:08 | <__minoru__shirae> | hololeap: how would you detect getting in and out of an editing process? |
| 2021-03-21 01:12:34 | × | cartwright quits (~chatting@gateway/tor-sasl/cantstanya) (Quit: WeeChat 2.5) |
| 2021-03-21 01:12:47 | <__minoru__shirae> | if you decide to add a button called "start editing", then you could just store the status in a db |
| 2021-03-21 01:13:40 | <__minoru__shirae> | and reject later attempts to edit that item based on that value extracted from db |
| 2021-03-21 01:14:37 | → | cantstanya joins (~chatting@gateway/tor-sasl/cantstanya) |
| 2021-03-21 01:14:38 | <__minoru__shirae> | that would mean that you delegated the task of managing concurrency to the db |
| 2021-03-21 01:14:56 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds) |
| 2021-03-21 01:15:08 | × | Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa) |
| 2021-03-21 01:15:10 | <bbhoss> | ski: sorry I stepped away, thanks for clarifying. I am coming from Elixir/Erlang so that's the sort of thing I am used to. With elixir there is the pin operator ^ that allows you to specify you want matching instead of shadowing. But it seems like in Haskell's case, it will just shadow and there is no pin operator, so it's probably best to use a guard? |
| 2021-03-21 01:16:12 | <ski> | yes |
| 2021-03-21 01:16:31 | <hololeap> | __minoru__shirae: it would probably be triggered by clicking on an item, but i see now that i need to flesh out all the details |
| 2021-03-21 01:16:46 | <ski> | (technically, you could also use a view pattern .. but it would be a bit ugly .. `(x ==) -> True') |
| 2021-03-21 01:16:47 | × | nf quits (~n@monade.li) (Remote host closed the connection) |
| 2021-03-21 01:16:56 | → | nf joins (~n@monade.li) |
| 2021-03-21 01:17:17 | → | LogicUpgrade joins (57e3c46d@87.227.196.109) |
| 2021-03-21 01:17:25 | <hololeap> | because if someone started editing but didn't make changes or cancelled, then it would make sense to give the priority to someone who simultaneously made changes and saved them |
| 2021-03-21 01:17:27 | × | maerwald quits (~maerwald@mail.hasufell.de) (Ping timeout: 246 seconds) |
| 2021-03-21 01:18:21 | → | LittleFox94 joins (~littlefox@rondra.lf-net.org) |
| 2021-03-21 01:18:32 | → | maerwald joins (~maerwald@mail.hasufell.de) |
| 2021-03-21 01:18:34 | × | Benett quits (~Benett@unaffiliated/benett) (Quit: ) |
| 2021-03-21 01:18:38 | × | LittleFox quits (~littlefox@rondra.lf-net.org) (Ping timeout: 264 seconds) |
| 2021-03-21 01:18:49 | → | Benett joins (~Benett@unaffiliated/benett) |
| 2021-03-21 01:18:52 | × | lisq quits (~quassel@lis.moe) (Quit: No Ping reply in 180 seconds.) |
| 2021-03-21 01:19:09 | → | xelxebar_ joins (~xelxebar@gateway/tor-sasl/xelxebar) |
| 2021-03-21 01:19:26 | × | Unhammer quits (~Unhammer@gateway/tor-sasl/unhammer) (Ping timeout: 268 seconds) |
| 2021-03-21 01:19:26 | × | xelxebar quits (~xelxebar@gateway/tor-sasl/xelxebar) (Ping timeout: 268 seconds) |
| 2021-03-21 01:20:07 | <__minoru__shirae> | that's optimistic locking |
| 2021-03-21 01:20:09 | → | Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer) |
| 2021-03-21 01:20:11 | → | lisq joins (~quassel@lis.moe) |
| 2021-03-21 01:20:40 | → | cabpa_ joins (~cabpa@180.190.165.139) |
| 2021-03-21 01:20:57 | × | cabpa quits (~cabpa@180.190.168.108) (Ping timeout: 246 seconds) |
| 2021-03-21 01:21:09 | <__minoru__shirae> | the one that you described in the original question is pessimistic |
| 2021-03-21 01:24:31 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2021-03-21 01:24:31 | → | zerok joins (~user@115-186-141-88.nayatel.pk) |
| 2021-03-21 01:24:38 | × | Wuzzy quits (~Wuzzy@p57a2ecf2.dip0.t-ipconnect.de) (Quit: Wuzzy) |
| 2021-03-21 01:27:43 | × | z0k quits (~user@115.186.141.88) (Ping timeout: 260 seconds) |
| 2021-03-21 01:30:06 | <__minoru__shirae> | if you have a db to delegate dealing with concurrency, then you can do everything in IO |
| 2021-03-21 01:31:39 | <__minoru__shirae> | but if you don't have a db, in other words, you are implementing the db functionality in your backend, then you can ask about whether STM is a good fit or not |
| 2021-03-21 01:33:55 | <LogicUpgrade> | Hi, I'm curious if mutation is an upcoming feature of haskell because most languages have it and it doesn't |
| 2021-03-21 01:34:19 | <dolio> | Haskell already has mutation. |
| 2021-03-21 01:35:22 | <ski> | it's in a library |
| 2021-03-21 01:35:54 | <pjb> | controled by monoids in the category of endofunctors. |
| 2021-03-21 01:36:05 | ski | smiles |
| 2021-03-21 01:37:25 | → | rajivr joins (uid269651@gateway/web/irccloud.com/x-tunnvuktqcelikkp) |
| 2021-03-21 01:38:26 | <LogicUpgrade> | Actually how does the entire sequence look when you 1) read initial state 2) transform it 3) use io monad to direct some side effect 4) now you need to read some NEW state |
| 2021-03-21 01:38:34 | <LogicUpgrade> | Endless streams? |
| 2021-03-21 01:39:00 | <LogicUpgrade> | This is in effect like a CQRS model |
| 2021-03-21 01:39:03 | <LogicUpgrade> | A bit |
| 2021-03-21 01:39:11 | <ski> | (3) seems possibly unrelated to the other parts |
| 2021-03-21 01:40:14 | <ski> | (1) read initial state - pass an initial parameter; (2) transform it - apply a function to it; (4) read some new state - pass in the new state as the parameter |
| 2021-03-21 01:43:25 | × | MarcelineVQ quits (~anja@198.254.208.159) (Remote host closed the connection) |
| 2021-03-21 01:43:42 | <LogicUpgrade> | ski, the trick is when the new state was affected by your own side-effects |
| 2021-03-21 01:43:59 | <monochrom> | "4)" equals "1)" if after "3)" you just recurse. |
| 2021-03-21 01:44:01 | <ski> | thread the state through your computation |
| 2021-03-21 01:44:16 | <LogicUpgrade> | 1) read directory 2) product a new file in it 3) read it again |
| 2021-03-21 01:44:21 | <LogicUpgrade> | produce* |
| 2021-03-21 01:44:40 | <ski> | "read directory" involves communicating with the external world, not just dealing with an internal state |
| 2021-03-21 01:44:50 | <ski> | so that would be `IO', then, (3) |
| 2021-03-21 01:45:00 | <monochrom> | System.Directory has functions for reading directories. |
| 2021-03-21 01:45:23 | <LogicUpgrade> | Should I have said "emit command to get directory and magically get it on a global stream somewhere" |
| 2021-03-21 01:45:41 | → | MarcelineVQ joins (~anja@198.254.208.159) |
| 2021-03-21 01:45:42 | <ski> | how does the magic work ? |
| 2021-03-21 01:46:31 | <LogicUpgrade> | Mostly things like constructing objects/functions that go nowhere but have a side-effect, and endless streams, or recursion which doesn't recurse:P stuff like that |
| 2021-03-21 01:46:43 | × | zerok quits (~user@115-186-141-88.nayatel.pk) (Ping timeout: 245 seconds) |
| 2021-03-21 01:47:12 | <ski> | @quote -fmagic |
| 2021-03-21 01:47:12 | <lambdabot> | mrd says: interesting things happen when you enable -fmagic! |
| 2021-03-21 01:47:21 | × | renzhi quits (~renzhi@modemcable070.17-177-173.mc.videotron.ca) (Ping timeout: 264 seconds) |
| 2021-03-21 01:47:28 | <bbhoss> | I'm a haskell n00b but generally I like to push IO to the very edge of the program |
| 2021-03-21 01:47:43 | × | ntjns_ quits (~jones@167.88.120.129) (Quit: leaving) |
| 2021-03-21 01:47:53 | <ski> | that's generally good advice, in many languages |
| 2021-03-21 01:47:55 | <bbhoss> | so have some function to get the updates to be made from the outside world them feed them into the pure system |
| 2021-03-21 01:48:08 | × | m0rphism quits (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) (Ping timeout: 240 seconds) |
| 2021-03-21 01:48:16 | <ski> | LogicUpgrade : i'm not following |
| 2021-03-21 01:48:26 | × | Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer) |
| 2021-03-21 01:48:41 | → | elliott_ joins (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) |
| 2021-03-21 01:48:41 | <LogicUpgrade> | ski, nah in some languages it's OK to put it right in the center of the program |
| 2021-03-21 01:48:51 | → | zerok joins (~user@101.50.108.120) |
| 2021-03-21 01:48:54 | → | forgottenone joins (~forgotten@176.42.24.127) |
| 2021-03-21 01:49:14 | → | perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 2021-03-21 01:49:47 | × | Beetstra1 quits (~Beetstra@185.204.1.185) (Remote host closed the connection) |
| 2021-03-21 01:49:53 | <ski> | "many" doesn't contradict "some" |
| 2021-03-21 01:50:25 | <dolio> | A language allowing it doesn't make it a good idea. |
| 2021-03-21 01:50:26 | <LogicUpgrade> | ski yeah |
| 2021-03-21 01:51:25 | <monochrom> | Control inversion proves the equivalence between putting it at the centre and putting it at the edge. |
| 2021-03-21 01:51:47 | <LogicUpgrade> | dolio, it's complicated. We have movements like Data Oriented Programming, where interacting with the de-facto hardware form and function is the recommended technique |
| 2021-03-21 01:52:01 | <bbhoss> | hah yeah I was just thinking all the different possibilities someone could mean by "edge" |
| 2021-03-21 01:52:01 | <MarcelineVQ> | yet style inversion means always living on the edge |
| 2021-03-21 01:52:13 | <monochrom> | :) |
| 2021-03-21 01:52:45 | <__minoru__shirae> | so edgy |
| 2021-03-21 01:52:55 | <__minoru__shirae> | just kidding |
| 2021-03-21 01:52:56 | <ski> | yes, bbhoss |
| 2021-03-21 01:53:20 | <monochrom> | Your favourite stream model is passe. |
| 2021-03-21 01:53:35 | <monochrom> | 20 years ago Haskell did use a stream model for I/O. |
| 2021-03-21 01:53:42 | ski | enters a dialogue |
All times are in UTC.