2024-04-21 00:00:01 +0200 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2024-04-21 00:13:19 +0200 | Square | (~Square@user/square) (Ping timeout: 268 seconds) |
2024-04-21 00:14:42 +0200 | <tri> | hi, im trying to just create an instance of state monad, why doesn't this work? |
2024-04-21 00:14:49 +0200 | <tri> | exampe :: State Int Int |
2024-04-21 00:15:02 +0200 | <tri> | example = State {runState = (\x -> (1,2)} |
2024-04-21 00:15:16 +0200 | <tri> | im just trying to newing up an instance of State |
2024-04-21 00:16:52 +0200 | <geekosaur> | `State` is a type alias, use `state` instead to construct a `StateT Identity` which is what `State` really is |
2024-04-21 00:17:27 +0200 | <geekosaur> | if you are working from an old enough document/webpage, it may be expecting you to be using mtl1 in which `State` was an actual constructor |
2024-04-21 00:17:54 +0200 | Square | (~Square@user/square) |
2024-04-21 00:18:48 +0200 | <tri> | geekosaur: yea i noticed it worked with lowercase state earlier but didn't know why. |
2024-04-21 00:19:19 +0200 | <tri> | where did you find that information? Im looking at https://hackage.haskell.org/package/mtl-2.3.1/docs/Control-Monad-State-Lazy.html#t:StateT |
2024-04-21 00:19:33 +0200 | <tri> | but don't see the lowercase state |
2024-04-21 00:20:32 +0200 | <geekosaur> | I know it from history 🙂 but https://hackage.haskell.org/package/mtl-2.3.1/docs/Control-Monad-State-Class.html#v:state |
2024-04-21 00:21:04 +0200 | <geekosaur> | it's hidden inside the class definition |
2024-04-21 00:22:41 +0200 | <tri> | yea actually when i hover above the lower case state, it says it's defined in Control.Monad.State.Class |
2024-04-21 00:22:52 +0200 | <tri> | thank you |
2024-04-21 00:24:26 +0200 | <tri> | geekosaur: that's equivalen to example = do put 2; return 1 right? |
2024-04-21 00:25:05 +0200 | <geekosaur> | which is? |
2024-04-21 00:25:53 +0200 | <tri> | im comparing that to example = state (\s -> (1,2)) |
2024-04-21 00:26:36 +0200 | <tri> | a state monad that always return 1, and modify the state to 2 |
2024-04-21 00:26:47 +0200 | <geekosaur> | yes |
2024-04-21 00:26:52 +0200 | <tri> | thank you |
2024-04-21 01:02:09 +0200 | Lycurgus | (~georg@user/Lycurgus) |
2024-04-21 01:02:10 +0200 | <ski> | confusion between type constructor and data constructor, due to naming them the same, strikes again |
2024-04-21 01:02:18 +0200 | <ski> | (i suppose, at least) |
2024-04-21 01:16:24 +0200 | madeleine-sydney | (~madeleine@c-76-155-235-153.hsd1.co.comcast.net) (Quit: Konversation terminated!) |
2024-04-21 01:23:45 +0200 | xstill_ | (xstill@fimu/xstill) (Quit: Ping timeout (120 seconds)) |
2024-04-21 01:24:10 +0200 | noumenon | (~noumenon@113.51-175-156.customer.lyse.net) (Quit: Leaving) |
2024-04-21 01:24:35 +0200 | random-jellyfish | (~developer@user/random-jellyfish) |
2024-04-21 01:26:39 +0200 | xsarnik | (xsarnik@lounge.fi.muni.cz) (Ping timeout: 256 seconds) |
2024-04-21 01:32:35 +0200 | Xe | (~cadey@perl/impostor/xe) (Quit: WeeChat 4.2.1) |
2024-04-21 01:34:00 +0200 | xsarnik | (xsarnik@lounge.fi.muni.cz) |
2024-04-21 01:34:55 +0200 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2024-04-21 01:35:15 +0200 | xstill_ | (xstill@fimu/xstill) |
2024-04-21 01:37:40 +0200 | Inst | (~Inst@user/Inst) |
2024-04-21 01:39:30 +0200 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 245 seconds) |
2024-04-21 01:42:03 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 260 seconds) |
2024-04-21 01:46:59 +0200 | myxokephale | (~myxos@65.28.251.121) (Remote host closed the connection) |
2024-04-21 01:48:53 +0200 | random-jellyfish | (~developer@user/random-jellyfish) (Ping timeout: 256 seconds) |
2024-04-21 01:55:00 +0200 | Xe | (~cadey@perl/impostor/xe) |
2024-04-21 01:56:46 +0200 | titibandit | (~titibandi@user/titibandit) |
2024-04-21 02:01:10 +0200 | helle | (~helle@user/meow/Helle) (Read error: Connection reset by peer) |
2024-04-21 02:05:21 +0200 | alexherbo2 | (~alexherbo@2a02-8440-3302-d776-5085-4da3-9df1-4a7b.rev.sfr.net) (Remote host closed the connection) |
2024-04-21 02:07:00 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 245 seconds) |
2024-04-21 02:08:14 +0200 | chexum | (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
2024-04-21 02:09:42 +0200 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 260 seconds) |
2024-04-21 02:09:53 +0200 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2024-04-21 02:10:10 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 260 seconds) |
2024-04-21 02:10:10 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 260 seconds) |
2024-04-21 02:10:53 +0200 | ec | (~ec@gateway/tor-sasl/ec) |
2024-04-21 02:11:11 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-04-21 02:11:42 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2024-04-21 02:11:44 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 02:13:41 +0200 | Inst | (~Inst@user/Inst) (Remote host closed the connection) |
2024-04-21 02:17:38 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 02:21:02 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 02:23:15 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 245 seconds) |
2024-04-21 02:29:59 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 02:30:57 +0200 | Inst | (~Inst@user/Inst) |
2024-04-21 02:35:14 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2024-04-21 02:36:18 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-04-21 02:36:23 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds) |
2024-04-21 02:38:54 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 02:40:54 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-04-21 02:43:18 +0200 | madeleine-sydney | (~madeleine@c-76-155-235-153.hsd1.co.comcast.net) |
2024-04-21 02:49:43 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 260 seconds) |
2024-04-21 02:55:24 +0200 | titibandit | (~titibandi@user/titibandit) (Read error: Connection reset by peer) |
2024-04-21 03:01:16 +0200 | myxos | (~myxos@65.28.251.121) |
2024-04-21 03:03:03 +0200 | philopsos | (~caecilius@user/philopsos) |
2024-04-21 03:06:44 +0200 | mikoto | (~mikoto@dzcz-fyyyyyyyyyyyyhpy-3.rev.dnainternet.fi) |
2024-04-21 03:07:57 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection) |
2024-04-21 03:08:33 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2024-04-21 03:10:01 +0200 | mikoto | (~mikoto@dzcz-fyyyyyyyyyyyyhpy-3.rev.dnainternet.fi) (Client Quit) |
2024-04-21 03:10:14 +0200 | mikoto | (~mikoto@dzcz-fyyyyyyyyyyyyhpy-3.rev.dnainternet.fi) |
2024-04-21 03:11:48 +0200 | mikoto | (~mikoto@dzcz-fyyyyyyyyyyyyhpy-3.rev.dnainternet.fi) (Client Quit) |
2024-04-21 03:12:50 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 252 seconds) |
2024-04-21 03:13:15 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 245 seconds) |
2024-04-21 03:13:23 +0200 | bilegeek | (~bilegeek@2600:1008:b010:6f31:97f2:4443:40ea:6a83) |
2024-04-21 03:20:17 +0200 | tremon | (~tremon@83.80.159.219) (Quit: getting boxed in) |
2024-04-21 03:20:55 +0200 | <Inst> | does readerT (>>) matter? |
2024-04-21 03:21:53 +0200 | <Inst> | I mean, it's essentially a coding error to use >> in (->) r or ReaderT monad, but does it matter that it's defined as f *> g = (id <$ f) <*> g? |
2024-04-21 03:23:50 +0200 | <geekosaur> | >> needs to exist for do notation to work |
2024-04-21 03:23:58 +0200 | harveypwca | (~harveypwc@2601:246:d080:b40:1889:d9bf:2dd8:b288) (Quit: Leaving) |
2024-04-21 03:24:34 +0200 | <c_wraith> | it definitely matters for ReaderT. It indicates a problem with Reader |
2024-04-21 03:24:35 +0200 | <geekosaur> | (whether it should or even can do something sensible is another question) |
2024-04-21 03:24:53 +0200 | <Inst> | maybe I misunderstand things ?:( |
2024-04-21 03:24:58 +0200 | <c_wraith> | But that's mostly because >> For Identity doesn't do anything |
2024-04-21 03:25:17 +0200 | <c_wraith> | ReaderT just gives you the >> for the underlying type |
2024-04-21 03:25:41 +0200 | <Inst> | https://hackage.haskell.org/package/base-4.19.1.0/docs/src/GHC.Base.html#line-1133 |
2024-04-21 03:26:03 +0200 | <Inst> | there is no definition for *> |
2024-04-21 03:26:25 +0200 | <c_wraith> | there's a default definition in Applicative |
2024-04-21 03:26:39 +0200 | <Inst> | which should drop it to https://hackage.haskell.org/package/base-4.19.1.0/docs/src/GHC.Base.html#%2A%3E |
2024-04-21 03:26:42 +0200 | <Inst> | which looks inefficient |
2024-04-21 03:29:15 +0200 | <Inst> | (id <$ a1) <*> a2 <===> const id . a1 <*> a2 <===> \u -> (const id . a1) u ( a2 u) <===> \u -> id (a2 u) <===> a2 |
2024-04-21 03:30:57 +0200 | <Inst> | https://hackage.haskell.org/package/transformers-0.6.1.1/docs/src/Control.Monad.Trans.Reader.html#… |
2024-04-21 03:31:52 +0200 | <c_wraith> | I would posit that the performance of something it's an error to use doesn't matter |
2024-04-21 03:33:15 +0200 | _________ | (~nobody@user/noodly) (Ping timeout: 245 seconds) |
2024-04-21 03:33:49 +0200 | <Inst> | what would the cost of _ *> g = g be in base, for function monad? |
2024-04-21 03:34:17 +0200 | <Inst> | I can imagine a case where you're using polymorphic monadic code, and when it instances to ReaderT identity it'd cause an issue |
2024-04-21 03:37:49 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2024-04-21 03:40:20 +0200 | otto_s | (~user@p4ff27c3b.dip0.t-ipconnect.de) (Ping timeout: 245 seconds) |
2024-04-21 03:41:27 +0200 | oo_miguel | (~Thunderbi@78-11-181-16.static.ip.netia.com.pl) (Ping timeout: 252 seconds) |
2024-04-21 03:42:14 +0200 | otto_s | (~user@p5b044e85.dip0.t-ipconnect.de) |
2024-04-21 03:42:15 +0200 | <Inst> | yeah, you're right, in ReaderT Identity, the identity would take over and just do const on *> |
2024-04-21 03:44:54 +0200 | <Inst> | Identity doesn't have *> or <* in its instance either :( |
2024-04-21 03:45:06 +0200 | causal | (~eric@50.35.88.207) |
2024-04-21 03:45:43 +0200 | <Inst> | https://hackage.haskell.org/package/base-4.19.1.0/docs/src/Data.Functor.Identity.html#line-122 |
2024-04-21 03:46:38 +0200 | ridcully_ | (~ridcully@p508acabd.dip0.t-ipconnect.de) |
2024-04-21 03:46:47 +0200 | ridcully | (~ridcully@p508ac8f2.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
2024-04-21 03:58:36 +0200 | P1RATEZ | (piratez@user/p1ratez) |
2024-04-21 04:01:51 +0200 | Thomas03 | (~Thomas03@2600:1702:21b0:a500:8e3:7060:f1c5:aac9) |
2024-04-21 04:05:04 +0200 | op_4 | (~tslil@user/op-4/x-9116473) (Remote host closed the connection) |
2024-04-21 04:05:34 +0200 | op_4 | (~tslil@user/op-4/x-9116473) |
2024-04-21 04:14:20 +0200 | P1RATEZ | (piratez@user/p1ratez) (Remote host closed the connection) |
2024-04-21 04:37:51 +0200 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2024-04-21 04:39:49 +0200 | td_ | (~td@i5387091E.versanet.de) (Ping timeout: 272 seconds) |
2024-04-21 04:40:19 +0200 | Thomas03 | (~Thomas03@2600:1702:21b0:a500:8e3:7060:f1c5:aac9) (Quit: Client closed) |
2024-04-21 04:41:01 +0200 | td_ | (~td@i53870917.versanet.de) |
2024-04-21 04:42:40 +0200 | terrorjack | (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat) |
2024-04-21 04:45:28 +0200 | terrorjack | (~terrorjac@2a01:4f8:c17:87f8::) |
2024-04-21 04:57:33 +0200 | rekahsoft | (~rekahsoft@bras-base-orllon1103w-grc-13-184-148-6-204.dsl.bell.ca) |
2024-04-21 05:00:29 +0200 | raym | (~ray@user/raym) (Ping timeout: 240 seconds) |
2024-04-21 05:01:39 +0200 | raym | (~ray@user/raym) |
2024-04-21 05:01:44 +0200 | causal | (~eric@50.35.88.207) (Ping timeout: 252 seconds) |
2024-04-21 05:01:48 +0200 | Patternmaster | (~georg@user/Patternmaster) (Ping timeout: 255 seconds) |
2024-04-21 05:02:27 +0200 | Patternmaster | (~georg@user/Patternmaster) |
2024-04-21 05:02:34 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2024-04-21 05:03:34 +0200 | causal | (~eric@50.35.88.207) |
2024-04-21 05:03:35 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-04-21 05:16:10 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2024-04-21 05:16:44 +0200 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-04-21 05:36:10 +0200 | aforemny_ | (~aforemny@2001:9e8:6cd6:500:e763:a78e:e89e:9c7f) (Ping timeout: 245 seconds) |
2024-04-21 05:36:16 +0200 | aforemny | (~aforemny@i59F516DE.versanet.de) |
2024-04-21 05:36:57 +0200 | rekahsoft | (~rekahsoft@bras-base-orllon1103w-grc-13-184-148-6-204.dsl.bell.ca) (Ping timeout: 252 seconds) |
2024-04-21 05:53:33 +0200 | yin | (~yin@user/zero) (Ping timeout: 255 seconds) |
2024-04-21 05:54:44 +0200 | hgolden | (~hgolden@2603:8000:9d00:3ed1:f849:272c:fda5:33c9) |
2024-04-21 05:57:37 +0200 | yin | (~yin@user/zero) |
2024-04-21 06:08:10 +0200 | stiell_ | (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds) |
2024-04-21 06:10:28 +0200 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2024-04-21 06:15:29 +0200 | stiell_ | (~stiell@gateway/tor-sasl/stiell) |
2024-04-21 06:23:22 +0200 | z0e | (~z0e@pool-173-61-230-85.cmdnnj.fios.verizon.net) (Ping timeout: 250 seconds) |
2024-04-21 06:55:59 +0200 | philopsos | (~caecilius@user/philopsos) (Ping timeout: 272 seconds) |
2024-04-21 06:56:51 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-04-21 07:15:12 +0200 | Nick100 | (~Nick@59.sub-174-215-117.myvzw.com) |
2024-04-21 07:15:23 +0200 | peterbecich | (~Thunderbi@47.229.123.186) |
2024-04-21 07:16:16 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection) |
2024-04-21 07:21:48 +0200 | target_i | (~target_i@user/target-i/x-6023099) (Remote host closed the connection) |
2024-04-21 07:24:19 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2024-04-21 07:25:30 +0200 | _________ | (~nobody@user/noodly) |
2024-04-21 07:28:28 +0200 | Nick100 | (~Nick@59.sub-174-215-117.myvzw.com) (Quit: Connection closed) |
2024-04-21 07:29:00 +0200 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 260 seconds) |
2024-04-21 07:30:14 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 252 seconds) |
2024-04-21 07:47:48 +0200 | yin | (~yin@user/zero) (Ping timeout: 268 seconds) |
2024-04-21 07:47:51 +0200 | peterbecich | (~Thunderbi@47.229.123.186) (Ping timeout: 255 seconds) |
2024-04-21 07:51:53 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 07:54:00 +0200 | yin | (~yin@user/zero) |
2024-04-21 07:54:13 +0200 | kimiamania | (~76637481@user/kimiamania) (Quit: PegeLinux) |
2024-04-21 07:54:54 +0200 | kimiamania | (~76637481@user/kimiamania) |
2024-04-21 07:58:19 +0200 | madeleine-sydney | (~madeleine@c-76-155-235-153.hsd1.co.comcast.net) (Quit: Konversation terminated!) |
2024-04-21 08:03:47 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 08:18:35 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 08:19:49 +0200 | akshar | (~user@209.94.142.169) () |
2024-04-21 08:24:32 +0200 | m1dnight | (~christoph@82.146.125.185) (Quit: WeeChat 4.2.2) |
2024-04-21 08:26:05 +0200 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2024-04-21 08:28:06 +0200 | m1dnight | (~christoph@82.146.125.185) |
2024-04-21 08:34:24 +0200 | jinsun | (~jinsun@user/jinsun) |
2024-04-21 08:37:02 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 08:41:11 +0200 | Piedro | (~Piedro@85.254.74.244) |
2024-04-21 08:53:14 +0200 | pyooque | (~puke@user/puke) |
2024-04-21 08:53:14 +0200 | puke | Guest3535 |
2024-04-21 08:53:14 +0200 | Guest3535 | (~puke@user/puke) (Killed (copper.libera.chat (Nickname regained by services))) |
2024-04-21 08:53:14 +0200 | pyooque | puke |
2024-04-21 08:54:29 +0200 | puke | (~puke@user/puke) (Max SendQ exceeded) |
2024-04-21 08:55:48 +0200 | puke | (~puke@user/puke) |
2024-04-21 09:02:36 +0200 | tt12310 | (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) |
2024-04-21 09:06:07 +0200 | hgolden | (~hgolden@2603:8000:9d00:3ed1:f849:272c:fda5:33c9) (Ping timeout: 268 seconds) |
2024-04-21 09:13:31 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 09:18:54 +0200 | mima | (~mmh@aftr-62-216-211-209.dynamic.mnet-online.de) |
2024-04-21 09:24:09 +0200 | madeleine-sydney | (~madeleine@c-76-155-235-153.hsd1.co.comcast.net) |
2024-04-21 09:24:42 +0200 | actioninja | (~actioninj@user/actioninja) (Quit: see ya mane) |
2024-04-21 09:28:44 +0200 | actioninja | (~actioninj@user/actioninja) |
2024-04-21 09:35:43 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-04-21 09:35:52 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 09:38:17 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-04-21 09:39:06 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 09:43:49 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 272 seconds) |
2024-04-21 09:44:00 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) |
2024-04-21 09:46:58 +0200 | econo_ | (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
2024-04-21 09:49:31 +0200 | Square | (~Square@user/square) (Ping timeout: 272 seconds) |
2024-04-21 09:53:42 +0200 | bitmapper | (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-04-21 09:55:51 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-04-21 09:56:09 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 10:05:56 +0200 | Inst | (~Inst@user/Inst) (Ping timeout: 268 seconds) |
2024-04-21 10:06:38 +0200 | Inst | (~Inst@user/Inst) |
2024-04-21 10:10:13 +0200 | titibandit | (~titibandi@user/titibandit) |
2024-04-21 10:11:09 +0200 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-04-21 10:11:54 +0200 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-04-21 10:18:35 +0200 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-04-21 10:19:04 +0200 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-04-21 10:19:18 +0200 | hosklla | (~user@user/hosklla) |
2024-04-21 10:19:35 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-04-21 10:20:57 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 10:26:01 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-04-21 10:26:10 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 10:28:46 +0200 | Piedro | (~Piedro@85.254.74.244) (Remote host closed the connection) |
2024-04-21 10:29:08 +0200 | Piedro | (~Piedro@85.254.74.244) |
2024-04-21 10:29:33 +0200 | Piedro | (~Piedro@85.254.74.244) (Remote host closed the connection) |
2024-04-21 10:29:54 +0200 | internatetional | (~nate@2001:448a:20a3:c2e5:71b9:a710:2866:667f) |
2024-04-21 10:29:55 +0200 | Piedro | (~Piedro@85.254.74.244) |
2024-04-21 10:34:13 +0200 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) |
2024-04-21 10:42:33 +0200 | qqq | (~qqq@92.43.167.61) |
2024-04-21 10:44:18 +0200 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) (Quit: zzz) |
2024-04-21 10:48:46 +0200 | yin | (~yin@user/zero) (Ping timeout: 255 seconds) |
2024-04-21 10:55:31 +0200 | yin | (~yin@user/zero) |
2024-04-21 10:55:44 +0200 | zer0bitz | (~zer0bitz@user/zer0bitz) (Quit: https://zer0bitz.dy.fi) |
2024-04-21 10:57:38 +0200 | target_i | (~target_i@user/target-i/x-6023099) |
2024-04-21 11:04:18 +0200 | bilegeek | (~bilegeek@2600:1008:b010:6f31:97f2:4443:40ea:6a83) (Quit: Leaving) |
2024-04-21 11:05:23 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds) |
2024-04-21 11:05:49 +0200 | oo_miguel | (~Thunderbi@78-11-181-16.static.ip.netia.com.pl) |
2024-04-21 11:05:58 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) |
2024-04-21 11:16:02 +0200 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
2024-04-21 11:18:15 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-04-21 11:18:32 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 11:21:54 +0200 | Piedro | (~Piedro@85.254.74.244) (Remote host closed the connection) |
2024-04-21 11:33:06 +0200 | JamesMowery7 | (~JamesMowe@ip98-171-80-211.ph.ph.cox.net) |
2024-04-21 11:35:21 +0200 | JamesMowery | (~JamesMowe@ip98-171-80-211.ph.ph.cox.net) (Ping timeout: 268 seconds) |
2024-04-21 11:35:21 +0200 | JamesMowery7 | JamesMowery |
2024-04-21 11:38:46 +0200 | sawilagar | (~sawilagar@user/sawilagar) |
2024-04-21 11:39:56 +0200 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2024-04-21 11:41:50 +0200 | gmg | (~user@user/gehmehgeh) |
2024-04-21 11:42:48 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 11:43:12 +0200 | ph88 | (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) |
2024-04-21 11:44:23 +0200 | <ph88> | How can i use OverloadedRecordDot with qualified imports for the field accessor? |
2024-04-21 11:47:53 +0200 | <tomsmeding> | you write the module qualifier in very small text above the dot |
2024-04-21 11:51:26 +0200 | <tomsmeding> | the documentation ( https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/overloaded_record_dot.html#extensio… ) states that the projection expressions are desugared to getField ( https://hackage.haskell.org/package/base-4.19.1.0/docs/GHC-Records.html ), which itself is just a type class and hence allows you to qualify anything, but it seems like the syntax of |
2024-04-21 11:51:28 +0200 | <tomsmeding> | OverloadedRecordDot does not |
2024-04-21 11:52:50 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 11:54:04 +0200 | xdminsy | (~xdminsy@117.147.70.233) |
2024-04-21 11:54:32 +0200 | xdminsy | (~xdminsy@117.147.70.233) (Read error: Connection reset by peer) |
2024-04-21 11:57:28 +0200 | Square | (~Square@user/square) |
2024-04-21 11:58:25 +0200 | qqq | (~qqq@92.43.167.61) (Read error: Connection reset by peer) |
2024-04-21 11:59:57 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-04-21 12:03:30 +0200 | qqq | (~qqq@92.43.167.61) |
2024-04-21 12:04:42 +0200 | yin | (~yin@user/zero) (Ping timeout: 252 seconds) |
2024-04-21 12:16:43 +0200 | jespada | (~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net) (Ping timeout: 260 seconds) |
2024-04-21 12:19:16 +0200 | CodeKiwi | (~kiwi@2604:a880:400:d0::1ca0:e001) (Ping timeout: 260 seconds) |
2024-04-21 12:20:10 +0200 | jespada | (~jespada@cpc121308-nmal25-2-0-cust15.19-2.cable.virginm.net) |
2024-04-21 12:36:06 +0200 | qqq | (~qqq@92.43.167.61) (Ping timeout: 268 seconds) |
2024-04-21 12:37:49 +0200 | qqq | (~qqq@92.43.167.61) |
2024-04-21 12:44:33 +0200 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2024-04-21 12:44:55 +0200 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 245 seconds) |
2024-04-21 12:46:46 +0200 | xdminsy | (~xdminsy@117.147.70.233) |
2024-04-21 12:47:26 +0200 | Lord_of_Life_ | Lord_of_Life |
2024-04-21 12:52:22 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds) |
2024-04-21 12:54:09 +0200 | hosklla | (~user@user/hosklla) (Remote host closed the connection) |
2024-04-21 12:54:17 +0200 | hosklla | (~user@p200300f917158a00390765bd42a9c16b.dip0.t-ipconnect.de) |
2024-04-21 12:56:08 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) |
2024-04-21 12:58:35 +0200 | Inst | (~Inst@user/Inst) (Ping timeout: 252 seconds) |
2024-04-21 13:01:19 +0200 | rvalue- | (~rvalue@user/rvalue) |
2024-04-21 13:01:41 +0200 | xdminsy | (~xdminsy@117.147.70.233) (Ping timeout: 268 seconds) |
2024-04-21 13:02:03 +0200 | xdminsy | (~xdminsy@117.147.70.233) |
2024-04-21 13:02:23 +0200 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 264 seconds) |
2024-04-21 13:03:29 +0200 | mrmr1553343 | (~mrmr@user/mrmr) (Quit: Bye, See ya later!) |
2024-04-21 13:07:05 +0200 | rvalue- | rvalue |
2024-04-21 13:18:24 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 252 seconds) |
2024-04-21 13:26:57 +0200 | mrmr1553343 | (~mrmr@user/mrmr) |
2024-04-21 13:33:38 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 13:35:53 +0200 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
2024-04-21 13:42:16 +0200 | target_i | (~target_i@user/target-i/x-6023099) |
2024-04-21 13:42:43 +0200 | qqq | (~qqq@92.43.167.61) (Remote host closed the connection) |
2024-04-21 13:43:15 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 13:45:43 +0200 | <ph88> | hahaah "in very small text above the dot" if only if i would write out my code on paper xD |
2024-04-21 13:47:51 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 255 seconds) |
2024-04-21 13:53:13 +0200 | qqq | (~qqq@92.43.167.61) |
2024-04-21 13:58:50 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 14:04:30 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 245 seconds) |
2024-04-21 14:05:19 +0200 | ht_ | (~Thunderbi@194.110.115.39) |
2024-04-21 14:06:10 +0200 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Ping timeout: 245 seconds) |
2024-04-21 14:06:10 +0200 | ht_ | _ht |
2024-04-21 14:18:36 +0200 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine) |
2024-04-21 14:19:24 +0200 | ocra8 | (ocra8@user/ocra8) |
2024-04-21 14:20:09 +0200 | tomsmeding | . o O ( https://en.wikipedia.org/wiki/Epigram_(programming_language) ) |
2024-04-21 14:20:22 +0200 | <tomsmeding> | (the layout in the first code example is borked, the first line needs 5 spaces before the first '(' ) |
2024-04-21 14:21:04 +0200 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) |
2024-04-21 14:29:28 +0200 | __monty__ | (~toonn@user/toonn) |
2024-04-21 14:41:43 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 14:46:29 +0200 | <ph88> | How can i unwrap 2 monads with do-syntax? example https://bpa.st/B5ZQ |
2024-04-21 14:48:32 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 256 seconds) |
2024-04-21 14:50:34 +0200 | <int-e> | @unmtl ExceptT e m a |
2024-04-21 14:50:34 +0200 | <lambdabot> | m (Either e a) |
2024-04-21 14:51:23 +0200 | <int-e> | (Basically you don't, but you could use the the ExceptT monad transformer to accomplish what you probably want. And it'll be isomorphic to the m (Either a b) you already have) |
2024-04-21 14:54:43 +0200 | <ph88> | would be nice to just make that arrow a bit longer `<-` into `<--` for every additional unwrap add another dash :D |
2024-04-21 14:57:28 +0200 | <int-e> | It's not at all clear what that means in general. |
2024-04-21 14:59:31 +0200 | <int-e> | (Recall that do notation is syntax sugar. It's worth pondering what that hypothetical <-- arrow would desugar to, if anything.) |
2024-04-21 15:00:00 +0200 | <int-e> | @undo do x <- b; c x |
2024-04-21 15:00:00 +0200 | <lambdabot> | b >>= \ x -> c x |
2024-04-21 15:01:52 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 15:08:04 +0200 | tok | (~user@user/tok) |
2024-04-21 15:20:48 +0200 | <haskellbridge> | <i​rregularsphere> int-e: I think he meant as in more syntax sugar. |
2024-04-21 15:20:48 +0200 | <haskellbridge> | <i​rregularsphere> (`b :: m (n a)`) `do { xs <- b; x <-- b; return (xs, x) }` -> `b >>= \xs -> (b >>=' \x -> (return (xs, x))` with `>>='` being some other bind with the type `m (n a) -> (a -> m (n b)) -> m (n b)` |
2024-04-21 15:20:50 +0200 | <haskellbridge> | <i​rregularsphere> however it becomes clear that this does not work since not all monads compose together into another monad |
2024-04-21 15:20:57 +0200 | <haskellbridge> | <i​rregularsphere> does not work in some situations* |
2024-04-21 15:23:58 +0200 | <haskellbridge> | <i​rregularsphere> this can be simulated though, if `b :: Compose m n a` and `Monad (Compose m n)` then (I think) the above do notation can be simulated by this: |
2024-04-21 15:23:58 +0200 | <haskellbridge> | <i​rregularsphere> `do { xs <- fmap pure b; x <- b; return (xs, x) }` |
2024-04-21 15:27:39 +0200 | <haskellbridge> | <i​rregularsphere> i meant `do { xs <- Compose (fmap pure (getCompose b)); x <- b; return (xs, x)}` |
2024-04-21 15:27:45 +0200 | <haskellbridge> | <i​rregularsphere> uhh... |
2024-04-21 15:30:24 +0200 | <haskellbridge> | <i​rregularsphere> ph88: anyways not all two monads compose to another monad, and I suggest looking into monad transformers |
2024-04-21 15:30:28 +0200 | rosco | (rosco@gateway/vpn/airvpn/rosco) |
2024-04-21 15:30:55 +0200 | <ski> | idioms compose |
2024-04-21 15:31:12 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 15:31:48 +0200 | <haskellbridge> | <i​rregularsphere> how do I define an idiom in Haskell code :P |
2024-04-21 15:32:14 +0200 | <haskellbridge> | <i​rregularsphere> do I use literate Haskell for that |
2024-04-21 15:34:14 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 260 seconds) |
2024-04-21 15:34:14 +0200 | rosco | (rosco@gateway/vpn/airvpn/rosco) (Client Quit) |
2024-04-21 15:35:03 +0200 | <ski> | "idiom", in this context, is a synonym for "applicative functor" |
2024-04-21 15:35:28 +0200 | <haskellbridge> | <i​rregularsphere> ah |
2024-04-21 15:36:00 +0200 | <haskellbridge> | <i​rregularsphere> yeah applicative functors compose, then you can use applicative dos but it's limited |
2024-04-21 15:36:26 +0200 | <ncf> | you could say "idiom" is an idiom at this point |
2024-04-21 15:37:01 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2024-04-21 15:39:55 +0200 | danza | (~francesco@151.35.224.182) |
2024-04-21 15:44:55 +0200 | Square | (~Square@user/square) (Ping timeout: 245 seconds) |
2024-04-21 15:45:19 +0200 | <ski> | "Idioms: Applicatie Programming with Effects" (functional pearl) by Conor McBride,Ross Paterson at <http://strictlypositive.org/Idiom.pdf> ; <https://mail.haskell.org/pipermail/haskell/2004-July/014315.html>,<https://wiki.haskell.org/Applicative_functor> |
2024-04-21 15:45:50 +0200 | <ski> | (two more versions of the paper, at <http://strictlypositive.org/>) |
2024-04-21 15:54:34 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 15:56:53 +0200 | rosco | (~rosco@yp-146-6.tm.net.my) |
2024-04-21 15:58:13 +0200 | danza | (~francesco@151.35.224.182) (Ping timeout: 246 seconds) |
2024-04-21 16:01:41 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 240 seconds) |
2024-04-21 16:03:11 +0200 | noumenon | (~noumenon@113.51-175-156.customer.lyse.net) |
2024-04-21 16:04:35 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 16:06:41 +0200 | xdminsy | (~xdminsy@117.147.70.233) (Read error: Connection reset by peer) |
2024-04-21 16:09:41 +0200 | phma | (phma@2001:5b0:211f:5788:9247:2ba3:4ac:7601) (Read error: Connection reset by peer) |
2024-04-21 16:10:38 +0200 | phma | (~phma@2001:5b0:211c:6428:fc4d:883f:37de:f618) |
2024-04-21 16:11:39 +0200 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2024-04-21 16:12:16 +0200 | xdminsy | (~xdminsy@117.147.70.233) |
2024-04-21 16:15:28 +0200 | son0p | (~ff@191.104.18.195) (Quit: Leaving) |
2024-04-21 16:21:06 +0200 | yin | (~yin@user/zero) |
2024-04-21 16:24:55 +0200 | titibandit | (~titibandi@user/titibandit) (Ping timeout: 245 seconds) |
2024-04-21 16:26:52 +0200 | philopsos | (~caecilius@user/philopsos) |
2024-04-21 16:27:55 +0200 | Piedro | (~Piedro@85.254.74.244) |
2024-04-21 16:32:06 +0200 | adanwan_ | (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 260 seconds) |
2024-04-21 16:32:14 +0200 | philopsos | (~caecilius@user/philopsos) (Ping timeout: 256 seconds) |
2024-04-21 16:33:51 +0200 | adanwan | (~adanwan@gateway/tor-sasl/adanwan) |
2024-04-21 16:34:26 +0200 | ht_ | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) |
2024-04-21 16:34:45 +0200 | pavonia | (~user@user/siracusa) |
2024-04-21 16:34:49 +0200 | rosco | (~rosco@yp-146-6.tm.net.my) (Remote host closed the connection) |
2024-04-21 16:35:40 +0200 | _ht | (~Thunderbi@194.110.115.39) (Ping timeout: 268 seconds) |
2024-04-21 16:35:40 +0200 | ht_ | _ht |
2024-04-21 16:38:29 +0200 | rosco | (~rosco@yp-146-6.tm.net.my) |
2024-04-21 16:41:20 +0200 | r5c4571lh01987 | (rscastilho@179.221.142.8) |
2024-04-21 16:43:29 +0200 | yin | (~yin@user/zero) (Quit: Lost terminal) |
2024-04-21 16:45:21 +0200 | son0p | (~ff@191.104.18.195) |
2024-04-21 16:54:34 +0200 | notzmv | (~daniel@user/notzmv) |
2024-04-21 16:58:57 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 17:21:47 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-04-21 17:21:53 +0200 | myxokephale | (~myxos@172.93.132.84) |
2024-04-21 17:22:28 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 17:23:59 +0200 | myxos | (~myxos@65.28.251.121) (Ping timeout: 264 seconds) |
2024-04-21 17:24:04 +0200 | <ph88> | i​rregularsphere i imagine that would only type check for those situations that they do compose |
2024-04-21 17:24:53 +0200 | <ph88> | how many functional pearls are there ? |
2024-04-21 17:26:20 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Read error: Connection reset by peer) |
2024-04-21 17:29:14 +0200 | Ellenor | MelanieMalik |
2024-04-21 17:29:24 +0200 | MelanieMalik | MelMalik |
2024-04-21 17:36:50 +0200 | hgolden | (~hgolden@2603:8000:9d00:3ed1:f849:272c:fda5:33c9) |
2024-04-21 17:40:40 +0200 | madeleine-sydney | (~madeleine@c-76-155-235-153.hsd1.co.comcast.net) (Quit: Konversation terminated!) |
2024-04-21 17:46:18 +0200 | adanwan | (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 260 seconds) |
2024-04-21 17:46:53 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-04-21 17:48:47 +0200 | adanwan | (~adanwan@gateway/tor-sasl/adanwan) |
2024-04-21 17:50:46 +0200 | pepeiborra | (sid443799@id-443799.ilkley.irccloud.com) (Quit: Connection closed for inactivity) |
2024-04-21 17:51:42 +0200 | acertain_ | (sid470584@id-470584.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
2024-04-21 17:51:58 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) () |
2024-04-21 17:52:34 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-04-21 18:05:16 +0200 | zer0bitz | (~zer0bitz@user/zer0bitz) |
2024-04-21 18:06:07 +0200 | <[exa]> | ph88: they get published in small count with each ICFP and JFP issue so I'd say a few dozen at this point |
2024-04-21 18:06:16 +0200 | <ph88> | nice :> |
2024-04-21 18:11:54 +0200 | econo_ | (uid147250@id-147250.tinside.irccloud.com) |
2024-04-21 18:14:14 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 18:20:45 +0200 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 245 seconds) |
2024-04-21 18:22:12 +0200 | <monochrom> | Haha it's official, Ningning Xie declares that LYAH is a great book. >:) |
2024-04-21 18:23:26 +0200 | rosco | (~rosco@yp-146-6.tm.net.my) (Quit: Lost terminal) |
2024-04-21 18:25:22 +0200 | michalz | (~michalz@185.246.207.203) |
2024-04-21 18:26:24 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 252 seconds) |
2024-04-21 18:27:28 +0200 | madariaga | (~madariaga@user/madariaga) |
2024-04-21 18:31:15 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Quit: WeeChat 4.2.2) |
2024-04-21 18:33:19 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-04-21 18:35:55 +0200 | driib | (~driib@vmi931078.contaboserver.net) (Ping timeout: 268 seconds) |
2024-04-21 18:36:31 +0200 | Guest13 | (~Guest13@cpc93370-hers8-2-0-cust590.6-3.cable.virginm.net) |
2024-04-21 18:40:26 +0200 | <Guest13> | hi, I have a beginner question on optimising a recursive function. for context, I am trying to complete aoc2023 day 8. this is my function, which runs correctly on the smaller instances but hangs for some time on the larger graph: |
2024-04-21 18:40:26 +0200 | <Guest13> | recurseSol :: Graph -> Int -> [String] -> String -> Int |
2024-04-21 18:40:27 +0200 | <Guest13> | recurseSol graph depth state (i:is) = case end of |
2024-04-21 18:40:27 +0200 | <Guest13> | Â True -> depth |
2024-04-21 18:40:28 +0200 | <Guest13> | Â otherwise -> recurseSol graph (depth+1) next is |
2024-04-21 18:40:28 +0200 | <Guest13> | Â where next = map (\node -> if (i == 'L') then fst (graph M.! node) else snd (graph M.! node)) state |
2024-04-21 18:40:29 +0200 | <Guest13> | Â Â Â Â end = (==0) . length $ filter (\[_,_,c] -> c/='Z') state |
2024-04-21 18:40:29 +0200 | <Guest13> | at each step I check if I have reached the final states. does passing graph in at each step make this very inefficient or is it store as I do not change it? is there a way to make Haskell calculate the value of the state at each step, as it can only know it has reached the end this way. thank you for any help |
2024-04-21 18:41:23 +0200 | internatetional | (~nate@2001:448a:20a3:c2e5:71b9:a710:2866:667f) (Quit: WeeChat 4.2.1) |
2024-04-21 18:41:28 +0200 | <Guest13> | also, I would appreciate if anyone can point out some obvious improvements to the code (both efficiency and how it is written) |
2024-04-21 18:43:41 +0200 | <monochrom> | graph is passed by pointer and not cloned, it's only O(1). |
2024-04-21 18:43:48 +0200 | danza | (~francesco@151.35.246.62) |
2024-04-21 18:45:07 +0200 | <monochrom> | "length xs == 0" takes time proportional to length xs and is a dumb way to say "null xs" which takes only O(1) time. |
2024-04-21 18:45:29 +0200 | <Guest13> | '=D |
2024-04-21 18:45:45 +0200 | <ncf> | this can be compressed even further using all |
2024-04-21 18:45:46 +0200 | <ncf> | :t all |
2024-04-21 18:45:47 +0200 | <lambdabot> | Foldable t => (a -> Bool) -> t a -> Bool |
2024-04-21 18:46:02 +0200 | <Guest13> | ahhh |
2024-04-21 18:46:32 +0200 | <Guest13> | idk why I did it like that I will use all |
2024-04-21 18:47:43 +0200 | <ncf> | IIRC this is one of the first problems that required actual thought, so a naive solution like that isn't gonna work |
2024-04-21 18:48:08 +0200 | <ncf> | if i still remember correctly, solving this required making assumptions about the input that weren't contained in the problem text, so... good luck |
2024-04-21 18:48:43 +0200 | Raito_Bezarius | (~Raito@wireguard/tunneler/raito-bezarius) (Read error: Connection reset by peer) |
2024-04-21 18:49:00 +0200 | <Guest13> | ok back to drawing board I guess. I was gonna step through the instructions but it is taking some time |
2024-04-21 18:49:07 +0200 | orenty7 | (~orenty7@185.117.121.249) |
2024-04-21 18:49:07 +0200 | <Guest13> | I thought my code was problem |
2024-04-21 18:49:37 +0200 | <int-e> | the answer is rather big |
2024-04-21 18:49:45 +0200 | <Guest13> | but I need to solve it differently, maybe by figuring out like a phase difference between each ending state and then working out when they will meet |
2024-04-21 18:50:01 +0200 | Raito_Bezarius | (~Raito@wireguard/tunneler/raito-bezarius) |
2024-04-21 18:50:25 +0200 | <int-e> | ncf: I wouldn't say "required" for this particular one, but there was a huge shortcut because of special input properties. |
2024-04-21 18:50:36 +0200 | bitmapper | (uid464869@id-464869.lymington.irccloud.com) |
2024-04-21 18:51:09 +0200 | Raito_Bezarius | (~Raito@wireguard/tunneler/raito-bezarius) (Max SendQ exceeded) |
2024-04-21 18:51:10 +0200 | orenty7 | (~orenty7@185.117.121.249) (Client Quit) |
2024-04-21 18:51:10 +0200 | <ncf> | right |
2024-04-21 18:52:24 +0200 | wroathe | (~wroathe@user/wroathe) |
2024-04-21 18:53:23 +0200 | <c_wraith> | I didn't use the shortcut, I did it the "hard" way. Which is really the same thing, except with a little more arithmetic. |
2024-04-21 18:53:55 +0200 | <Guest13> | I think if I used HashMap it would also be a LOT faster xd |
2024-04-21 18:54:03 +0200 | <Guest13> | just realised it was a treetop by default |
2024-04-21 18:54:37 +0200 | <c_wraith> | Guest13: that's almost completely irrelevant. I see that my solution was a 14-digit number. You're not iterating that high with any data structure. |
2024-04-21 18:55:33 +0200 | <int-e> | ncf: which was funny because I wrote code for part 2 on autopilot without thinking nearly as much as I should have, submitted the answer, which was correct, and then I started to think for real and asking why the fuck that worked. |
2024-04-21 18:55:50 +0200 | <ncf> | same |
2024-04-21 18:55:50 +0200 | <Guest13> | this happens anyway "*** Exception: stack overflow" |
2024-04-21 18:56:00 +0200 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) |
2024-04-21 18:56:35 +0200 | <ski> | (maybe forcing `depth' would help with that ?) |
2024-04-21 18:57:20 +0200 | <int-e> | it was 14 digits here too |
2024-04-21 18:57:24 +0200 | <Guest13> | this problem looks hard for me |
2024-04-21 18:57:47 +0200 | <c_wraith> | you can't brute-force it. You need to figure out how to break it down into subproblems and then combine the results from those subproblems. |
2024-04-21 18:58:17 +0200 | <int-e> | (and takes a fraction of a second to find) |
2024-04-21 18:58:26 +0200 | <Guest13> | yeah I was thinking of doing something like "how often does each ghost reach an end state" |
2024-04-21 18:58:37 +0200 | <c_wraith> | that's the right track. |
2024-04-21 18:58:41 +0200 | <Guest13> | and finding the gcd of that |
2024-04-21 18:58:54 +0200 | <c_wraith> | you'd want lcm, but they're nearly the same. :P |
2024-04-21 18:59:01 +0200 | <Guest13> | yeah that's what I mean lol |
2024-04-21 19:01:16 +0200 | <Guest13> | so it would be find when ghost reaches same state + same instruction |
2024-04-21 19:01:23 +0200 | <Guest13> | instruction number |
2024-04-21 19:03:21 +0200 | <Guest13> | idk this is hard but thank you for the help! I will think about the problem a bit more. I'm not sure about the input properties you mention but I think I can solve it anyway |
2024-04-21 19:03:29 +0200 | Guest13 | (~Guest13@cpc93370-hers8-2-0-cust590.6-3.cable.virginm.net) (Quit: Client closed) |
2024-04-21 19:05:20 +0200 | <ncf> | so i guess the fully general problem looks like: you have a bunch of eventually periodic lists of numbers (steps until the next final state) and you want to find their smallest common cumulative sum-of-prefix |
2024-04-21 19:05:46 +0200 | <ncf> | with the "nice" case being when all lists are constant, in which case the answer is LCM |
2024-04-21 19:06:06 +0200 | <c_wraith> | the fully general version looks like "I have a bunch of cycles with various starting points, and I want to align them", which... works out to be CRT. |
2024-04-21 19:06:40 +0200 | <int-e> | It turns out to be NP-hard, but the actual instance isn't nasty at all. |
2024-04-21 19:06:56 +0200 | <ncf> | CRT isn't NP-hard, so one of you is lying |
2024-04-21 19:07:17 +0200 | <int-e> | it's *many* CRTs, one for each choice of final states in the loop |
2024-04-21 19:07:29 +0200 | <int-e> | and that number can be exponential |
2024-04-21 19:07:42 +0200 | <ncf> | ah i see |
2024-04-21 19:08:34 +0200 | Raito_Bezarius | (~Raito@wireguard/tunneler/raito-bezarius) |
2024-04-21 19:08:50 +0200 | <int-e> | s/loop/loops/ |
2024-04-21 19:10:45 +0200 | <int-e> | I never figured out whether the general version of day 20 is decidable or not. |
2024-04-21 19:13:22 +0200 | <ncf> | lol https://github.com/ncfavier/aoc/blob/main/src/2023/Day20.hs#L51 |
2024-04-21 19:13:26 +0200 | <ncf> | can you tell i was pissed |
2024-04-21 19:14:44 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-04-21 19:14:52 +0200 | <ncf> | ah yes that was the one you had to render as an SVG to actually understand what was going on |
2024-04-21 19:16:37 +0200 | <int-e> | I only looked at the fact that the final gate was a conjunction and remembered day 8 ;-) |
2024-04-21 19:17:44 +0200 | <int-e> | I also produced https://paste.debian.net/1314729/ but that was way later |
2024-04-21 19:21:36 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 260 seconds) |
2024-04-21 19:21:57 +0200 | madariaga | (~madariaga@user/madariaga) (Quit: madariaga) |
2024-04-21 19:24:04 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 19:32:04 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 246 seconds) |
2024-04-21 19:34:01 +0200 | tabemann | (~tabemann@2600:1700:7990:24e0:6221:c407:995f:5743) (Remote host closed the connection) |
2024-04-21 19:34:14 +0200 | tabemann | (~tabemann@2600:1700:7990:24e0:2a56:ddeb:a57a:6071) |
2024-04-21 19:35:43 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-04-21 19:36:06 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 19:39:43 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-04-21 19:40:37 +0200 | titibandit | (~titibandi@user/titibandit) |
2024-04-21 19:40:40 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 255 seconds) |
2024-04-21 19:44:51 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) |
2024-04-21 19:52:57 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-04-21 20:03:43 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-04-21 20:07:47 +0200 | madariaga | (~madariaga@user/madariaga) |
2024-04-21 20:09:55 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 245 seconds) |
2024-04-21 20:11:43 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-04-21 20:12:25 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 20:20:24 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-04-21 20:21:49 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) |
2024-04-21 20:22:10 +0200 | euleritian | (~euleritia@dynamic-176-002-143-082.176.2.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-04-21 20:22:32 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 20:25:45 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-04-21 20:26:42 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-04-21 20:32:30 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-04-21 20:34:05 +0200 | danza | (~francesco@151.35.246.62) (Ping timeout: 245 seconds) |
2024-04-21 20:40:37 +0200 | madariaga | (~madariaga@user/madariaga) (Quit: madariaga) |
2024-04-21 20:41:13 +0200 | Sgeo | (~Sgeo@user/sgeo) |
2024-04-21 20:44:46 +0200 | wroathe | (~wroathe@user/wroathe) (Quit: leaving) |
2024-04-21 20:46:13 +0200 | <[exa]> | hm is kansas-lava (the vhdl thingy) officially dead dead, or is there some kind of a follow-up active project or so? |
2024-04-21 20:48:22 +0200 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) (Quit: So long and thanks for all the fish) |
2024-04-21 20:48:44 +0200 | TheCoffeMaker | (~TheCoffeM@user/thecoffemaker) |
2024-04-21 20:55:57 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-04-21 20:59:47 +0200 | dostoyevsky2 | (~sck@user/dostoyevsky2) (Quit: leaving) |
2024-04-21 21:00:00 +0200 | dostoyevsky2 | (~sck@user/dostoyevsky2) |
2024-04-21 21:03:21 +0200 | madariaga | (~madariaga@user/madariaga) |
2024-04-21 21:17:18 +0200 | califax_ | (~califax@user/califx) |
2024-04-21 21:17:42 +0200 | califax | (~califax@user/califx) (Ping timeout: 260 seconds) |
2024-04-21 21:18:24 +0200 | califax_ | califax |
2024-04-21 21:32:54 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 268 seconds) |
2024-04-21 21:37:39 +0200 | phma | (~phma@2001:5b0:211c:6428:fc4d:883f:37de:f618) (Read error: Connection reset by peer) |
2024-04-21 21:38:31 +0200 | phma | (~phma@2001:5b0:210f:be8:a757:5762:40a:c4be) |
2024-04-21 21:38:37 +0200 | danza | (~francesco@151.35.247.107) |
2024-04-21 21:45:34 +0200 | tok | (~user@user/tok) (Remote host closed the connection) |
2024-04-21 21:47:01 +0200 | danza | (~francesco@151.35.247.107) (Remote host closed the connection) |
2024-04-21 21:47:21 +0200 | danza | (~francesco@151.35.247.107) |
2024-04-21 21:52:25 +0200 | danza | (~francesco@151.35.247.107) (Ping timeout: 245 seconds) |
2024-04-21 21:56:19 +0200 | hosklla | (~user@p200300f917158a00390765bd42a9c16b.dip0.t-ipconnect.de) (Remote host closed the connection) |
2024-04-21 21:57:46 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 21:59:44 +0200 | random-jellyfish | (~developer@user/random-jellyfish) |
2024-04-21 22:03:14 +0200 | _d0t | (~{-d0t-}@user/-d0t-/x-7915216) (Remote host closed the connection) |
2024-04-21 22:04:18 +0200 | <energizer> | if there's a type class B then it's possible to make a subclass B x => C x but is it possible to do the reverse, make a superclass B x <= A x ? |
2024-04-21 22:04:48 +0200 | dsrt^ | (~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Remote host closed the connection) |
2024-04-21 22:05:30 +0200 | _d0t | (~{-d0t-}@user/-d0t-/x-7915216) |
2024-04-21 22:06:01 +0200 | <ncf> | you can have a (possibly overlapping) instance A x => B x |
2024-04-21 22:06:14 +0200 | <c_wraith> | energizer: no. The option that plays most nicely with Haskell's type system is to provide a default implementation of A in terms of B and give people nice tools to use that implementation quickly to create an instance of A for something that is an instance of B |
2024-04-21 22:06:28 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 255 seconds) |
2024-04-21 22:07:10 +0200 | <energizer> | are there any languages that have this feature? |
2024-04-21 22:11:10 +0200 | <c_wraith> | I can't think of any. It's a relatively difficult feature to use. The potential for ambiguity in resolution seems really bad for predictable code. |
2024-04-21 22:14:05 +0200 | ski | . o O ( "Supertyping Suggestion for Haskell" by jmeacham at <http://repetae.net/recent/out/supertyping.html> ) |
2024-04-21 22:23:21 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Quit: WeeChat 4.2.2) |
2024-04-21 22:23:29 +0200 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection) |
2024-04-21 22:24:28 +0200 | random-jellyfish | (~developer@user/random-jellyfish) (Ping timeout: 255 seconds) |
2024-04-21 22:25:25 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-04-21 22:31:49 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 22:33:17 +0200 | DdavizinHood | (~davizinho@30.red-80-27-28.dynamicip.rima-tde.net) |
2024-04-21 22:36:57 +0200 | <monochrom> | Something like that is usually under the name "mixin" in other languages. |
2024-04-21 22:37:53 +0200 | random-jellyfish | (~developer@2a02:2f04:11e:c600:ef9e:2acc:864b:e2f4) |
2024-04-21 22:37:54 +0200 | random-jellyfish | (~developer@2a02:2f04:11e:c600:ef9e:2acc:864b:e2f4) (Changing host) |
2024-04-21 22:37:54 +0200 | random-jellyfish | (~developer@user/random-jellyfish) |
2024-04-21 22:37:59 +0200 | <monochrom> | But we don't have it in Haskell. It is why FAM was a change that broke backward compatibility. |
2024-04-21 22:40:05 +0200 | <energizer> | i dont see how mixins do that |
2024-04-21 22:40:55 +0200 | <energizer> | afaik mixins are just normal classes which you can add to your class while you're writing it, which is just the same as a normal class extension situation |
2024-04-21 22:42:50 +0200 | <EvanR> | just add two classes |
2024-04-21 22:43:07 +0200 | <EvanR> | is this simple addition associative and commutative |
2024-04-21 22:44:05 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 245 seconds) |
2024-04-21 22:45:04 +0200 | <energizer> | that works on types i write, it doesnt work on types already written |
2024-04-21 22:49:46 +0200 | r5c4571lh01987 | (rscastilho@179.221.142.8) (Remote host closed the connection) |
2024-04-21 22:50:48 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 22:51:31 +0200 | titibandit | (~titibandi@user/titibandit) (Remote host closed the connection) |
2024-04-21 22:58:15 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) (Ping timeout: 245 seconds) |
2024-04-21 23:01:44 +0200 | <juri_> | wow. stan has gained a maintainer. |
2024-04-21 23:03:18 +0200 | DdavizinHood | (~davizinho@30.red-80-27-28.dynamicip.rima-tde.net) (Read error: Connection reset by peer) |
2024-04-21 23:04:08 +0200 | <juri_> | tomjaguarpaw: Thanks! :) |
2024-04-21 23:05:28 +0200 | masaeedu | (~masaeedu@user/masaeedu) (Read error: Connection reset by peer) |
2024-04-21 23:05:55 +0200 | dyniec | (~dyniec@dybiec.info) (Quit: WeeChat 3.8) |
2024-04-21 23:06:38 +0200 | masaeedu | (~masaeedu@user/masaeedu) |
2024-04-21 23:07:09 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 256 seconds) |
2024-04-21 23:07:27 +0200 | dyniec | (~dyniec@dybiec.info) |
2024-04-21 23:08:17 +0200 | zetef | (~quassel@5.2.182.98) |
2024-04-21 23:09:50 +0200 | <c_wraith> | energizer: My viewpoint is that a type should never implicitly be made an instance of a class. There should always be intent. In the end, it makes mistakes harder to make. |
2024-04-21 23:10:14 +0200 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2024-04-21 23:13:28 +0200 | <energizer> | c_wraith: there are two kinds of problems i can think of. one is incorrectness: i superclass a class and define some methods that depend for their correctness on some property which doesn't actually hold. this could happen in haskell because it doesnt enforce laws but a more muscular type system could solve this. the other problem is method selection ambiguity, diamond problem kinda stuff. this seems harder, i'm not sure how to make this work |
2024-04-21 23:13:28 +0200 | <energizer> | automatically. |
2024-04-21 23:14:01 +0200 | <c_wraith> | there's a third class, which is "I explicitly did not want this type to be an instance of that" |
2024-04-21 23:15:12 +0200 | <energizer> | why would that be? |
2024-04-21 23:15:43 +0200 | <c_wraith> | In general, because you are making a type for one purpose, and using it anywhere else is wrong. |
2024-04-21 23:16:50 +0200 | <energizer> | what is the negative actual-consequence? |
2024-04-21 23:17:02 +0200 | <c_wraith> | depends on the use case. |
2024-04-21 23:17:13 +0200 | <c_wraith> | But mostly, it's about type safety |
2024-04-21 23:17:47 +0200 | <c_wraith> | When you create a set of interlocking types for safety in that system, it's not ideal when someone else can *accidentally* break it. |
2024-04-21 23:17:58 +0200 | <c_wraith> | It's one thing if they intentionally break it |
2024-04-21 23:18:06 +0200 | <c_wraith> | But accidentally? That's entirely different |
2024-04-21 23:18:15 +0200 | <energizer> | i dont see how this can happen if the laws are enforced |
2024-04-21 23:18:34 +0200 | <c_wraith> | I don't see how laws are relevant. |
2024-04-21 23:19:04 +0200 | <c_wraith> | "I don't want this to compile" is an orthogonal statement to "this can be made to compile in a way that follows some rules" |
2024-04-21 23:19:50 +0200 | <geekosaur> | you should not be able to add two ages, and you can't describe that as a law, only as absence of (in Haskell) a Num instance |
2024-04-21 23:20:09 +0200 | Lycurgus | (~georg@user/Lycurgus) (Quit: leaving) |
2024-04-21 23:20:21 +0200 | <energizer> | finally, an example |
2024-04-21 23:20:56 +0200 | <energizer> | ok so how does adding ages accidentally happen in a world where there is superclassing |
2024-04-21 23:21:43 +0200 | <c_wraith> | You say "oh, all instances of Affine can be instances of Num!" and write a superclass for that, creating an instance of Num for your Age type. |
2024-04-21 23:22:05 +0200 | <c_wraith> | Making Age an instance of Affine makes perfect sense! |
2024-04-21 23:23:18 +0200 | <energizer> | "all instances of Affine can be instances of Num" is that a thing? i dont know what Num is supposed to mean tbh |
2024-04-21 23:23:28 +0200 | <c_wraith> | They *can* be. |
2024-04-21 23:23:41 +0200 | <c_wraith> | They almost universally *shouldn't* be. |
2024-04-21 23:24:27 +0200 | <energizer> | so you're telling me the laws of Num don't necessarily hold for Affine? |
2024-04-21 23:24:37 +0200 | <c_wraith> | No, I'm saying it's semantically incorrect |
2024-04-21 23:25:00 +0200 | <c_wraith> | You don't multiply two Times together. That's a meaningless operation. |
2024-04-21 23:25:12 +0200 | <c_wraith> | You don't multiply two points together. That's a meaningless operation. |
2024-04-21 23:25:32 +0200 | michalz | (~michalz@185.246.207.203) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-04-21 23:26:57 +0200 | <EvanR> | how would automatic Num instance for all Affine even work |
2024-04-21 23:27:00 +0200 | <energizer> | in haskell you can't write Affine t => Num t |
2024-04-21 23:27:12 +0200 | <energizer> | so i dont see what the problem is |
2024-04-21 23:27:16 +0200 | <EvanR> | how could you implement it |
2024-04-21 23:27:21 +0200 | <energizer> | exactly |
2024-04-21 23:27:23 +0200 | <c_wraith> | wrong question |
2024-04-21 23:27:34 +0200 | <EvanR> | energizer, but you were asking earlier for this feature in haskell |
2024-04-21 23:27:52 +0200 | <EvanR> | automatic superclassing |
2024-04-21 23:28:05 +0200 | <c_wraith> | The correct question is "does this example demonstrate to you why someone might desire to ensure their type is not an instance of a class?" |
2024-04-21 23:28:21 +0200 | <c_wraith> | Maybe it's not possible *here* |
2024-04-21 23:28:27 +0200 | <c_wraith> | But you will find some place where it is |
2024-04-21 23:28:34 +0200 | <energizer> | if A can't subclass B then B can't superclass A |
2024-04-21 23:28:54 +0200 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2024-04-21 23:29:06 +0200 | <EvanR> | also the sentiment behind the boston haskell video "typeclasses vs the world" might apply here |
2024-04-21 23:29:32 +0200 | <EvanR> | which can be used to show why typeclasses should not be thought of like OOP |
2024-04-21 23:30:14 +0200 | <EvanR> | because typeclass instances form an automatically coherent system |
2024-04-21 23:30:20 +0200 | Ram-Z | (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) (Ping timeout: 260 seconds) |
2024-04-21 23:30:51 +0200 | <EvanR> | unlike multiple inheritance |
2024-04-21 23:31:55 +0200 | <monochrom> | Actually "class Affine t => Num t" does not cause any mentioned problem. It does not say "every Affine instance is a Num instance". |
2024-04-21 23:32:40 +0200 | <c_wraith> | well. It says "every type is a Num instance". So it sort of does. :P |
2024-04-21 23:33:18 +0200 | <monochrom> | No, I wrote "class ... Num t", not "instance ... Num t". |
2024-04-21 23:33:26 +0200 | <c_wraith> | oh, right |
2024-04-21 23:33:54 +0200 | <EvanR> | the feature would be like class Affine t <= Num t |
2024-04-21 23:33:59 +0200 | <c_wraith> | I mistook it for fake injecting a superclass, which is done by an instance looking like that. |
2024-04-21 23:34:57 +0200 | <EvanR> | given a Num instance make an Affine instance, though then the instance selection is messed up |
2024-04-21 23:36:57 +0200 | dsrt^ | (~cd@c-98-242-74-66.hsd1.ga.comcast.net) |
2024-04-21 23:37:00 +0200 | <c_wraith> | in any case, the choice to not write an instance for a type should be something that's respected at least to the extent of requiring explicit action to add an instance to a type. |
2024-04-21 23:38:27 +0200 | <tomsmeding> | what would be the goal of adding a superclass to an existing class, even if it were possible? |
2024-04-21 23:38:46 +0200 | <tomsmeding> | ensure that you can use the methods of the new superclass for all types that are an instance of the existing class? |
2024-04-21 23:38:53 +0200 | <energizer> | yes |
2024-04-21 23:39:04 +0200 | <tomsmeding> | if that's possible, couldn't you just write those methods directly having just the existing class as context? |
2024-04-21 23:39:26 +0200 | Ram-Z | (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) |
2024-04-21 23:39:47 +0200 | <tomsmeding> | i.e. if the existing is B and the new is A, then instead of `class B x <= A x where foo :: ...`, just write `foo :: B x => ...` |
2024-04-21 23:40:04 +0200 | <tomsmeding> | if B is enough to define foo, then, well, B is enough to define foo |
2024-04-21 23:40:15 +0200 | tomsmeding | is probably missing something |
2024-04-21 23:41:03 +0200 | <tomsmeding> | I guess that doesn't work if A also already exists and you insist that you want to use A's methods directly |
2024-04-21 23:41:30 +0200 | <tomsmeding> | but then you aren't declaring a class, because it already existed |
2024-04-21 23:41:55 +0200 | <tomsmeding> | so presumably that's not the situatino |
2024-04-21 23:42:03 +0200 | ph88 | (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) (Quit: Leaving) |
2024-04-21 23:43:34 +0200 | <energizer> | answering all the questions requires more mental context than i'm able to pull together at the moment |
2024-04-21 23:44:35 +0200 | <tomsmeding> | :) |
2024-04-21 23:45:17 +0200 | <monochrom> | This is why one shouldn't casually suggest a new language feature. |
2024-04-21 23:45:59 +0200 | <monochrom> | This is why the sentiment "I don't need to have learned PL theory to think up a language feature, even a whole language" is dumb. |
2024-04-21 23:46:38 +0200 | <tomsmeding> | I mean, you can |
2024-04-21 23:46:50 +0200 | monochrom | looks at PHP |
2024-04-21 23:47:05 +0200 | <tomsmeding> | You should just be ready for people criticising your choices :p |
2024-04-21 23:47:14 +0200 | <tomsmeding> | Not every language needs to be well-designed |
2024-04-21 23:47:32 +0200 | <monochrom> | Great sysadmin. But his attitude against PLT is stupid. And it shows. |
2024-04-21 23:47:32 +0200 | <tomsmeding> | And one can learn to design languages by making mistakes |
2024-04-21 23:48:36 +0200 | <monochrom> | Well that's only the difference between "learn PL theory by lazy evaluation" and "learn PL theory by eager evaluation". It is not a difference between "don't learn" and "learn". |
2024-04-21 23:49:31 +0200 | <energizer> | i have thought up a language feature and had a chat about it, not sure what having learned PLT has to do with this |
2024-04-21 23:50:08 +0200 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
2024-04-21 23:50:45 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) |
2024-04-21 23:51:20 +0200 | <tomsmeding> | monochrom: the most relevant difference is between "learning from a book" and "learning from people in #haskell" |
2024-04-21 23:53:19 +0200 | demesne | (~demesne@50.35.88.207) |
2024-04-21 23:53:50 +0200 | <cheater> | is there a way to create a type such that users of my library have no way of creating a function that takes and returns that type? |
2024-04-21 23:54:00 +0200 | ocra8 | (ocra8@user/ocra8) (Quit: WeeChat 4.2.2) |
2024-04-21 23:54:03 +0200 | Ram-Z | (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) (Quit: ZNC - http://znc.in) |
2024-04-21 23:54:15 +0200 | <cheater> | like no way to write f :: MyType -> MyType |
2024-04-21 23:54:21 +0200 | <dolio> | No. |
2024-04-21 23:54:32 +0200 | <dolio> | Unless you don't export it or something. |
2024-04-21 23:54:57 +0200 | <monochrom> | You cannot stop people writing "f = id". But you can not-export the data constructors. Make your type an abstract type. |
2024-04-21 23:55:20 +0200 | paddymahoney | (~paddymaho@pool-99-250-26-190.cpe.net.cable.rogers.com) (Ping timeout: 245 seconds) |
2024-04-21 23:55:45 +0200 | <monochrom> | Data.Ratio is an example. |
2024-04-21 23:56:17 +0200 | acidjnk | (~acidjnk@p200300d6e714dc23587832274e83a4b7.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
2024-04-21 23:56:24 +0200 | ocra8 | (ocra8@user/ocra8) |
2024-04-21 23:56:32 +0200 | <glguy> | No, it's a *module* :) |
2024-04-21 23:56:49 +0200 | Ram-Z | (~Ram-Z@li1814-254.members.linode.com) |
2024-04-21 23:57:35 +0200 | <cheater> | right, makes sense, no id |
2024-04-21 23:57:45 +0200 | <cheater> | err well |
2024-04-21 23:57:47 +0200 | <cheater> | you know what i meant. |
2024-04-21 23:58:15 +0200 | <cheater> | hmm |
2024-04-21 23:58:25 +0200 | <cheater> | not exporting stuff makes sense. thanks. |