Logs: freenode/#haskell
| 2021-03-01 19:34:43 | <lambdabot> | Data.ByteString interact :: (ByteString -> ByteString) -> IO () |
| 2021-03-01 19:35:07 | <sclv> | the "original" responsive interpretation of user events |
| 2021-03-01 19:35:55 | × | Tops21 quits (~Tobias@dyndsl-095-033-090-074.ewe-ip-backbone.de) (Ping timeout: 240 seconds) |
| 2021-03-01 19:38:56 | × | elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 240 seconds) |
| 2021-03-01 19:39:04 | → | acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) |
| 2021-03-01 19:39:44 | × | nbloomf quits (~nbloomf@2600:1700:ad14:3020:c491:50f:2150:49a6) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-03-01 19:41:25 | → | Tops2 joins (~Tobias@dyndsl-095-033-090-074.ewe-ip-backbone.de) |
| 2021-03-01 19:41:27 | × | ddellacosta quits (~ddellacos@86.106.143.58) (Remote host closed the connection) |
| 2021-03-01 19:41:59 | → | ddellacosta joins (~ddellacos@86.106.143.58) |
| 2021-03-01 19:43:00 | × | tanuki quits (~quassel@173.168.154.189) (Quit: No Ping reply in 180 seconds.) |
| 2021-03-01 19:44:16 | → | tanuki joins (~quassel@173.168.154.189) |
| 2021-03-01 19:44:55 | × | Tops22 quits (~Tobias@dyndsl-095-033-090-074.ewe-ip-backbone.de) (Ping timeout: 240 seconds) |
| 2021-03-01 19:47:09 | × | dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 245 seconds) |
| 2021-03-01 19:47:15 | × | ddellacosta quits (~ddellacos@86.106.143.58) (Ping timeout: 240 seconds) |
| 2021-03-01 19:54:30 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:7853:81e7:49e6:31d8) (Remote host closed the connection) |
| 2021-03-01 19:54:39 | × | son0p quits (~son0p@181.136.122.143) (Ping timeout: 245 seconds) |
| 2021-03-01 19:55:01 | → | dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) |
| 2021-03-01 19:57:43 | → | mananamenos joins (~mananamen@193.red-88-11-66.dynamicip.rima-tde.net) |
| 2021-03-01 19:58:01 | → | mouseghost joins (~draco@87-206-9-185.dynamic.chello.pl) |
| 2021-03-01 19:58:01 | × | mouseghost quits (~draco@87-206-9-185.dynamic.chello.pl) (Changing host) |
| 2021-03-01 19:58:01 | → | mouseghost joins (~draco@wikipedia/desperek) |
| 2021-03-01 20:00:37 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:7853:81e7:49e6:31d8) |
| 2021-03-01 20:01:21 | × | drakonis quits (~drakonis@unaffiliated/drakonis) (Quit: ZNC 1.8.2 - https://znc.in) |
| 2021-03-01 20:03:31 | → | ixlun joins (~user@213.205.241.12) |
| 2021-03-01 20:04:38 | → | drakonis joins (drakonis@unaffiliated/drakonis) |
| 2021-03-01 20:05:39 | × | petersen quits (~petersen@redhat/juhp) (Ping timeout: 260 seconds) |
| 2021-03-01 20:05:47 | <ixlun> | Hi all, Is there a way to have a 'reference' to an object that's part of the state monad, so changes to it can be observed through the references? |
| 2021-03-01 20:06:32 | × | ClaudiusMaximus quits (~claude@unaffiliated/claudiusmaximus) (Quit: ->) |
| 2021-03-01 20:06:36 | → | superguest joins (~klf@67.216.62.0) |
| 2021-03-01 20:06:43 | → | cgadski joins (~cgadski@a95-95-106-208.cpe.netcabo.pt) |
| 2021-03-01 20:07:10 | → | petersen joins (~petersen@redhat/juhp) |
| 2021-03-01 20:07:45 | × | rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 268 seconds) |
| 2021-03-01 20:07:48 | <merijn> | ixlun: By using a mutable reference? |
| 2021-03-01 20:07:55 | × | nhs_ quits (~nhs@cpe-70-113-67-118.austin.res.rr.com) (Ping timeout: 240 seconds) |
| 2021-03-01 20:08:52 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 2021-03-01 20:09:40 | × | vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving) |
| 2021-03-01 20:09:46 | → | nbloomf joins (~nbloomf@2600:1700:ad14:3020:c491:50f:2150:49a6) |
| 2021-03-01 20:10:45 | <ixlun> | merijn: Yes, that's what I'm after |
| 2021-03-01 20:10:53 | → | nhs joins (~nhs@cpe-70-113-67-118.austin.res.rr.com) |
| 2021-03-01 20:10:56 | <merijn> | ixlun: No, that was the answer |
| 2021-03-01 20:10:59 | <merijn> | Like IORef |
| 2021-03-01 20:11:07 | <merijn> | or MVar/TVar |
| 2021-03-01 20:11:34 | <superguest> | In general (i.e., functional programming), can we curry in the following fashion: f has signature f(p1, p2, ..., pN); and we do f "second_arg" 2 |
| 2021-03-01 20:11:35 | <superguest> | ? |
| 2021-03-01 20:11:40 | → | knupfer joins (~Thunderbi@i59F7FF45.versanet.de) |
| 2021-03-01 20:11:58 | <ixlun> | Cool, thanks for that, I'll look at the docs :-) |
| 2021-03-01 20:12:28 | <superguest> | similar, f "i-th_arg" i |
| 2021-03-01 20:12:39 | <geekosaur> | in general when using such references, you use Reader instead of State since you'd be mutating the contents of the reference, not the reference itself |
| 2021-03-01 20:13:54 | × | coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 2021-03-01 20:14:00 | <geekosaur> | superguest, that's more an attribute of a language/syntax, scheme and the lisps support it but most other languages don't |
| 2021-03-01 20:14:08 | <geekosaur> | if I understand what you're asking correctly |
| 2021-03-01 20:14:10 | → | oish joins (~charlie@228.25.169.217.in-addr.arpa) |
| 2021-03-01 20:14:31 | → | coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) |
| 2021-03-01 20:14:37 | <ixlun> | geekosaur: Indeed, the reference itself is immutable for my use-case |
| 2021-03-01 20:15:39 | <superguest> | perhaps I've forgot to illustrate what f "second_arg" 2 would return; it would return a function f1 that has signature f1(f1, f3, ... fN) |
| 2021-03-01 20:16:05 | <geekosaur> | same answer |
| 2021-03-01 20:16:47 | <geekosaur> | you can't really do that in Haskell or the MLs, you can do it in Scheme, it's less about functional programming than the language syntax and what that allows you to do |
| 2021-03-01 20:18:18 | <superguest> | geekosaur, okay, is what I just illustrated still considered currying? |
| 2021-03-01 20:18:53 | <geekosaur> | currying could be a part of it |
| 2021-03-01 20:20:06 | × | jpds_ quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds) |
| 2021-03-01 20:20:44 | <geekosaur> | in haskell currying is between the standard form of function application and the tupled form; you can't really address tuples in the way you showed, though, so you can't really do this. (a form which used lists instead of tuples would be more amenable to it) |
| 2021-03-01 20:21:45 | <geekosaur> | or if haskell had defined tuples differently than it does |
| 2021-03-01 20:22:05 | → | jpds_ joins (~jpds@gateway/tor-sasl/jpds) |
| 2021-03-01 20:22:20 | <minoru_shiraeesh> | ixlun: if the architecture makes you want to introduce mutables references, maybe you can choose another architecture? |
| 2021-03-01 20:24:07 | <geekosaur> | superguest, in any case what you're really doing is partial application, not currying as such. (many people seem to confuse these) |
| 2021-03-01 20:25:27 | <geekosaur> | currying is a means to achieve partial application in parameter order in haskell. modified forms of currying might allow partial application in other orders, but I doubt it'd be worth it in general |
| 2021-03-01 20:25:59 | × | banyanRob quits (268ce492@38.140.228.146) (Quit: Connection closed) |
| 2021-03-01 20:27:34 | <superguest> | that last remark clarifies it for me. |
| 2021-03-01 20:28:36 | × | Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 240 seconds) |
| 2021-03-01 20:31:04 | <minoru_shiraeesh> | there should be other options that you can consider before introducing mutable references. You create pure subsystems in an impure framework which you also create. |
| 2021-03-01 20:31:36 | <minoru_shiraeesh> | There are various ways of designing that framework and those subsystems. |
| 2021-03-01 20:32:34 | <minoru_shiraeesh> | I don't know much about them, I'm in the process of investigating this subject. |
| 2021-03-01 20:33:33 | <minoru_shiraeesh> | But one variation I can imagine is based on queues. |
| 2021-03-01 20:33:34 | → | Pickchea joins (~private@unaffiliated/pickchea) |
| 2021-03-01 20:33:40 | <geekosaur> | minoru_shiraeesh, sometimes one mutable reference is the price you pay for a program which is more comprehensible. or sometimes it's necessary (as when, for example, synchronizing data between multiple threads) |
| 2021-03-01 20:33:40 | → | o1lo01ol1o joins (~o1lo01ol1@bl7-89-228.dsl.telepac.pt) |
| 2021-03-01 20:33:56 | <geekosaur> | it depends on the circumstances |
| 2021-03-01 20:36:08 | × | rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 268 seconds) |
| 2021-03-01 20:37:49 | → | cgadski_ joins (~cgadski@a95-95-106-208.cpe.netcabo.pt) |
| 2021-03-01 20:37:50 | × | cgadski quits (~cgadski@a95-95-106-208.cpe.netcabo.pt) (Read error: Connection reset by peer) |
| 2021-03-01 20:37:58 | × | o1lo01ol1o quits (~o1lo01ol1@bl7-89-228.dsl.telepac.pt) (Ping timeout: 245 seconds) |
| 2021-03-01 20:38:27 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 2021-03-01 20:39:23 | <minoru_shiraeesh> | geekosaur: you're implying that the programmer is experienced and considered other options, but what if it's a newbie that doesn't know other options? |
| 2021-03-01 20:40:39 | × | superguest quits (~klf@67.216.62.0) (Quit: This computer has gone to sleep) |
| 2021-03-01 20:41:30 | → | klf joins (~klf@67.216.62.0) |
| 2021-03-01 20:41:38 | <geekosaur> | they're already trying to use State, which argues that they do |
| 2021-03-01 20:42:20 | <minoru_shiraeesh> | so I think maybe the first thing to consider should be queues instead of mutable references. |
| 2021-03-01 20:44:59 | <minoru_shiraeesh> | you have an application's state as data record (data MyState = ...), various commands (data Command = GoLeft, GoRight, etc), a queue of commands and a handler of type MyState Command -> MyState |
| 2021-03-01 20:47:15 | → | ddellacosta joins (~ddellacos@86.106.143.123) |
| 2021-03-01 20:48:02 | <minoru_shiraeesh> | I mean MyState -> Command -> MyState |
| 2021-03-01 20:51:13 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2021-03-01 20:51:46 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:7853:81e7:49e6:31d8) (Remote host closed the connection) |
| 2021-03-01 20:53:48 | × | apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 245 seconds) |
| 2021-03-01 20:54:16 | × | entel quits (uid256215@botters/entel) (Quit: Connection closed for inactivity) |
| 2021-03-01 20:54:35 | <minoru_shiraeesh> | in OOP the Observable/Observer pattern handles that case |
| 2021-03-01 20:55:03 | <minoru_shiraeesh> | the question is how do you translate the Observable/Observer pattern to fp |
| 2021-03-01 20:55:19 | <klf> | thanks! |
| 2021-03-01 20:56:26 | × | jess quits (jess@freenode/staff/jess) (Quit: K-Lined) |
| 2021-03-01 20:57:20 | × | Pickchea quits (~private@unaffiliated/pickchea) (Quit: Leaving) |
| 2021-03-01 20:57:33 | → | jess joins (jess@freenode/staff/jess) |
All times are in UTC.