Logs on 2022-01-14 (liberachat/#haskell)
| 00:00:22 | <EvanR> | 1 / (1 - Boring) = N |
| 00:01:03 | <monochrom> | "fix (print 0 >>)" can have type "forall a. IO a", equivalently "IO Void". This type can inform me that I have a non-terminating program and it is intentionally so. |
| 00:01:17 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 00:01:21 | <opticblast> | https://stackoverflow.com/a/33115522 is a good resource on unit vs void |
| 00:01:34 | <monochrom> | If "print 0" itself also has the same type, this is making types less informative. |
| 00:02:12 | <opticblast> | oh, right, and Void also means nontermination, as described in https://www.fpcomplete.com/blog/2017/07/to-void-or-to-void/ |
| 00:03:21 | <monochrom> | But it all goes back to "I don't have information to give you" ≠ "I have impossible information to give you". |
| 00:04:29 | × | ouestbillie quits (~gallup@192-222-138-215.qc.cable.ebox.net) (Ping timeout: 256 seconds) |
| 00:05:43 | <EvanR> | I have exploding information to give you |
| 00:05:45 | <monochrom> | One more way to say the same thing: If "print 0" has type "IO Void", then it can also be trivially converted to the type "forall a. IO a" |
| 00:08:45 | → | perro joins (~perro@072-191-245-069.res.spectrum.com) |
| 00:09:05 | <sprout_> | neat, 0 bits of information is still information of absense |
| 00:09:11 | <sprout_> | ah well |
| 00:10:14 | <Raito_Bezarius> | I have some newtype Lang from Text.Shakespeare.I18N, I do import renderMessage, mkMessage from the module but whenever I want to do newtype coercion from Text to Lang using Lang someText, it fails with data constructor is not in the scope, does it ring any bell? |
| 00:12:55 | <Clint> | Raito_Bezarius: which version of shakespeare are you using? |
| 00:13:22 | <Raito_Bezarius> | shakespeare == 2.0.25.* Clint |
| 00:14:08 | <Clint> | Raito_Bezarius: i see https://hackage.haskell.org/package/shakespeare-2.0.25.1/docs/Text-Shakespeare-I18N.html#t:Lang |
| 00:14:20 | <Raito_Bezarius> | indeed |
| 00:14:46 | <Clint> | so, that's not a newtype |
| 00:15:01 | <Raito_Bezarius> | right ; hm, how can I lift Text to Lang then? is type only a type alias? |
| 00:15:22 | <geekosaur> | yes |
| 00:15:31 | <Raito_Bezarius> | alright |
| 00:15:32 | <geekosaur> | so it's already a Lang |
| 00:16:13 | <Raito_Bezarius> | hm hls got me confused |
| 00:16:34 | <Raito_Bezarius> | ah [Char] / Text stuff |
| 00:17:49 | <EvanR> | monochrom, actually, riddle me that again. If an IO action never completes, should it return Void or some variable |
| 00:18:08 | <geekosaur> | it just never returns |
| 00:18:21 | <EvanR> | I mean, which type is appropriate / inappropriate |
| 00:18:22 | <geekosaur> | the resulting type is forall a. IO a |
| 00:18:36 | <geekosaur> | :t undefined |
| 00:18:37 | <lambdabot> | a |
| 00:18:51 | <jkaye> | :t forever |
| 00:18:52 | <lambdabot> | Applicative f => f a -> f b |
| 00:19:23 | <EvanR> | I guess that's better than Void since it's polymorphic |
| 00:19:43 | <geekosaur> | right |
| 00:22:02 | × | max22- quits (~maxime@2a01cb0883359800c8a77c004bdd2128.ipv6.abo.wanadoo.fr) (Remote host closed the connection) |
| 00:22:40 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:6410:d0a3:c1e2:34d8) |
| 00:24:51 | tremon | is now known as tremon_ |
| 00:26:01 | × | kaph quits (~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Ping timeout: 256 seconds) |
| 00:26:40 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 00:30:10 | → | jkaye_ joins (~qicruser@2605:ef80:c:803f::60:fe3) |
| 00:30:10 | × | jkaye_ quits (~qicruser@2605:ef80:c:803f::60:fe3) (Client Quit) |
| 00:30:14 | → | jkaye__ joins (~qicruser@2605:ef80:c:803f::60:fe3) |
| 00:30:14 | × | jkaye__ quits (~qicruser@2605:ef80:c:803f::60:fe3) (Client Quit) |
| 00:30:25 | → | jkaye_ joins (~qicruser@2605:ef80:c:803f::60:fe3) |
| 00:30:52 | → | ouestbillie joins (~gallup@192-222-138-215.qc.cable.ebox.net) |
| 00:31:18 | × | TonyStone quits (~TonyStone@2603-7080-8607-c36a-9cdb-69bc-753b-1e50.res6.spectrum.com) (Remote host closed the connection) |
| 00:32:07 | <monochrom> | If you have the Void type, then you also have the function "absurd :: Void -> a". Then fmap absurd :: IO Void -> IO a gives you one direction of conversion. |
| 00:32:19 | → | jedb joins (~jedb@89.38.225.36) |
| 00:32:28 | → | kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it) |
| 00:32:35 | <monochrom> | The other direction is even easier, "forall a. IO a" specializes to IO Void. |
| 00:32:42 | × | amk quits (~amk@109.255.169.126) (Ping timeout: 260 seconds) |
| 00:32:52 | ← | jedb parts (~jedb@89.38.225.36) (Leaving) |
| 00:33:03 | <monochrom> | I don't have a preference for either one. |
| 00:33:08 | <EvanR> | to dispatch a Void yell absurd |
| 00:33:18 | × | jkaye_ quits (~qicruser@2605:ef80:c:803f::60:fe3) (Read error: Connection reset by peer) |
| 00:33:35 | × | hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 2.8) |
| 00:33:46 | <monochrom> | But "forall a. IO a" requires less learning for most people. |
| 00:34:56 | <monochrom> | But there are also people who think that IO Void is clearer. |
| 00:35:14 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 00:35:21 | <monochrom> | And finally there are absurd people who opine that forever should be IO () -> IO (). |
| 00:35:40 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 250 seconds) |
| 00:35:44 | → | amk joins (~amk@109.255.169.126) |
| 00:37:57 | × | n3rdy1 quits (~n3rdy1@2600:1700:4570:3480::41) (Ping timeout: 240 seconds) |
| 00:38:15 | → | hughjfchen joins (~hughjfche@vmi556545.contaboserver.net) |
| 00:39:35 | → | fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
| 00:46:03 | <dolio> | Has to be () so that my overzealous warnings about do bindings don't kick in. |
| 00:46:28 | <jackdk> | Wouldn't `IO Void` do that too? |
| 00:47:01 | <dolio> | Maybe. I'm not sure IO a would, though. |
| 00:47:24 | <geekosaur> | should unify, I'd think |
| 00:48:35 | <Raito_Bezarius> | I might be mad but how possible would that be to turn a String into constructors in Haskell? given I have A X_1, B X_2 X_3, C X_4, can I have a way to do eval :: [String] -> A | B | C if args can be coerced to X_1, X_2, X_3, X_4? |
| 00:48:43 | <opticblast> | "to Void or not to void" describes this exact issue: of whether to use "IO Void" or "forall a. IO a" to represent nontermination |
| 00:49:15 | <opticblast> | not sure what you mean there Raito_Bezarius |
| 00:49:25 | → | kaph_ joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it) |
| 00:49:52 | <monochrom> | Use "deriving Read"? |
| 00:49:56 | → | da39a3ee5e6b4b0_ joins (~textual@2403:6200:8876:c04a:81d5:ec6a:a9b3:865a) |
| 00:50:00 | <monochrom> | > read "Maybe 4" |
| 00:50:01 | <lambdabot> | *Exception: Prelude.read: no parse |
| 00:50:09 | <monochrom> | err need type sig |
| 00:50:17 | <monochrom> | > read "Just 4" :: Maybe Integer |
| 00:50:18 | <Raito_Bezarius> | let's assume I have data U = A String | B Int | C, I'd like to have some function such that eval "A" ["X"] == A "X", eval "B" ["3"] == B 3, eval "C" [] |
| 00:50:19 | <lambdabot> | Just 4 |
| 00:50:21 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 00:50:21 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 00:50:21 | → | wroathe joins (~wroathe@user/wroathe) |
| 00:50:22 | <opticblast> | I wish read wouldn't default to @() |
| 00:50:45 | <monochrom> | Then what should it default to? Void? >:) |
| 00:50:51 | <opticblast> | nothing. it should never default |
| 00:50:53 | <geekosaur> | sadly it can't be controlled per fuunction |
| 00:51:04 | <opticblast> | a shortcoming of Haskell imo |
| 00:51:10 | <dolio> | Wrong. |
| 00:51:23 | <dolio> | It doesn't default unless you turn on ExtendedDefaulting. |
| 00:51:27 | <geekosaur> | type inference wants you to reconsider |
| 00:51:37 | × | kaph quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Ping timeout: 240 seconds) |
| 00:51:40 | <geekosaur> | well, it still defaults, just not to () |
| 00:51:41 | <opticblast> | type *inference* is great, type *defaulting* is not |
| 00:52:06 | <monochrom> | OK I am OK with "should be a type error". |
| 00:52:37 | <geekosaur> | you can do `default ()` |
| 00:52:57 | <EvanR> | Raito_Bezarius, by eval do you mean parsing? |
| 00:52:57 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:6410:d0a3:c1e2:34d8) (Ping timeout: 240 seconds) |
| 00:53:30 | <opticblast> | I think you mean ExtendedDefaultRules |
| 00:54:01 | <Raito_Bezarius> | ideally, I'd like to not parse manually EvanR and just have a very simple way to turn constructors strings into U |
| 00:54:25 | <EvanR> | usually that is what deriving the Read class does |
| 00:54:39 | <EvanR> | sometimes it doesn't work though and you have write your own |
| 00:54:50 | <monochrom> | > (read "Just") 4 :: Maybe Integer |
| 00:54:52 | <lambdabot> | error: |
| 00:54:52 | <lambdabot> | • No instance for (Read (Integer -> Maybe Integer)) |
| 00:54:52 | <lambdabot> | arising from a use of ‘read’ |
| 00:55:03 | <EvanR> | > show (Just 4) |
| 00:55:03 | <monochrom> | Oh haha darn. |
| 00:55:04 | <lambdabot> | "Just 4" |
| 00:55:14 | <EvanR> | > read "Just 4" :: Maybe Int |
| 00:55:16 | <lambdabot> | Just 4 |
| 00:55:42 | <Raito_Bezarius> | EvanR: hm, but does not read works with String? |
| 00:55:54 | <Raito_Bezarius> | so I guess I have to use some Read' class which takes [String] rather than String |
| 00:56:12 | <EvanR> | you want to go from [String] to [MyThing] ? |
| 00:56:20 | <opticblast> | oh, so that's why you said you wanted to parse *constructors* |
| 00:56:24 | <Raito_Bezarius> | I want to go from [String] to U |
| 00:56:25 | <geekosaur> | I think we're still unclear on what exactly you want |
| 00:56:35 | <Raito_Bezarius> | alright, let me go into detail |
| 00:56:41 | <Raito_Bezarius> | so I am still using Shakespeare |
| 00:56:53 | <Raito_Bezarius> | Shakespeare uses type constructors for messages |
| 00:57:08 | <Raito_Bezarius> | But, I have some runtime parts where I only have [String] where first argument is message and the rest are parameters |
| 00:57:19 | <opticblast> | "type constructors for messages"? what do you mean by that |
| 00:57:28 | <monochrom> | > read (unword ["Just", "4"]) :: Maybe Integer |
| 00:57:30 | <lambdabot> | error: |
| 00:57:30 | <lambdabot> | • Variable not in scope: unword :: [[Char]] -> String |
| 00:57:30 | <lambdabot> | • Perhaps you meant one of these: |
| 00:57:31 | <Raito_Bezarius> | something like: data AppMessages = Hello | Goodbye |
| 00:57:31 | × | jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Ping timeout: 250 seconds) |
| 00:57:40 | <monochrom> | Oh, unwords? |
| 00:57:42 | <Raito_Bezarius> | with some renderMessage :: AppMessages -> String function |
| 00:57:44 | <monochrom> | > read (unwords ["Just", "4"]) :: Maybe Integer |
| 00:57:45 | <opticblast> | you just mean messages are a data type |
| 00:57:46 | <lambdabot> | Just 4 |
| 00:57:48 | <Raito_Bezarius> | yes, opticblast |
| 00:57:51 | <Raito_Bezarius> | sorry for the wrong vocabulary |
| 00:58:18 | <geekosaur> | those are data constructors, not type constructors |
| 00:58:36 | <opticblast> | each message is its own data constructor, makes sense |
| 00:58:36 | <geekosaur> | big difference, were they type constructors you'd be looking at some pretty heavy lifting |
| 00:58:37 | <Raito_Bezarius> | right |
| 00:59:52 | <opticblast> | oh, I see what monochrom is getting at: concatenate the strings so that you have a string which can be read directly as a message rather than a constructor-with-arguments-remaining |
| 01:00:06 | <Raito_Bezarius> | ah right I see now, thanks monochrom ! |
| 01:00:21 | monochrom | stretches low-tech solutions as much as possible. Never surrender, never give up... |
| 01:00:50 | <opticblast> | ironic that "parse strings into data types as soon as possible" is counterproductive here |
| 01:01:53 | <jackdk> | Does anyone here have a windows machine running haskell that can test something for me? Does `System.Environment.lookupEnv "USERPROFILE"` return something sensible, or does it need to be `System.Environment.lookupEnv "%USERPROFILE%"`? I don't have a windows machine to test on, but I'm trying to fix something in amazonka. |
| 01:02:14 | <Raito_Bezarius> | is there any tip on how to implement Read instance? it seems like Shakespeare do not derive it |
| 01:02:56 | <opticblast> | I can install haskell on my windows |
| 01:03:00 | <monochrom> | Perhaps look for "standalone deriving". |
| 01:03:07 | <Raito_Bezarius> | nice monochrom ! |
| 01:03:30 | <opticblast> | oh, you can derive typeclasses for data types that you don't control? wow |
| 01:03:42 | <Raito_Bezarius> | seems to do the job, monochrom ! |
| 01:04:54 | <monochrom> | The condition is that you can import all of the data constructors, i.e., the author doesn't hide them from you. |
| 01:05:20 | <monochrom> | And then probably transitively for the field types. |
| 01:05:31 | <monochrom> | "Conditions apply." |
| 01:06:26 | × | dhil quits (~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net) (Ping timeout: 250 seconds) |
| 01:06:57 | × | fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 240 seconds) |
| 01:07:51 | <opticblast> | I don't think it's transitive -- you just need the field types to implement the same class (when that class requires it) |
| 01:08:23 | <opticblast> | Show requires all fields to implement Show, while Foldable doesn't, for instance |
| 01:09:07 | <opticblast> | actually, how *does* Foldable work recursively? |
| 01:09:28 | <opticblast> | oh, it's recursive when fields are also parameterized on a |
| 01:09:54 | × | tommd quits (~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 250 seconds) |
| 01:10:34 | <opticblast> | and if a takes any position other than last in those types, you can't derive Foldable |
| 01:11:21 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:11:21 | <dsal> | % :k Foldable |
| 01:11:21 | <yahb> | dsal: (* -> *) -> Constraint |
| 01:12:45 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4) |
| 01:12:56 | × | acidjnk quits (~acidjnk@p200300d0c7271e85bcf2712229551d8e.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 01:14:59 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 01:17:28 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:17:39 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 01:17:59 | → | acidjnk joins (~acidjnk@p200300d0c7271e85bcf2712229551d8e.dip0.t-ipconnect.de) |
| 01:22:01 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:2c90:e64f:dd1e:6519) |
| 01:25:17 | × | da39a3ee5e6b4b0_ quits (~textual@2403:6200:8876:c04a:81d5:ec6a:a9b3:865a) (Ping timeout: 240 seconds) |
| 01:26:12 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 01:30:12 | → | ahammer joins (~ahammer@2409:8954:8cc:52c1:3534:681d:f1d0:740c) |
| 01:31:14 | × | acidjnk quits (~acidjnk@p200300d0c7271e85bcf2712229551d8e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 01:35:01 | × | pgib quits (~textual@173.38.117.86) (Ping timeout: 240 seconds) |
| 01:37:15 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 01:37:52 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:2c90:e64f:dd1e:6519) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 01:38:17 | × | jkaye quits (~jkaye@2601:281:8300:7530:8293:8dc5:8087:f321) (Ping timeout: 240 seconds) |
| 01:38:22 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:2c90:e64f:dd1e:6519) |
| 01:38:23 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:2c90:e64f:dd1e:6519) (Client Quit) |
| 01:38:34 | <Raito_Bezarius> | can I print the standalone derivation or a data type in REPL? |
| 01:39:00 | <Raito_Bezarius> | I have some constructor X :: Int -> Message but read "X 3" :: Message fails the parsing |
| 01:40:46 | <geekosaur> | % set -ddump-deriv |
| 01:40:46 | <yahb> | geekosaur: ; <interactive>:108:6: error: Variable not in scope: ddump :: ASetter s t a b -> b -> s -> t; <interactive>:108:12: error: Variable not in scope: deriv :: ASetter s t a b -> b -> s -> t |
| 01:40:52 | <Raito_Bezarius> | thanks geekosaur |
| 01:40:55 | <geekosaur> | % :set -ddump-deriv |
| 01:40:55 | <yahb> | geekosaur: |
| 01:41:09 | <geekosaur> | % data X = X Int |
| 01:41:09 | <yahb> | geekosaur: |
| 01:41:28 | <geekosaur> | %% deriving instance Read X |
| 01:41:29 | <yahb> | geekosaur: http://qp.mniip.com/y/40 |
| 01:42:01 | <Raito_Bezarius> | got it! |
| 01:42:45 | <geekosaur> | but now you have to understand ReadP and maybe ReadS to figure out what it's doing :) |
| 01:42:54 | <Raito_Bezarius> | figured it out too |
| 01:42:56 | → | acidjnk joins (~acidjnk@p200300d0c7271e85bcf2712229551d8e.dip0.t-ipconnect.de) |
| 01:43:00 | <Raito_Bezarius> | the parser seems quite sane |
| 01:43:10 | <Raito_Bezarius> | I just did not expect some { xxx = yyy } to appear |
| 01:43:57 | × | ahammer quits (~ahammer@2409:8954:8cc:52c1:3534:681d:f1d0:740c) (Ping timeout: 240 seconds) |
| 01:48:02 | <Raito_Bezarius> | thanks a lot geekosaur, opticblast, monochrom ; partial i18n on blog got \o/ |
| 01:48:49 | → | ahammer joins (~ahammer@157.122.68.227) |
| 01:49:23 | <opticblast> | jackdk: you don't need the % |
| 01:49:34 | <opticblast> | in fact adding them makes it breka |
| 01:49:57 | <jackdk> | opticblast: cool thanks! could you also please tell me the value of `System.Info.os`, and whether your machine is 64bit? |
| 01:50:31 | → | IndecisionTree joins (mike@user/IndecisionTree) |
| 01:50:34 | <opticblast> | mingw32, and not sure how to tell that on windows |
| 01:51:26 | <opticblast> | system type x64, so yes it's 64-bit |
| 01:51:54 | × | johnjaye quits (~pi@154.6.152.74) (Quit: WeeChat 3.3) |
| 01:51:58 | <jackdk> | thanks. I was worried that `System.Info.os` might say something else for non-32bit windows, but seems stable. I grepped GHC source for it too |
| 01:53:13 | → | jkaye_ joins (~qicruser@2601:281:8300:7530:ad17:6976:1a41:d704) |
| 01:53:50 | <opticblast> | https://hackage.haskell.org/package/base-4.16.0.0/docs/System-Info.html#v:os suggests it is indeed mingw32 for all windows hosts |
| 01:56:07 | × | ahammer quits (~ahammer@157.122.68.227) (Ping timeout: 256 seconds) |
| 01:57:01 | <EvanR> | monochrom, btw... it seems to me that a dumbpass handcoded scanl that just uses tuples to return a lazy list on one hand and the final state in the other looks basically like the code for break/span xD |
| 01:58:03 | <EvanR> | where in break/span the tail at the break point takes the role of the final state |
| 01:58:32 | <EvanR> | much less code than this crazy Unfolding thing |
| 02:00:25 | → | ubert1 joins (~Thunderbi@p200300ecdf0994cfb11256a527c2b165.dip0.t-ipconnect.de) |
| 02:00:40 | → | n3rdy1 joins (~n3rdy1@2600:1700:4570:3480::41) |
| 02:00:40 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 02:01:39 | × | ubert quits (~Thunderbi@p200300ecdf099487827ed8c05b109aa8.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 02:01:39 | ubert1 | is now known as ubert |
| 02:04:01 | × | aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net) |
| 02:04:23 | → | aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net) |
| 02:05:15 | → | TonyStone joins (~TonyStone@cpe-74-76-51-197.nycap.res.rr.com) |
| 02:06:19 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 256 seconds) |
| 02:08:13 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 02:08:29 | × | IndecisionTree quits (mike@user/IndecisionTree) (Quit: WeeChat 3.3) |
| 02:10:14 | × | jacks- quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC) |
| 02:10:41 | → | califax- joins (~califax@user/califx) |
| 02:13:54 | × | califax quits (~califax@user/califx) (Ping timeout: 276 seconds) |
| 02:13:55 | califax- | is now known as califax |
| 02:14:20 | × | Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: This computer has gone to sleep) |
| 02:17:04 | × | Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 250 seconds) |
| 02:18:13 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds) |
| 02:21:15 | × | burnsidesLlama quits (~burnsides@dhcp168-031.wadham.ox.ac.uk) (Remote host closed the connection) |
| 02:21:25 | → | ahammer joins (~ahammer@157.122.68.227) |
| 02:21:33 | × | jkaye_ quits (~qicruser@2601:281:8300:7530:ad17:6976:1a41:d704) (Read error: Connection reset by peer) |
| 02:21:48 | → | burnsidesLlama joins (~burnsides@client-8-73.eduroam.oxuni.org.uk) |
| 02:22:35 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
| 02:24:51 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 02:25:12 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 02:25:44 | × | ahammer quits (~ahammer@157.122.68.227) (Ping timeout: 250 seconds) |
| 02:25:59 | × | burnsidesLlama quits (~burnsides@client-8-73.eduroam.oxuni.org.uk) (Ping timeout: 256 seconds) |
| 02:26:15 | → | neurocyte091709 joins (~neurocyte@IP-212232084012.dynamic.medianet-world.de) |
| 02:26:15 | × | neurocyte091709 quits (~neurocyte@IP-212232084012.dynamic.medianet-world.de) (Changing host) |
| 02:26:15 | → | neurocyte091709 joins (~neurocyte@user/neurocyte) |
| 02:26:19 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 02:26:58 | × | ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
| 02:27:06 | → | ProfSimm joins (~ProfSimm@87.227.196.109) |
| 02:27:20 | × | xff0x quits (~xff0x@2001:1a81:5213:d00:aaa3:1c56:33b0:7a9e) (Ping timeout: 252 seconds) |
| 02:27:26 | → | ahammer joins (~ahammer@157.122.68.227) |
| 02:27:51 | × | ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
| 02:27:54 | × | neurocyte09170 quits (~neurocyte@user/neurocyte) (Ping timeout: 250 seconds) |
| 02:27:54 | neurocyte091709 | is now known as neurocyte09170 |
| 02:29:12 | → | xff0x joins (~xff0x@2001:1a81:5253:5900:c0c8:bfdc:4cf0:476f) |
| 02:29:30 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Client Quit) |
| 02:30:12 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 02:32:01 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 02:34:15 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 02:36:39 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Client Quit) |
| 02:37:52 | → | pavonia_ joins (~user@user/siracusa) |
| 02:38:37 | × | ahammer quits (~ahammer@157.122.68.227) (Ping timeout: 256 seconds) |
| 02:39:06 | → | johnjaye joins (~pi@154.6.152.74) |
| 02:39:11 | × | pavonia quits (~user@user/siracusa) (Ping timeout: 256 seconds) |
| 02:39:21 | pavonia_ | is now known as pavonia |
| 02:40:43 | → | ahammer joins (~ahammer@157.122.68.227) |
| 02:40:53 | × | xsarnik quits (xsarnik@lounge.fi.muni.cz) (Ping timeout: 256 seconds) |
| 02:41:35 | → | xsarnik joins (xsarnik@lounge.fi.muni.cz) |
| 02:44:20 | → | Hao joins (~Hao@222-154-98-23-fibre.sparkbb.co.nz) |
| 02:46:02 | × | johnjaye quits (~pi@154.6.152.74) (Quit: WeeChat 3.3) |
| 02:49:08 | × | ahammer quits (~ahammer@157.122.68.227) (Ping timeout: 250 seconds) |
| 02:52:07 | × | acidjnk quits (~acidjnk@p200300d0c7271e85bcf2712229551d8e.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
| 03:02:25 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
| 03:04:06 | → | jackson99 joins (~bc8147f2@cerf.good1.com) |
| 03:04:57 | × | n3rdy1 quits (~n3rdy1@2600:1700:4570:3480::41) (Ping timeout: 240 seconds) |
| 03:05:25 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 03:05:30 | <qrpnxz> | are there known problems with C writing to, say, a StorableArray? The foreign function will change the array i give it, but has wrong behaviour. I recreate the example code in C, and it runs as expected. Not sure what to do. |
| 03:06:13 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 03:07:07 | <Axman6> | I think we'd need to see more code to be able to help |
| 03:07:16 | → | Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) |
| 03:07:25 | <Inst> | yo |
| 03:07:44 | <Inst> | I'm wondering, are there feminist groups for Haskell? I've tried to bring up to HF why Haskell should be more aggressively marketed at women |
| 03:09:11 | <qrpnxz> | perhaps i shouldn't be using the passed value from withStorableArray even if I'm gonna touch it later |
| 03:09:41 | <qrpnxz> | that's probably it. It's gonna get ugly, but i'll try an example without doing that |
| 03:10:57 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:10:57 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:10:57 | finn_elija | is now known as FinnElija |
| 03:13:03 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds) |
| 03:14:42 | × | jespada quits (~jespada@87.74.36.188) (Ping timeout: 250 seconds) |
| 03:14:59 | × | shapr quits (~user@2601:7c0:c37c:46d0:e770:81ff:40e0:b008) (Remote host closed the connection) |
| 03:15:12 | → | shapr joins (~user@2601:7c0:c37c:46d0:e770:81ff:40e0:b008) |
| 03:16:10 | <jackson99> | what web scraping library is recommended these days? |
| 03:16:37 | <EvanR> | I heard tagsoup is cool |
| 03:17:17 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) |
| 03:17:48 | → | n3rdy1 joins (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293) |
| 03:17:57 | <dsal> | Inst: that's a strange goal. What are you trying to accomplish there? |
| 03:18:00 | → | jespada joins (~jespada@87.74.36.188) |
| 03:18:14 | <jackson99> | EvanR thanks I'll give it a try |
| 03:18:21 | <Inst> | increasing population of Haskell programmers by targeting underconsidered markets |
| 03:19:03 | <Inst> | Haskellers in the main tend to be experienced programmers who know multiple languages |
| 03:19:27 | <dsal> | Do you assume that women, in general, are not experienced programmers who know multiple languages? |
| 03:20:18 | <Inst> | I assume that men, in general, are not experienced programmers who know multiple languages. |
| 03:20:36 | <Inst> | 11% of devs, according to some surveys, self-identified as women. |
| 03:20:39 | <qrpnxz> | ? |
| 03:21:14 | → | lavaman joins (~lavaman@98.38.249.169) |
| 03:22:44 | <Inst> | there are active initiatives aimed to fix this |
| 03:23:41 | <Inst> | https://reshamas.github.io/why-women-are-flourishing-in-r-community-but-lagging-in-python/ <--- interestingly, r is also a functional language. |
| 03:23:52 | <ephemient> | at this point in time I'm not convinced the Haskell community is large enough to support outreach programs, nevermind who it's targeted towards |
| 03:24:03 | <qrpnxz> | first you have to show it's a problem, no? |
| 03:24:21 | <EvanR> | stop making sense right now |
| 03:24:26 | <qrpnxz> | lol |
| 03:24:47 | <dsal> | I don't think "Haskell: A language for women" is a plausible pivot. |
| 03:25:32 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 250 seconds) |
| 03:27:31 | <Inst> | people are trying, though, I guess it's at the exploratory / experimental stage |
| 03:27:32 | <Inst> | https://joyofhaskell.com |
| 03:27:44 | <Inst> | co-author of Haskell Programming from First Principles (HaskellBook) |
| 03:28:25 | <Inst> | who, mind you, is one of those people for whom Haskell is a first language |
| 03:30:12 | <Inst> | ephemient: I'm told it's more a tooling and ecosystem issue |
| 03:30:13 | <qrpnxz> | huh, wonder what the differences are between this and huh, wonder what the differences are between this and https://haskellbook.com/ |
| 03:30:23 | <Inst> | Haskellbook never shuts up |
| 03:30:33 | → | Guest|45 joins (~Guest|45@172.56.42.40) |
| 03:30:40 | <Inst> | joyofhaskell is a quick overgrown "discover monads by implementing them yourself" book |
| 03:30:45 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 03:31:08 | × | Guest|45 quits (~Guest|45@172.56.42.40) (Client Quit) |
| 03:31:21 | <qrpnxz> | you make both sound bad lol |
| 03:31:57 | <Inst> | iirc hacking around until you invent monads yourself is the least offensive way to learn monads, right? |
| 03:32:20 | <ephemient> | https://discourse.haskell.org/t/proposing-haskell-foundation-community-grants/3049 the biggest community outreach program now seems to be GSOC which is funded by somebody else. Haskell itself doesn't have anything… |
| 03:32:22 | <dsal> | I don't see that as a woman-outreach thing. it's just a good author with probably a good book, though I've not read it. |
| 03:32:26 | <Axman6> | There are quite a lot of prominent frmale and non-binary Haskellers these days, and I haven't seen much in the way of cultural problems which have made it impleasant for people who aren't male to be part of the community. That doens't mean it doesn't exist, but I'm generally impressed with how little of a problem I see |
| 03:32:28 | <qrpnxz> | idk about "least offensive" but doesn't sound very efficient |
| 03:34:29 | <qrpnxz> | joy goes into lenses apparently, that's nice |
| 03:35:00 | <Inst> | it's guided projects |
| 03:35:13 | <Inst> | imo the problem with HPFFP is that, well, I'm blaming Chris Allen |
| 03:35:17 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 03:35:22 | <EvanR> | bandwagons are cool and all but is a beginners book dedicated to monads perpetuating the "you can't haskell without first getting monads" meme |
| 03:35:22 | <EvanR> | monads first |
| 03:35:22 | × | EvanR quits (~EvanR@user/evanr) (Remote host closed the connection) |
| 03:35:26 | <Inst> | but there seemed to have been two impulses there, one was to make a nice newbie tutorial to Haskell |
| 03:35:41 | → | EvanR joins (~EvanR@user/evanr) |
| 03:36:05 | <Inst> | Finding Success (and Failure) in Haskell is more targeted at intermediate beginners, i.e, they know recursion and shit |
| 03:36:20 | <Axman6> | for someone so new to the language and with so little experience, you sure do have a lot of strong opinions on how things should be |
| 03:37:50 | <monochrom> | Dunning-Kruger discusses zero knowledge and infinity opinion. |
| 03:37:52 | <ephemient> | I do wonder if it would be easier to teach starting from Purescript - Haskell-like, but with strict evaluation - before expanding to full Haskell |
| 03:38:00 | <qrpnxz> | i mean, without IO nothing is gonna happen, so you need at least *a* monad to get by lol |
| 03:38:01 | <monochrom> | s/infinity/infinite/ |
| 03:38:24 | <ephemient> | it might help for *some* people, anyway |
| 03:38:34 | <EvanR> | or is IO being a monad a coincidence, and you could technically apply two IO actions with <*> xD |
| 03:39:16 | <ephemient> | but I am definitely on the "just ignore Monads until they use the language enough to see repeated patterns" train |
| 03:39:17 | → | mbuf joins (~Shakthi@122.174.202.253) |
| 03:39:19 | <EvanR> | "since you don't get monads yet, we will do all our work with IO Applicative" |
| 03:39:49 | × | td_ quits (~td@muedsl-82-207-238-204.citykom.de) (Ping timeout: 256 seconds) |
| 03:39:49 | <qrpnxz> | a lot of the good types happen to be monads yeah, but is it that hard? You just gotta look at the type signatures and make stuff match |
| 03:40:38 | <qrpnxz> | if i got a (m a) and a (a -> m b), how do i work with this? well surely (>>=) |
| 03:40:52 | <monochrom> | My IO tutorial certainly motivates >>= and return without motivating full-blown monad. |
| 03:41:12 | <qrpnxz> | is that not full blown monad |
| 03:41:16 | <qrpnxz> | that defines a monad |
| 03:41:23 | <EvanR> | m a as future and (a -> m b) as event handler callback |
| 03:41:32 | <monochrom> | No I don't bring up the monad laws. |
| 03:41:33 | <EvanR> | look, javascript |
| 03:41:40 | → | td_ joins (~td@94.134.91.30) |
| 03:41:54 | <qrpnxz> | the monad laws are basically "acts like you'd expect" |
| 03:42:01 | <qrpnxz> | i could not recite them |
| 03:42:03 | <ephemient> | matching up types is not a problem if you're coming from another language with a HM typesystem, but if that's not their background then even that is unfamiliar |
| 03:42:13 | <dibblego> | I do exactly what monochrom does |
| 03:42:47 | <monochrom> | Instead I explain that (getLine >>=) wants a callback, in "getLine >>= k", k is the callback. |
| 03:43:03 | × | Inst quits (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 256 seconds) |
| 03:43:13 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 03:43:13 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 03:43:13 | → | wroathe joins (~wroathe@user/wroathe) |
| 03:43:21 | <qrpnxz> | i prefer the railway analogy, it's just composition |
| 03:43:29 | <EvanR> | railway? |
| 03:43:45 | <EvanR> | :t (<=<) |
| 03:43:46 | <lambdabot> | Monad m => (b -> m c) -> (a -> m b) -> a -> m c |
| 03:43:53 | <jackdk> | https://www.honeybadger.io/blog/railway-programming-dry-monads/ choo choo |
| 03:43:54 | <monochrom> | For people who are OK with callback-oriented programming (so everybody), taking (getLine >>=) as one single unit is a bit easier than taking getLine alone as one single unit. |
| 03:43:54 | <EvanR> | ah this is composition |
| 03:44:16 | <qrpnxz> | jackdk, yes thanks |
| 03:44:54 | <jackdk> | actually I think https://fsharpforfunandprofit.com/rop/ was the original representation, but then it made its way into ruby because the only monads that `dry-rb` offers are basically `Either e`, `Maybe` and some exception-wrangling stuff |
| 03:45:28 | <qrpnxz> | right, but it gets across what i'm talking about so, good |
| 03:46:36 | × | ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Read error: Connection reset by peer) |
| 03:49:49 | × | EvanR quits (~EvanR@user/evanr) (Quit: Leaving) |
| 03:50:19 | <jackdk> | monochrom: I think that's right, I felt like I understood `(>=>)` first, then `(>>=)`, then `join`. I also hear that analogies to promises seem to go over well when explaining the IO type |
| 03:50:28 | → | Guest83 joins (~Guest83@49.36.127.54) |
| 03:50:30 | <qrpnxz> | I explained Monad to someone a bit ago by first explaining a Functor as a mappable thing, an Applicative Functor as allowing function application in a context (i elaborated), and a Monad as an Applicative Functor you can flatten, and they were rather satisfied with that. That's a sort of container-oriented look at it. |
| 03:50:33 | <Guest83> | hello! |
| 03:50:36 | <qrpnxz> | hi |
| 03:50:37 | <Guest83> | can i ask for help here? |
| 03:50:39 | <jackdk> | hello! |
| 03:50:50 | <qrpnxz> | yes |
| 03:50:56 | <jackdk> | yes, though in general it's best to just ask your question instead of first asking to ask your question. What's up? |
| 03:51:06 | <Guest83> | sorry! |
| 03:51:11 | <Guest83> | okay so i'm trying to setup a simple score system |
| 03:51:11 | → | Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) |
| 03:51:16 | <Inst> | isn't that sort of the point, though, Axman6? |
| 03:51:18 | <Guest83> | my current system |
| 03:51:20 | <Guest83> | else if command =="scoreup" |
| 03:51:20 | <Guest83> | then do |
| 03:51:21 | <Guest83> | increase <- readIORef score_im |
| 03:51:21 | <Guest83> | writeIORef score_im increase + 10 |
| 03:51:22 | <Guest83> | putStrLn "Score increased by 10" |
| 03:51:22 | <Guest83> | else if command == "score" |
| 03:51:23 | <jackdk> | aaa |
| 03:51:23 | <Guest83> | then do |
| 03:51:23 | <Guest83> | score_m <- readIORef score_im |
| 03:51:24 | <Guest83> | print score_m |
| 03:51:26 | <jackdk> | @where paste |
| 03:51:26 | <lambdabot> | Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com |
| 03:51:27 | <qrpnxz> | o oh |
| 03:51:38 | <Guest83> | https://paste.tomsmeding.com/0LJ6RxAb |
| 03:51:39 | <jackdk> | sorry, should've said that sooner |
| 03:51:45 | <Inst> | communities socialize, have dogmas, etc, newbies don't have the dogmas so you get new ideas, most of them are bad, but a small minority might be both original and useful |
| 03:52:44 | <Guest83> | what i'm trying to do is allow the. scoreup command to increase the value of score by 10 |
| 03:52:46 | <Guest83> | what i |
| 03:52:59 | <Guest83> | what i've realised is that variables are immutable |
| 03:53:08 | <Guest83> | BUT, an article i found said that this would work |
| 03:53:26 | <Guest83> | article i'm using : http://www.michaelburge.us/2017/08/15/how-do-i-modify-a-variable-in-haskell.html |
| 03:53:42 | <Guest83> | their idea of this is https://paste.tomsmeding.com/C193lJ4O |
| 03:53:46 | <monochrom> | Yes you can treat score_im as a mutable variable. writeIORef is exactly right. |
| 03:54:02 | <Guest83> | mhm BUT |
| 03:54:08 | <Guest83> | this code when rand |
| 03:54:11 | <Guest83> | this code when ran* |
| 03:54:32 | <Guest83> | doesn't work |
| 03:54:38 | <Guest83> | > score |
| 03:54:38 | <Guest83> | 0 |
| 03:54:39 | <Guest83> | > scoreup |
| 03:54:39 | <lambdabot> | error: Variable not in scope: score |
| 03:54:39 | <Guest83> | Score increased by 10 |
| 03:54:40 | <Guest83> | > score |
| 03:54:40 | <lambdabot> | error: Variable not in scope: scoreup |
| 03:54:40 | <Guest83> | 0 |
| 03:54:41 | <Guest83> | > |
| 03:54:41 | <lambdabot> | error: Variable not in scope: score |
| 03:54:53 | <monochrom> | Then the problem is elsewhere. |
| 03:54:58 | <Guest83> | yeah so my linter |
| 03:55:08 | <jackson99> | there are ways to avoid IORef, though. for example you can implement game loop with recursion, and pass "updated" state on every recursive call |
| 03:55:17 | <Guest83> | i see |
| 03:55:24 | <Guest83> | my linter tells me something else though |
| 03:55:26 | <jackdk> | jackson99: true - but let's seee if we can get Guest83 's approach to work first. |
| 03:55:36 | <Guest83> | https://paste.tomsmeding.com/nVSxcP4k |
| 03:55:58 | <Guest83> | that is what my linter tells me |
| 03:56:03 | <monochrom> | writeIORef score_im (increase + 10) |
| 03:56:06 | <jackdk> | > :t writeIORef |
| 03:56:07 | <lambdabot> | <hint>:1:1: error: parse error on input ‘:’ |
| 03:56:15 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 03:56:15 | <jackdk> | % :t writeIORef |
| 03:56:16 | <yahb> | jackdk: IORef a -> a -> IO () |
| 03:56:39 | <Guest83> | i'm confused lol |
| 03:56:59 | <monochrom> | You need parentheses around (increase + 10) |
| 03:57:06 | <Guest83> | oh lambda bot is a bot that compiled haskell code not an annoying user |
| 03:57:34 | <Guest83> | that fixes the linter error but "scoreup" still prints 0 |
| 03:57:51 | <Guest83> | lemme show you guys the entire way the system works |
| 03:57:52 | <monochrom> | Therefore the problem is elsewhere. |
| 03:57:55 | <dsal> | When you say "linter" do you mean "compiler" ? |
| 03:58:03 | <Guest83> | https://paste.tomsmeding.com/EFHMVbMh here is the entire code |
| 03:58:10 | <Guest83> | no the linter in my IDE |
| 03:58:15 | <Guest83> | no the linter in my code editor* |
| 03:58:53 | <jackdk> | I think dsal's point is that's an error from GHC, which is probably coming through your editor via haskell-language-server or similar |
| 03:58:53 | <monochrom> | You are creating a brand new score_im every iteration, as opposed to reusing the first one. |
| 03:59:29 | <Guest83> | jackdk thats right yeah |
| 03:59:44 | <dsal> | A linter tells you that you might not be doing something the best way. The compiler tells you that you're not doing anything at all that the language will accept. |
| 03:59:45 | <Guest83> | monochrom is that what is resetting the score |
| 03:59:47 | <monochrom> | Perform your newIORef in main. Give it to result or parse. |
| 03:59:51 | <monochrom> | Yes. |
| 03:59:52 | <ephemient> | and the same would happen in any language, not just Haskell |
| 04:00:27 | <Guest83> | lemme try to implement that |
| 04:02:20 | <Guest83> | monochrom i think i did it but it still doesn't work |
| 04:02:33 | <Guest83> | https://paste.tomsmeding.com/Way1L6iv |
| 04:02:47 | <monochrom> | Same difference. |
| 04:02:55 | <Guest83> | hm? |
| 04:03:02 | <jackdk> | you're halfway there - it recreates the IORef each time result calls itself |
| 04:03:07 | <Guest83> | oh!!! |
| 04:03:13 | <Guest83> | so i need to put it in main instead |
| 04:03:20 | <Guest83> | or...? |
| 04:03:27 | <dsal> | "monochrom> Perform your newIORef in main. Give it to result or parse." |
| 04:03:32 | <jackdk> | that's right, and this would be true for pretty much any language |
| 04:03:52 | <monochrom> | "int x = 0; for (;;) { ... }" vs "for (;;) { int x = 0; ... }" |
| 04:04:00 | × | Hao quits (~Hao@222-154-98-23-fibre.sparkbb.co.nz) (Quit: Client closed) |
| 04:04:06 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
| 04:04:13 | <Guest83> | i see |
| 04:04:15 | <Guest83> | one second |
| 04:05:04 | <Guest83> | result score_ii = |
| 04:05:05 | <Guest83> | do |
| 04:05:05 | <Guest83> | putStr "> " |
| 04:05:06 | <Guest83> | input <- getLine |
| 04:05:06 | <Guest83> | parse input score_ii |
| 04:05:07 | <Guest83> | result |
| 04:05:07 | <Guest83> | main = |
| 04:05:08 | <Guest83> | do |
| 04:05:08 | <Guest83> | score_im <- newIORef 0 |
| 04:05:09 | <Guest83> | result score_im |
| 04:05:10 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3) |
| 04:05:15 | <Guest83> | https://paste.tomsmeding.com/4IvHdfjQ |
| 04:05:17 | <monochrom> | Yeah like that. |
| 04:05:19 | <jackson99> | as a sidenote, even if you want to use IORef, there's zero reason for parse to accept one. just return the result |
| 04:05:25 | <Guest83> | this gives me an error though |
| 04:05:37 | <jackson99> | s/result/score |
| 04:05:58 | <Guest83> | https://paste.tomsmeding.com/nz9KhRuW <- error |
| 04:06:15 | <dsal> | It's helpful to paste your code and the error at the same time. |
| 04:06:28 | <monochrom> | Have you modified parse to expect the extra parameter? |
| 04:06:51 | × | rekahsoft quits (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 256 seconds) |
| 04:06:57 | <Guest83> | i think so |
| 04:07:06 | <Guest83> | yeeup |
| 04:07:19 | <jackdk> | when you recursively call `result`, you need to pass it the ref again |
| 04:07:27 | <Guest83> | https://paste.tomsmeding.com/VduVbmjY <- code |
| 04:07:27 | <Guest83> | https://paste.tomsmeding.com/nz9KhRuW <- error |
| 04:07:35 | <Guest83> | jackdk i don't udnerstand |
| 04:07:35 | <monochrom> | Oh, that. |
| 04:07:59 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 04:07:59 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 04:07:59 | → | wroathe joins (~wroathe@user/wroathe) |
| 04:07:59 | <jackdk> | L35 in the paste calls `result` with no arguments, but you've changed it to require one |
| 04:08:12 | <jackdk> | so it should now be `result score_ii` |
| 04:08:18 | → | lavaman joins (~lavaman@98.38.249.169) |
| 04:08:18 | <Guest83> | oh!!!! |
| 04:08:25 | <jackson99> | there's no reason to give score different names. they are all different variables in their own scope |
| 04:08:27 | <Guest83> | i forgot to change the recursive call haha |
| 04:08:43 | <Guest83> | makes sense jackson99 but its for readbility issues haha |
| 04:08:54 | <jackson99> | I'm not sure it helps readability :) |
| 04:08:58 | <jackdk> | (If you want an infinite loop, once you get this working you can think about using `Control.Monad.forever`) |
| 04:09:02 | <Guest83> | omg amazing! it works!!!! |
| 04:09:06 | <jackdk> | \o/ |
| 04:09:11 | <Guest83> | thanks a bunch guys |
| 04:09:24 | <Guest83> | i'm sorry for the guest name haha, y'all can call me snowneo |
| 04:09:27 | <dsal> | The next trick is to get rid of the ioref |
| 04:09:32 | <Guest83> | i'm going to start hanging out here more often |
| 04:09:42 | × | Guest83 quits (~Guest83@49.36.127.54) (Quit: Client closed) |
| 04:09:53 | → | SnowNeo joins (~SnowNeo@49.36.127.54) |
| 04:10:01 | <SnowNeo> | i'm back! |
| 04:10:07 | <SnowNeo> | with an actual name this time |
| 04:10:21 | × | waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 250 seconds) |
| 04:10:42 | <jackdk> | so I think jackson99 and dsal are right - a good next exercise might be to pass the current score around as a parameter instead of using the IORef |
| 04:10:44 | <dsal> | Oh, I thought I'd never used an IORef in a program, but I found one where I did. |
| 04:11:02 | <SnowNeo> | i see |
| 04:11:19 | <SnowNeo> | i'm going to have to look into that |
| 04:11:28 | <SnowNeo> | my class starts in 4 minutes haha |
| 04:11:43 | <dsal> | Definitely wouldn't use an IORef for this. |
| 04:12:04 | <SnowNeo> | my first idea was to do it the python way (i'm really active in their discord community) |
| 04:12:21 | <SnowNeo> | but then a friend let me know vcariables a immutable |
| 04:12:47 | <SnowNeo> | http://www.michaelburge.us/2017/08/15/how-do-i-modify-a-variable-in-haskell.html <- place where i got to see iORef |
| 04:13:31 | <jackdk> | It's a natural question to ask if you're used to solving problems with mutable variables, but it's also often not the right question to ask here |
| 04:13:46 | <SnowNeo> | haha |
| 04:13:54 | <SnowNeo> | i'm used to solving problems with mutable ones yes |
| 04:14:00 | <jackdk> | (and you get a lot more than you give up, once you start doing everything functionally) |
| 04:14:01 | <SnowNeo> | haskell is my first functional language |
| 04:14:31 | <dsal> | It's a good habit to break. It's completely unnecessary for this, but it's one of a few problems. |
| 04:14:38 | <dsal> | What would you say `parse` is meant to do? |
| 04:14:45 | <SnowNeo> | i don't want to give up since i mainly work in languages such as java and python but i'm learning haskell since i'm intrguied by the idea of everything being a function |
| 04:15:07 | <SnowNeo> | well parse actually parses the command |
| 04:15:08 | <Axman6> | I would very, very strongly recommend you don't even attempt to use IORefs and instead pass around the value you want to change |
| 04:15:22 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
| 04:15:24 | <SnowNeo> | how would i do that, could you give me anexample |
| 04:15:26 | <dsal> | By the name, I'd expect it to take some kind of input and return `Maybe SomeCommand` |
| 04:15:49 | <SnowNeo> | `parse` also contains the logic for taking out well what the command says for example the exit and about command |
| 04:16:15 | <dsal> | Yeah. So it both parses input and interacts with the process state. |
| 04:16:16 | <jackson99> | SnowNeo, return new score value from parse, call result recursively with the returned and updated score |
| 04:16:23 | <SnowNeo> | if you guys are familiar with python,`while True:` is what i tried to recreate with the result function |
| 04:16:36 | <Inst> | what kind of problem are you trying to solve? |
| 04:16:39 | <dsal> | :t forever |
| 04:16:39 | <lambdabot> | Applicative f => f a -> f b |
| 04:16:43 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 04:16:43 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 04:16:43 | → | wroathe joins (~wroathe@user/wroathe) |
| 04:16:59 | <SnowNeo> | jackson99 i'll try to tackle that when my class ends forsho |
| 04:17:22 | <SnowNeo> | Inst i'm trying to make a simple text based rpg |
| 04:17:25 | <Inst> | oh guest83 ioref |
| 04:17:39 | <SnowNeo> | yes! i just changed my name to an actuall name |
| 04:17:43 | <Inst> | if you must have mutability, just store everything in a temp file and handle it that way |
| 04:17:54 | <Axman6> | ... no |
| 04:18:04 | <dsal> | SnowNeo: It's really helpful to think of your types. Even by name. `parse` doesn't sound like it should have any side effects. |
| 04:18:11 | <SnowNeo> | i don't think i need file thing for this |
| 04:18:24 | <Axman6> | you don't, Inst is giving you poor advice |
| 04:18:37 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 04:18:39 | <SnowNeo> | makes sense dsal i'll make note of that when i reopen my project after class |
| 04:18:48 | <SnowNeo> | i'm sure they're just trying to help |
| 04:19:10 | <SnowNeo> | i think a file storage system for a realtime game where i don't really store scores |
| 04:19:21 | <SnowNeo> | would be slow and suffering for noreason |
| 04:20:04 | <Axman6> | if you want to save state when you exit, a file is fine, but it's not what you want to use for storing state in your program while it's running |
| 04:20:32 | <SnowNeo> | yeeup |
| 04:20:39 | <SnowNeo> | i don't want this to be a saved state game |
| 04:20:50 | <arahael> | I've used temp files myself again and again. Strongly recommended avoiding that shit. :( |
| 04:20:58 | <SnowNeo> | just a simpple game someone can run in like 5 seconds to have a short 5 minute game |
| 04:21:10 | <SnowNeo> | are temp files more difficult to handle than normal ones? |
| 04:21:13 | <arahael> | You're basically implementing a crappy, half-assed database. Just use a pre-existing database, they're common, and solve this exacct issue. |
| 04:21:27 | <arahael> | And sqlite is amazing. |
| 04:21:45 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 04:22:52 | <Axman6> | it sounds like files and saving state aren't necessary at all, so we should probably move off the topic |
| 04:22:57 | <jackdk> | Axman6: +1 |
| 04:23:51 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
| 04:26:42 | <qrpnxz> | ah what the hell, suddenly it's working. Is this UB?! I have no idea what changed. |
| 04:26:43 | <glguy> | I just learned something about ViewPatterns; you can chain them |
| 04:26:46 | <glguy> | wakeNetwork :: (IntMap Effect -> ([Packet], IntMap Effect)) -> System -> [Event] |
| 04:26:49 | <glguy> | wakeNetwork f (networkF f -> (ps, enq ps -> idle -> events)) = events |
| 04:27:25 | <glguy> | ``enq ps -> idle -> events`` |
| 04:28:25 | <glguy> | I'm not advocating it; I just hadn't thought to try before |
| 04:28:46 | × | SnowNeo quits (~SnowNeo@49.36.127.54) (Quit: Client closed) |
| 04:28:52 | <dsal> | Oh neat. I've seen people do nested chains. I often use view patterns and end up finding I've just made things worse. heh |
| 04:29:31 | × | vglfr quits (~vglfr@46.96.161.71) (Ping timeout: 256 seconds) |
| 04:29:43 | <Axman6> | SnowNeo: if it were me, I would start by thinking about the what commands I wanted to execute and define a data type: data Command = Exit | About | ScoreUp | Score; then I would have a function parseCommand :: String -> Maybe Command. Then you can have a function with type executeCommand :: Int -> Command -> IO Int (IO so you can print things) |
| 04:30:02 | <Axman6> | glguy: looks weirdly like C struct pointer field syntax |
| 04:30:58 | <dsal> | % let f (take 2 -> [read -> a, read -> b] ) = a + b in f ["2", "3", "4"] |
| 04:30:58 | <yahb> | dsal: 5 |
| 04:31:23 | × | geranim0 quits (~geranim0@modemcable242.171-178-173.mc.videotron.ca) (Ping timeout: 256 seconds) |
| 04:34:56 | <glguy> | I was going back and playing with one of my favorite old AoC problems, the 2019 intcode 50-machine network sim ; had an idea for making the code nicer https://adventofcode.com/2019/day/23 |
| 04:43:59 | <glguy> | probably a couple years late for anyone to care, but in case anyone remembers doing that one https://glguy.net/advent/sln_2019_23/Main.html |
| 04:44:18 | <qrpnxz> | oh man, i think my problem was just a build system issue! I can't believe it. |
| 04:44:19 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 04:45:07 | → | vysn joins (~vysn@user/vysn) |
| 04:47:00 | <Axman6> | welcome to the world of C programming? |
| 04:47:47 | <Axman6> | I've been fighting C for the last few days. I seem to have run into a problem where GHC's implementation of memcpy randomly decides it's just not going to stop copying and fills up all my ram |
| 04:48:35 | <glguy> | have you tried adding more ram? |
| 04:48:54 | <Axman6> | well, since it is only supposed to be copying 28 bytes, it is problematic |
| 04:50:10 | <int-e> | glguy: oh I vaguely remember... I ended up with a [Reply] -> [Request] style of interaction that year |
| 04:50:13 | <qrpnxz> | it's my own fault, i was building the project myself cause i don't want to mess with Cabal et al., but since i'm little experienced with that in GHC, i didn't have the dependencies right, and work didn't happen |
| 04:50:32 | <jackdk> | messing with cabal is likely to be much less frustrating |
| 04:50:47 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 04:51:22 | <qrpnxz> | doubt it, now that i got it right it's great. |
| 04:51:39 | <glguy> | int-e: my interpreter produced https://hackage.haskell.org/package/intcode-0.3.0.0/docs/Intcode.html#t:Effect , but I had a shortcut function for using it as a: [Int] -> [Int] |
| 04:52:30 | <qrpnxz> | speaking of effects, why is the prototypical state function (s -> (a, s)) rather than (s -> (s, a)) ? |
| 04:52:59 | <qrpnxz> | well, i suppose if you have to pass the state in, you'll want to get the state out in the usual case |
| 04:55:07 | → | img joins (~img@user/img) |
| 04:55:12 | <Axman6> | or (s -> (a -> s -> r) -> r) |
| 04:55:23 | <jackdk> | I would like to know this also, as I always get a little sad that its functor instance isn't just the composition of ((->) s) and (s,) |
| 04:56:32 | × | euandreh quits (~euandreh@2804:14c:33:9fe5:b997:c1f9:27c:1247) (Ping timeout: 250 seconds) |
| 04:57:43 | <int-e> | I suppose we care more about the value than the successor state, so we put the value first? |
| 04:58:13 | <int-e> | It is an arbitrary choice. |
| 05:02:33 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 05:03:42 | <Axman6> | I agree that composing the two functions from state's... adjunction? would be nice |
| 05:04:31 | <dolio> | It is, though. You just can't use it as a type class instance in Haskell. |
| 05:05:45 | <Axman6> | functors* |
| 05:06:03 | × | swistak quits (~swistak@185.21.216.141) (Ping timeout: 250 seconds) |
| 05:06:12 | <dolio> | In category theory it's not uncommon to put the S on the right in the adjunction, because then it stays in the right order, in a way. |
| 05:06:41 | <dolio> | curry instead of curry+flip. |
| 05:06:48 | × | wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds) |
| 05:07:36 | <dolio> | Sometimes reordering is a big deal. |
| 05:08:03 | → | wyrd joins (~wyrd@gateway/tor-sasl/wyrd) |
| 05:09:04 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) |
| 05:12:03 | <int-e> | :t unfoldr |
| 05:12:04 | <lambdabot> | (b -> Maybe (a, b)) -> b -> [a] |
| 05:13:57 | × | little_mac quits (~little_ma@2601:410:4300:3ce0:a09c:720a:f4a0:1ac1) (Ping timeout: 240 seconds) |
| 05:13:58 | <int-e> | (b is a state, so there's another precedent for that argument order) |
| 05:18:17 | <energizer> | Is there a haskell implementation of python/rust/swift iterators? where the iteration is managed externally by the caller rather than internally by a HOF |
| 05:19:39 | <monochrom> | My http://www.vex.net/~trebla/haskell/cont.xhtml#yield comes close. But I wouldn't go any closer. |
| 05:21:52 | <jackdk> | it would also be the `next` of any streaming type, right? like `streaming`'s `Streaming.Prelude.next :: Monad m => Stream (Of a) m r -> m (Either r (a, Stream (Of a) m r))` |
| 05:22:59 | <int-e> | yeah also the foundation of various stream fusions implementations (an old one for lists is https://hackage.haskell.org/package/stream-fusion-0.1.2.5/docs/Data-Stream.html ...actual uses occur in bytestring and vector, I believe) |
| 05:23:24 | <energizer> | where does the iteration state live in a stream?: in the caller or the stream object? |
| 05:23:58 | <monochrom> | Both? |
| 05:24:09 | <monochrom> | In the stream object, but the caller owns the stream object. |
| 05:25:04 | → | domini_ joins (~domini@22.112.235.77.dyn.idknet.com) |
| 05:25:11 | <int-e> | (but the caller can't use the state except through the stream's step function) |
| 05:25:19 | × | domini_ quits (~domini@22.112.235.77.dyn.idknet.com) (Remote host closed the connection) |
| 05:26:32 | <energizer> | ok so that's like python |
| 05:27:21 | <energizer> | the alternative being an indexable list where the caller just indexes 0 and then 1 and then 2 ... |
| 05:28:37 | <energizer> | python style has basically hidden mutable state; otoh the indexable style is stateless but means the stream accumulates in memory as you read through it |
| 05:28:49 | <jackdk> | remember that list index `(!!)` is O(n) in Haskell, but if you want an indexed walk through the list you can zip it with `[0..]` |
| 05:29:03 | <energizer> | yeah so s/list/vector or whatever |
| 05:29:07 | <jackdk> | > zip [0..] ['a', 'b', 'c'] |
| 05:29:08 | <lambdabot> | [(0,'a'),(1,'b'),(2,'c')] |
| 05:30:31 | <int-e> | operationally, a lazy list is pretty much the same as an iterator anyway; there's a "next" operation (force the outermost constructor, (:) if there's another element; [] if everything is consumed), and thunks capture the hidden state. |
| 05:30:47 | <int-e> | at least as long as you consume the list once |
| 05:31:04 | → | swistak joins (~swistak@185.21.216.141) |
| 05:31:40 | <int-e> | s/iterator/generator/ is a bit more accurate |
| 05:36:33 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 05:38:22 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 05:43:11 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 05:46:32 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 05:52:55 | → | [_] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 05:55:49 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 256 seconds) |
| 05:57:50 | × | zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection) |
| 05:59:05 | → | zaquest joins (~notzaques@5.130.79.72) |
| 05:59:46 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:00:23 | → | Jing joins (~hedgehog@240e:390:7c53:a7e1:87f:3f13:7a62:d6c7) |
| 06:05:43 | → | little_mac joins (~little_ma@2601:410:4300:3ce0:a09c:720a:f4a0:1ac1) |
| 06:05:57 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds) |
| 06:09:07 | → | chomwitt joins (~chomwitt@ppp-94-67-201-202.home.otenet.gr) |
| 06:10:06 | × | chomwitt quits (~chomwitt@ppp-94-67-201-202.home.otenet.gr) (Remote host closed the connection) |
| 06:12:05 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 06:12:57 | × | wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Remote host closed the connection) |
| 06:13:10 | → | wyrd joins (~wyrd@gateway/tor-sasl/wyrd) |
| 06:14:58 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 250 seconds) |
| 06:15:26 | → | chomwitt joins (~chomwitt@2a02:587:dc11:fb00:12c3:7bff:fe6d:d374) |
| 06:16:18 | → | fef joins (~thedawn@user/thedawn) |
| 06:18:13 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 06:18:23 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 06:18:37 | × | mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Ping timeout: 240 seconds) |
| 06:20:57 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 06:22:37 | × | mvk quits (~mvk@2607:fea8:5cdd:f000::55f8) (Ping timeout: 240 seconds) |
| 06:24:04 | → | whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com) |
| 06:25:29 | × | CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 06:28:15 | → | mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) |
| 06:29:53 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 06:29:53 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 06:29:53 | → | wroathe joins (~wroathe@user/wroathe) |
| 06:33:06 | → | razetime joins (~quassel@49.207.203.87) |
| 06:33:06 | × | razetime quits (~quassel@49.207.203.87) (Client Quit) |
| 06:33:11 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 06:34:05 | × | nunggu quits (~q@gateway/tor-sasl/nunggu) (Remote host closed the connection) |
| 06:34:28 | → | nunggu joins (~q@gateway/tor-sasl/nunggu) |
| 06:34:45 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 06:35:12 | × | LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 276 seconds) |
| 06:38:10 | → | LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao) |
| 06:40:45 | × | yauhsien_ quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 06:41:38 | → | yauhsien joins (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) |
| 06:42:35 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 06:42:36 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 06:42:59 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 06:43:24 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 06:45:08 | → | indiana-bones joins (~indignant@94.140.8.115) |
| 06:46:53 | → | SnowNeo joins (~SnowNeo@49.36.127.54) |
| 06:46:56 | <SnowNeo> | hello! |
| 06:47:03 | <SnowNeo> | i'm back |
| 06:47:10 | <SnowNeo> | anyone here? |
| 06:50:26 | <jackdk> | shhhh... nobody say anything |
| 06:50:29 | <jackdk> | I mean hi SnowNeo |
| 06:51:45 | × | SnowNeo quits (~SnowNeo@49.36.127.54) (Client Quit) |
| 06:52:17 | <Axman6> | oof |
| 06:53:10 | <jackdk> | yeah oof =| |
| 06:54:46 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 06:56:37 | × | n3rdy1 quits (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293) (Ping timeout: 240 seconds) |
| 06:59:07 | → | ksqsf joins (~user@2001:da8:d800:611:dceb:3079:7447:6f34) |
| 07:00:02 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 250 seconds) |
| 07:00:41 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 07:00:41 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 07:00:41 | → | wroathe joins (~wroathe@user/wroathe) |
| 07:00:53 | × | little_mac quits (~little_ma@2601:410:4300:3ce0:a09c:720a:f4a0:1ac1) (Remote host closed the connection) |
| 07:02:11 | → | SnowNeo joins (~SnowNeo@49.36.127.54) |
| 07:02:14 | <SnowNeo> | hi |
| 07:02:16 | <SnowNeo> | anyone here? |
| 07:02:33 | <jackdk> | SnowNeo: there's a few of us yea |
| 07:02:40 | <jackdk> | I was worried I'd scared you off |
| 07:02:41 | <SnowNeo> | ayee i'm back |
| 07:02:51 | <SnowNeo> | no no ahha, i had to screenshare and doc and assignment for class |
| 07:02:54 | <SnowNeo> | do* |
| 07:02:58 | <SnowNeo> | an* |
| 07:03:07 | <SnowNeo> | but i'm free now so back to haskell |
| 07:03:30 | <SnowNeo> | oki so what i'm trying to do now is make some of my favorite math concepts in haskell |
| 07:03:46 | <SnowNeo> | right now i'm making one of my favorite ones |
| 07:04:01 | <SnowNeo> | it says, "the sum of the first n number of odd numbers is equal to n square" |
| 07:04:12 | <SnowNeo> | so i made something and loaded up ghci |
| 07:04:18 | <SnowNeo> | upong running this :t take n[1,3..n*1000] |
| 07:04:33 | <SnowNeo> | i get to know that this is a tuple of (Num a, Enum a) |
| 07:04:52 | <SnowNeo> | what i want to do is get the sum of this tuple |
| 07:05:31 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 07:05:51 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 07:06:34 | × | [_] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
| 07:07:07 | <SnowNeo> | any help? |
| 07:07:11 | <SnowNeo> | i tried to dothis |
| 07:07:27 | <SnowNeo> | sum take n[1,3..n*1000] |
| 07:07:46 | <SnowNeo> | but it errored out with https://paste.tomsmeding.com/tYn0zBC2 |
| 07:08:07 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 07:08:39 | × | xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer) |
| 07:08:49 | → | _ht joins (~quassel@2a02:a468:b619:1:b63a:bf2b:8ee:fbf2) |
| 07:09:18 | <SnowNeo> | nvm i got it |
| 07:09:44 | × | SnowNeo quits (~SnowNeo@49.36.127.54) (Quit: Client closed) |
| 07:10:29 | × | arahael quits (~arahael@118.208.232.68) (Quit: WeeChat 3.0) |
| 07:10:37 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 256 seconds) |
| 07:11:12 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 07:11:47 | <Axman6> | Glad we could help! |
| 07:14:01 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 07:14:57 | × | mikoto-chan quits (~mikoto-ch@194.157.16.89) (Ping timeout: 240 seconds) |
| 07:15:43 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 256 seconds) |
| 07:21:03 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 07:24:04 | → | schweers joins (~user@i59F6300A.versanet.de) |
| 07:25:12 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 07:29:19 | <Inst> | it's funnier because he exited before you gave a sardonic response |
| 07:29:39 | <Inst> | anyways, is there a way to get the console to detect a keypress without using Haskeline? |
| 07:30:25 | <Inst> | also, my program will throw an exception if openFile fails |
| 07:30:37 | × | shapr quits (~user@2601:7c0:c37c:46d0:e770:81ff:40e0:b008) (Ping timeout: 240 seconds) |
| 07:30:41 | <Inst> | i can get around it by using a Maybe type to check and not divert to openFile, but this feels ugly |
| 07:31:14 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:58ed:c475:7de8:f0f9) |
| 07:32:09 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 256 seconds) |
| 07:33:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 07:33:37 | → | razetime joins (~quassel@49.207.203.87) |
| 07:34:22 | <dibblego> | have you tried it yet? |
| 07:41:30 | × | wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds) |
| 07:45:05 | × | emf quits (~emf@2620:10d:c090:400::5:3f1) (Ping timeout: 250 seconds) |
| 07:45:48 | <ksqsf> | Inst: I believe you'll need to set terminal attributes using smth like tcsetattr() |
| 07:46:09 | <Inst> | I can't figure out how to get Haskeline to work |
| 07:46:59 | → | emf joins (~emf@2620:10d:c090:400::5:2d26) |
| 07:47:20 | <ksqsf> | I never used haskeline, but I think it's the best option if you have nothing against it |
| 07:47:57 | → | wyrd joins (~wyrd@gateway/tor-sasl/wyrd) |
| 07:48:08 | <ksqsf> | I once used terminfo for a similar purpose; in case it's helpful: https://paste.tomsmeding.com/7KSLBIU7 |
| 07:50:33 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 07:50:48 | <ephemient> | https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/faom67y/ I have some code that uses termios directly to read terminal input immediately |
| 07:51:11 | → | a6a45081-2b83 joins (~aditya@2601:249:4300:1296:88ec:cc73:84d4:1507) |
| 07:51:59 | → | max22- joins (~maxime@2a01cb08833598000a8db68817efc706.ipv6.abo.wanadoo.fr) |
| 07:54:30 | × | nunggu quits (~q@gateway/tor-sasl/nunggu) (Ping timeout: 276 seconds) |
| 07:56:55 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 256 seconds) |
| 07:58:49 | ← | ksqsf parts (~user@2001:da8:d800:611:dceb:3079:7447:6f34) (ERC 5.4.1 (IRC client for GNU Emacs 29.0.50)) |
| 07:59:15 | → | ksqsf joins (~user@2001:da8:d800:611:dceb:3079:7447:6f34) |
| 08:03:08 | → | dwt__ joins (~dwt_@c-98-198-103-176.hsd1.tx.comcast.net) |
| 08:03:23 | × | dwt_ quits (~dwt_@c-98-198-103-176.hsd1.tx.comcast.net) (Ping timeout: 252 seconds) |
| 08:07:17 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 08:07:30 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 08:11:15 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
| 08:11:28 | → | Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) |
| 08:11:41 | → | nunggu joins (~q@gateway/tor-sasl/nunggu) |
| 08:12:41 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 08:15:37 | × | razetime quits (~quassel@49.207.203.87) (Ping timeout: 256 seconds) |
| 08:16:02 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 08:17:00 | → | mmhat joins (~mmh@55d4708c.access.ecotel.net) |
| 08:18:02 | × | cheater quits (~Username@user/cheater) (Ping timeout: 250 seconds) |
| 08:19:58 | <polux> | Hello! I am trying to map over the type of error in MonadError. Is it possible to write a function of type (MonadError t m, MonadError t' m') => (t -> t') -> m a -> m' a or something like that? Does it even make sense? I have a hunch it doesn't because it assumes MonadError somehow commutes enough with the other effects in m to lift mapErrorT, but |
| 08:19:58 | <polux> | nothing guarantees this is always the case. |
| 08:20:38 | × | ksqsf quits (~user@2001:da8:d800:611:dceb:3079:7447:6f34) (Ping timeout: 250 seconds) |
| 08:20:48 | → | dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be) |
| 08:22:17 | × | a6a45081-2b83 quits (~aditya@2601:249:4300:1296:88ec:cc73:84d4:1507) (Ping timeout: 240 seconds) |
| 08:26:07 | → | chele joins (~chele@user/chele) |
| 08:27:52 | → | cheater joins (~Username@user/cheater) |
| 08:29:48 | <ephemient> | \f m -> (pure <$> m) `catchError` (pure . throwError . f) :: (MonadError t m, MonadError t' m') => (t -> t') -> m a -> m (m' a) |
| 08:30:09 | <ephemient> | is probably about as close as you can get in general, since there's no reason you should be able to join m and m' |
| 08:30:42 | <polux> | good point yes, thanks a lot! |
| 08:31:37 | × | dextaa quits (~DV@user/dextaa) (Ping timeout: 240 seconds) |
| 08:34:09 | → | dextaa joins (~DV@user/dextaa) |
| 08:34:55 | × | Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 08:34:57 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 240 seconds) |
| 08:36:01 | → | mastarija joins (~mastarija@2a05:4f46:e0e:5000:81fe:1ebc:de4c:76ed) |
| 08:36:26 | <mastarija> | Is there a paper on Haskell lenses I could read? |
| 08:36:59 | <c_wraith> | there are a number of papers on related theoretical concepts, but none will help you use any of the existing libraries. |
| 08:37:08 | <c_wraith> | So.. what's your goal? |
| 08:37:22 | <mastarija> | To get a theoretical background |
| 08:37:35 | <mastarija> | Hopefully in terms of category theory |
| 08:38:06 | <c_wraith> | ok, there's a really good paper for that - which I can't remember the name of. I know how I can find it, but it'll take me a few minutes :) |
| 08:38:10 | → | `2jt joins (~jtomas@10.red-83-58-228.dynamicip.rima-tde.net) |
| 08:38:31 | → | jgeerds joins (~jgeerds@55d4bbed.access.ecotel.net) |
| 08:39:07 | → | gustik joins (~gustik@2a01:c844:2436:6920:9e9:f97c:41d1:634c) |
| 08:39:56 | <mastarija> | c_wraith, cool thanks! |
| 08:40:44 | <c_wraith> | ok, it's a blog post rather than a paper, but it has a *lot* of links to papers. https://julesh.com/2018/08/16/lenses-for-philosophers/ |
| 08:42:04 | <mastarija> | Ah... I've just skimmed through that this morning. |
| 08:42:10 | <c_wraith> | hah. sorry then :) |
| 08:42:14 | <mastarija> | haha, np. |
| 08:42:36 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds) |
| 08:42:37 | <c_wraith> | Have you checked Bartoz's blog? |
| 08:42:49 | <c_wraith> | I think he made several posts about category theory and lenses |
| 08:43:16 | <c_wraith> | Yes, he has: https://bartoszmilewski.com/ |
| 08:47:06 | → | ksqsf joins (~user@2001:da8:d800:611:dceb:3079:7447:6f34) |
| 08:47:29 | × | schweers quits (~user@i59F6300A.versanet.de) (Remote host closed the connection) |
| 08:48:22 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 250 seconds) |
| 08:48:39 | → | michalz joins (~michalz@185.246.204.104) |
| 08:48:59 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 08:51:25 | × | ksqsf quits (~user@2001:da8:d800:611:dceb:3079:7447:6f34) (Ping timeout: 240 seconds) |
| 08:51:28 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 08:53:23 | <mastarija> | c_wraith, I've actually found something right now on ncatlab |
| 08:53:39 | <mastarija> | http://nlab-pages.s3.us-east-2.amazonaws.com/nlab/show/lens+(in+computer+science) |
| 08:53:58 | <mastarija> | I somehow always forget that this great resource exists |
| 08:57:16 | → | Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) |
| 09:00:08 | × | boxscape quits (~boxscape@user/boxscape) (Quit: You have been kicked for being idle) |
| 09:00:16 | × | zwro[m] quits (~zwromatri@2001:470:69fc:105::1d4) (Quit: You have been kicked for being idle) |
| 09:00:52 | × | Codaraxis_ quits (~Codaraxis@user/codaraxis) (Remote host closed the connection) |
| 09:00:57 | × | mastarija quits (~mastarija@2a05:4f46:e0e:5000:81fe:1ebc:de4c:76ed) (Quit: Leaving) |
| 09:01:12 | → | Codaraxis_ joins (~Codaraxis@user/codaraxis) |
| 09:02:12 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 09:03:41 | → | ksqsf joins (~user@2001:da8:d800:611:1c16:6357:9dab:49e9) |
| 09:08:18 | × | ksqsf quits (~user@2001:da8:d800:611:1c16:6357:9dab:49e9) (Ping timeout: 250 seconds) |
| 09:09:22 | <tomsmeding> | some domain misconfiguration there |
| 09:11:51 | × | alMalsamo quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 276 seconds) |
| 09:13:58 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 09:16:34 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 09:16:40 | × | jackson99 quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Session timeout)) |
| 09:17:31 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 09:17:31 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 09:17:34 | allbery_b | is now known as geekosaur |
| 09:26:10 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 09:27:17 | → | acidjnk joins (~acidjnk@p200300d0c7271e850c94254067925f57.dip0.t-ipconnect.de) |
| 09:27:18 | × | wre^ quits (~wre@wsip-98-188-242-61.mc.at.cox.net) (Remote host closed the connection) |
| 09:33:01 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 09:35:32 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 09:36:14 | → | xb0o2 joins (~xb0o2@user/xb0o2) |
| 09:37:42 | → | mikoto-chan joins (~mikoto-ch@213-139-178-171.co.dnainternet.fi) |
| 09:39:00 | × | indiana-bones quits (~indignant@94.140.8.115) (Quit: Leaving) |
| 09:41:36 | → | CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 09:41:49 | → | zer0bitz joins (~zer0bitz@2001:2003:f444:a000:8153:e826:3459:f646) |
| 09:46:28 | <tomsmeding> | Inst: FWIW https://paste.tomsmeding.com/FKk61OAc |
| 09:46:52 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) |
| 09:47:14 | <tomsmeding> | poor man's solution, like arrow keys and function keys will just produce some escape sequences as you'll notice, but might be enough for your purposes |
| 09:48:05 | <Inst> | thanks, will check |
| 09:48:27 | → | cstml joins (~cstml@user/cstml) |
| 09:49:02 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) (Client Quit) |
| 09:51:06 | → | MajorBiscuit joins (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) |
| 09:51:37 | × | MajorBiscuit quits (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) (Client Quit) |
| 09:51:47 | → | MajorBiscuit joins (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) |
| 09:55:22 | → | __monty__ joins (~toonn@user/toonn) |
| 10:00:53 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 10:01:01 | × | mikoto-chan quits (~mikoto-ch@213-139-178-171.co.dnainternet.fi) (Ping timeout: 256 seconds) |
| 10:04:06 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) |
| 10:08:57 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds) |
| 10:14:03 | × | cheater quits (~Username@user/cheater) (Ping timeout: 256 seconds) |
| 10:14:29 | → | cheater joins (~Username@user/cheater) |
| 10:15:47 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 10:17:07 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 10:17:23 | → | razetime joins (~quassel@49.207.203.87) |
| 10:18:50 | → | dhil joins (~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net) |
| 10:19:28 | → | euouae joins (~euouae@user/euouae) |
| 10:19:42 | × | gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 10:19:43 | <euouae> | Hello I am looking at the source code in Data.List |
| 10:20:00 | <euouae> | What are these Rules that I see in the comments? |
| 10:20:23 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 10:20:29 | <euouae> | ooh they're GHC rules, https://wiki.haskell.org/GHC/Using_rules I should've guessed |
| 10:20:44 | <c_wraith> | those are actually pragmas, not comments. (Instructions to the compiler that aren't part of the language itself) |
| 10:20:53 | <c_wraith> | Pragmas are enclosed in {-# #-} |
| 10:21:05 | <c_wraith> | Note the #s, which are not part of the comments |
| 10:21:16 | × | gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 10:21:35 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 10:21:49 | <euouae> | right |
| 10:21:59 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 10:23:12 | → | mikoto-chan joins (~mikoto-ch@194.157.16.89) |
| 10:23:15 | <euouae> | Unfortunately that means the source code is harder to read... right? |
| 10:24:54 | <merijn> | euouae: yes, no, maybe, it depends :p |
| 10:25:01 | <c_wraith> | Most pragmas aren't important for meaning of the code, only for details that affect optimization |
| 10:25:02 | <euouae> | for example `concat xs = build (\c n -> foldr (\x y -> foldr c y x) n xs)` and `build g = g (:) []` with comments about how `build` is specially crafted to avoid GHC's simplifier? |
| 10:25:27 | <merijn> | euouae: effectively, the RULES in Data.List are optimisation that avoid building intermediate lists |
| 10:25:34 | <c_wraith> | the Language pragma is the one major exception, as it changes what code means in a lot of cases |
| 10:25:48 | <euouae> | merijn at the syntactic level? |
| 10:26:25 | <merijn> | euouae: Imagine "map f . map g", the 'map g' will build a new list, and so will 'map f' so building a list twice...you could replace it with 'map (f . g)' and only build one list |
| 10:26:48 | <merijn> | euouae: The rules are there to capture a lot of similar cases and transform them to be more efficient |
| 10:27:04 | × | yauhsien quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 10:27:05 | × | Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds) |
| 10:27:07 | <c_wraith> | You should basically ignore RULES pragmas in source, unless you're trying to understand performance characteristics |
| 10:27:15 | <merijn> | euouae: But that's not really important for the *meaning* of the code |
| 10:27:28 | <euouae> | OK I think I get it |
| 10:27:36 | <c_wraith> | ... Except that it's possible to write buggy RULES. That's an unfortunate reality, but I've never actually seen it come up. |
| 10:27:38 | <euouae> | but I'm still curious, how is the map optimization accomplished? |
| 10:27:39 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 10:27:44 | → | yauhsien joins (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) |
| 10:28:03 | <merijn> | euouae: Pretty sure there's a rule for converting 'map f . map g' into 'map (f . g)' :p |
| 10:28:03 | <euouae> | c_wraith so then they can't be ignored until they're fixed :P |
| 10:28:33 | → | dsrt^ joins (~dsrt@wsip-98-188-242-61.mc.at.cox.net) |
| 10:28:52 | <merijn> | euouae: The thing about rules is that they can apply *after* inlining code. So during compilation when the compiler inlines stuff, it might find matches for the pattern in rules that the programmer can't/doesn't see |
| 10:28:55 | <euouae> | merijn got it, so it's a literal rewrite of the source code |
| 10:29:25 | <euouae> | nice |
| 10:29:44 | <c_wraith> | in the more general case though though, there are rules for using foldr on a list created by build that skips actually allocating the intermediate list |
| 10:29:48 | <merijn> | euouae: Almost nobody (who isn't a beginner) will end up *writing* 'map f . map g' over 'map (f . g)', but once there's 10 different helpers, etc. involved code like "foo (+) bar" might up *doing* that anyway |
| 10:30:05 | <merijn> | the same for folds, repeated ++, etc. |
| 10:31:19 | <euouae> | c_wraith oh so `build` is useful insofar as writing rules goes! I get it |
| 10:31:39 | <c_wraith> | exactly |
| 10:32:27 | <tomsmeding> | c_wraith: "I've never actually seen it come up" it was a major issue with ghc 9.0: https://gitlab.haskell.org/ghc/ghc/-/issues/19345 |
| 10:32:40 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 10:33:24 | <c_wraith> | I suppose I should say I don't see it come up |
| 10:33:34 | <c_wraith> | ... in released libraries |
| 10:33:40 | <c_wraith> | Though that one did get released! |
| 10:33:45 | <euouae> | marijn, that's smart. because of the inlining this optimization is useful even if the programmer is perfect |
| 10:34:31 | <euouae> | Unless say the programmer also guesses the inlining correctly, but yeah. I guess this rewriting idea must be a common optimization technique right? |
| 10:34:47 | → | DNH joins (~DNH@2a02:8108:1100:16d8:b0c0:5871:210d:15db) |
| 10:35:04 | <c_wraith> | well, it depends heavily on purity to be so broadly applicable |
| 10:35:10 | <merijn> | euouae: I mean, in general "inlining a bunch of stuff, then optimising away stuff that you now know statically" is a common application step |
| 10:35:17 | → | nschoe joins (~quassel@178.251.84.79) |
| 10:35:23 | <euouae> | right |
| 10:35:54 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 10:36:10 | → | mixfix41 joins (~homefame@user/mixfix41) |
| 10:36:16 | <merijn> | Purity helps. Any compiler class on optimisation will start with "here's a neat optimisation" and then go onto "here's why mutability wrecks our day and makes us invest decades to check when we are actually allowed to do it" :p |
| 10:37:08 | <euouae> | heh I can only imagine what GCC is doing |
| 10:37:34 | × | yauhsien quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 10:40:10 | <merijn> | euouae: A simple example is that, when you use a typeclass polymorphic function (whether it's fmap or (+)) and the compiler statically knows the type, it can just use the correct function directly, without the typeclass indirection |
| 10:40:35 | → | yuri_ joins (~yuri@nat-0-31.msu.umos.ru) |
| 10:40:55 | <euouae> | there's cases where it's undetermined at compile time? |
| 10:41:09 | <merijn> | euouae: So if you inline a typeclass polymorphic function into a static expression (or other context with fixed compile time type), you avoid 100% of the cost of the indirection |
| 10:41:32 | <geekosaur> | polymorphic recursion is a thing |
| 10:41:42 | <c_wraith> | as a technical matter, GHC uses separate compilation. Sometimes it has to compile a function in a context where it's polymorphic, so it doesn't know what the type is |
| 10:41:47 | × | gustik quits (~gustik@2a01:c844:2436:6920:9e9:f97c:41d1:634c) (Quit: Leaving) |
| 10:42:01 | <merijn> | euouae: Well, consider situations where a value is made from user input at runtime |
| 10:42:10 | <c_wraith> | As a theoretical case, yeah - polymorphic recursion can happen. You can call a function on a type not known until runtime |
| 10:42:14 | <merijn> | Separate compilation to, yeah |
| 10:43:58 | → | yauhsien joins (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) |
| 10:44:17 | × | Techcable quits (~Techcable@168.235.93.147) (Ping timeout: 240 seconds) |
| 10:44:24 | <euouae> | Oh I see, so the trick is to have e.g. the constructor take an argument of a more complicated type |
| 10:44:36 | <euouae> | wikipedia has `data Nested a = a :<: (Nested [a]) | Epsilon` as an example |
| 10:44:57 | <c_wraith> | > let f :: Show a => Int -> a -> String ; f 0 x = show x ; f n x = f (n - 1) (x, x) in f 3 () -- euouae: or this |
| 10:44:58 | <lambdabot> | "((((),()),((),())),(((),()),((),())))" |
| 10:45:16 | <c_wraith> | the type show is called on depends on the Int parameter |
| 10:45:55 | <euouae> | isn't show called on a value, not a type? |
| 10:46:11 | <c_wraith> | yes. I meant to say the type it is called *at* |
| 10:46:36 | → | SummerSonw joins (~The_viole@203.77.49.232) |
| 10:46:37 | <euouae> | oh wow so this creates different instances of `f` depending on the argument |
| 10:46:43 | <euouae> | so the compiler has to provide a factory of f's for the runtime |
| 10:46:45 | × | fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds) |
| 10:46:49 | <merijn> | euouae: Right |
| 10:47:13 | <tomsmeding> | it might be instructive to consider that 'Show a =>' an actual, normal argument |
| 10:47:17 | <euouae> | ah polymorphism has some tricky implications |
| 10:47:34 | <merijn> | tomsmeding: The origin discussion was that in a lot of cases that can be optimised away :p |
| 10:47:49 | <tomsmeding> | ah right -- except in cases like this |
| 10:48:04 | × | yauhsien quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 10:48:45 | → | yauhsien joins (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) |
| 10:49:31 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 10:50:45 | <euouae> | but this is undecidable right? so the compiler /tries/ to guess that `f` requires no factory, and if the compiler can't prove that in sufficient time it just creates a factory for it |
| 10:51:11 | <c_wraith> | actually, polymorphic recursion is easily detected. |
| 10:51:49 | <tomsmeding> | euouae: re your Nested example: this kind of stuff appears in the wild, e.g. in finger trees used in Data.Sequence; see e.g. https://dl.acm.org/doi/pdf/10.1145/3406088.3409026 |
| 10:51:53 | <euouae> | What of `let f :: Show a => Int -> a -> String ; f 0 x = show x ; f n x = f (n - 1) x`, is that polymorphic recursion or not? |
| 10:52:15 | <merijn> | euouae: The type of each recursive call is different |
| 10:52:20 | <c_wraith> | it is. when it calls f recursively, the type is different |
| 10:52:38 | <tomsmeding> | no, because you changed (x, x) to just x :p |
| 10:52:58 | <euouae> | wait, those are conflicting answers |
| 10:52:59 | <merijn> | euouae: Consider "map f (x:xs) = f x : map f xs" here, the recursive call of 'map' has the exact same type as the original call |
| 10:53:22 | <merijn> | euouae: You typed different code from c_wraith's version :p |
| 10:53:39 | <euouae> | I know it was on purpose... how is polymorphic recursion detected? |
| 10:53:51 | <euouae> | Is it just by asking if the type of the recursive call is different than the original? |
| 10:54:13 | <c_wraith> | yes. that's the definition of polymorphic recursion |
| 10:54:15 | <merijn> | euouae: asking whether it's *different* is hard |
| 10:54:16 | <tomsmeding> | you typecheck the whole thing, and check whether all the recursive calls have the same instantiations of the type parameters as the function itself |
| 10:54:23 | <merijn> | euouae: Asking whether it's *the same* is easy |
| 10:54:31 | <tomsmeding> | if not, it's potentially polymorphic recursion |
| 10:54:42 | <euouae> | merijn are you talking about equality versus equivalence of some sort? |
| 10:54:51 | <merijn> | euouae: So you just treat all cases that aren't the same as polymorphic |
| 10:54:58 | <euouae> | right |
| 10:55:07 | <merijn> | euouae: In the presence of parametric polymorphism you have cases where something "might be the same" |
| 10:55:13 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 10:55:14 | <tomsmeding> | there is an algorithm that distinguishes "surely the same" and "maybe different" |
| 10:55:35 | <merijn> | euouae: Consider: 'Nothing :: Maybe a' |
| 10:55:47 | <euouae> | tomsmeding thanks for that paper, looks interesting. I never read about finger trees so maybe soon is the time |
| 10:55:56 | <merijn> | Does Nothing have type 'Maybe Int'? It could...but it's not guaranteed |
| 10:56:44 | <euouae> | merijn Nothing gets a factory too?! |
| 10:57:06 | <merijn> | euouae: No, there's just one Nothing. But it's polymorphic, so its type fits many things |
| 10:57:34 | <merijn> | euouae: My point was just that "when it's polymorphic you can't really say it will be a specific type at runtime" |
| 10:57:36 | × | yuri_ quits (~yuri@nat-0-31.msu.umos.ru) (Quit: Leaving) |
| 10:57:56 | × | nschoe quits (~quassel@178.251.84.79) (Ping timeout: 250 seconds) |
| 10:58:01 | <euouae> | right |
| 10:58:11 | <euouae> | no I'm following. It's all new to me though |
| 10:58:12 | <tomsmeding> | Nothing _would_ get a factory, but that factory would always produce the same thing anyway, so let's not make the factory at all |
| 10:58:19 | <merijn> | euouae: It might not be knowable until runtime what the proper type for 'a' should be |
| 10:58:36 | <merijn> | euouae: So 'do these things have the same type' isn't answerable until runtime in that case |
| 10:58:47 | <merijn> | euouae: (at which point, you're too late :p) |
| 10:59:01 | → | fef joins (~thedawn@user/thedawn) |
| 10:59:14 | <euouae> | heh yeah |
| 10:59:14 | <merijn> | euouae: Which is why you *can* easily detect "these things are the same", but not "these things are *not* the same" |
| 11:00:12 | <merijn> | I mean, consider a worse version of f with 'f n x | even n = f (n-1) [x]; | otherwise = f (n-1) (x, x)" |
| 11:00:41 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 11:01:09 | <merijn> | > let f :: Show a => Int -> a -> String; f 0 x = show x; f n x | even n = f (n-1) [x]; f n x = f (n-1) (x, x) in f 4 () |
| 11:01:11 | <lambdabot> | "([([()],[()])],[([()],[()])])" |
| 11:01:21 | → | SnowNeo joins (~SnowNeo@49.36.127.54) |
| 11:01:24 | → | alx741 joins (~alx741@157.100.93.160) |
| 11:01:28 | <SnowNeo> | hello! anyone here |
| 11:01:39 | <SnowNeo> | jackdk dang you still here? |
| 11:01:50 | <jackdk> | SnowNeo: yeah mate |
| 11:01:57 | <SnowNeo> | nice nice, you free for a second? |
| 11:02:04 | <euouae> | merijn great stuff :D |
| 11:02:23 | <SnowNeo> | i'm basically trying to print a Floating point number |
| 11:02:26 | <jackdk> | yea for a bit, but just ask your question. Even if nobody can answer you might have insight just by wrangling it into text |
| 11:02:29 | <SnowNeo> | and having great problems |
| 11:02:40 | <jackdk> | go on |
| 11:02:40 | <SnowNeo> | `radicalcoolical outer inner = sqrt(outer^2*inner)` |
| 11:02:48 | <SnowNeo> | i want to print the result of this but I have no idea how |
| 11:03:00 | <SnowNeo> | \sqrt{3^{2}7} |
| 11:03:07 | <SnowNeo> | \sqrt{3^{2}7} = 3\sqrt{7} |
| 11:03:11 | → | lavaman joins (~lavaman@98.38.249.169) |
| 11:03:18 | <jackdk> | "print" as in "I've performed this computation and I want it to appear on the terminal", or "print" as in "I wanna turn it into a string"? |
| 11:03:31 | <SnowNeo> | i wanna make it a string |
| 11:03:37 | <jackdk> | :t show |
| 11:03:38 | <lambdabot> | Show a => a -> String |
| 11:03:43 | <SnowNeo> | but that doesn't work |
| 11:03:47 | <euouae> | tomsmeding quick question, what is the name of a type such as the one I gave above from wikipedia? If they have a name |
| 11:03:48 | <jackdk> | > show 3.14 |
| 11:03:50 | <lambdabot> | "3.14" |
| 11:04:00 | <SnowNeo> | well |
| 11:04:10 | <SnowNeo> | lemme send my code and the error |
| 11:04:23 | <SnowNeo> | https://paste.tomsmeding.com/lfYS7UT6 |
| 11:04:24 | <euouae> | parametric polymoprhic types? |
| 11:04:51 | <SnowNeo> | https://paste.tomsmeding.com/lfYS7UT6 <- code |
| 11:04:52 | <SnowNeo> | https://paste.tomsmeding.com/dV9ePzRa <- error |
| 11:05:24 | <SnowNeo> | works fine in ghci |
| 11:05:42 | <SnowNeo> | Prelude> radicalcoolical 3 7 |
| 11:05:43 | <SnowNeo> | 7.937253933193772 |
| 11:05:58 | <SnowNeo> | but i don't know how ghci actually prints the values :/ |
| 11:06:00 | <jackdk> | SnowNeo: yeah so that error is telling you the problem - inside that `do` block, you need to use IO actions |
| 11:06:08 | <jackdk> | :t putStrLn |
| 11:06:09 | <lambdabot> | String -> IO () |
| 11:06:20 | <jackdk> | :t putStrLn (show 3.14) |
| 11:06:21 | <lambdabot> | IO () |
| 11:06:39 | <jackdk> | but also there's a `print` function which is `print x = putStrLn (show x)` |
| 11:06:41 | <jackdk> | :t print |
| 11:06:42 | <lambdabot> | Show a => a -> IO () |
| 11:06:45 | <SnowNeo> | oh my god tysm! |
| 11:06:52 | <SnowNeo> | you blow my mind every single time |
| 11:07:00 | <SnowNeo> | thanks a bunch jackdk |
| 11:07:03 | <jackdk> | np |
| 11:07:08 | <SnowNeo> | <3 |
| 11:07:09 | <tomsmeding> | euouae: not sure :p |
| 11:07:18 | × | SnowNeo quits (~SnowNeo@49.36.127.54) (Quit: Client closed) |
| 11:07:18 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 11:07:29 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 11:07:34 | <euouae> | maybe it should be polymorphic recursive type or such |
| 11:08:07 | <euouae> | this kind of thing makes it hard to reason about types |
| 11:08:39 | <euouae> | I'm also studying F* which on the outset looks kinda like haskell but I'm noticing that it does not have this feature, I don't think. |
| 11:08:57 | <tomsmeding> | euouae: the simplified finger trees paper I linked calls that phenomenom "non-regular recursion" (the sentence that goes over from page 1 to page 2) |
| 11:10:13 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 11:11:38 | × | zer0bitz quits (~zer0bitz@2001:2003:f444:a000:8153:e826:3459:f646) (Read error: Connection reset by peer) |
| 11:13:02 | → | zer0bitz joins (~zer0bitz@2001:2003:f444:a000:8153:e826:3459:f646) |
| 11:13:29 | <jackdk> | the finger trees made simple talk is also excellent https://www.youtube.com/watch?v=ip92VMpf_-A |
| 11:14:01 | <euouae> | nice, ty |
| 11:14:12 | <euouae> | Oh that's the author? |
| 11:14:26 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 11:14:49 | <euouae> | yeah seems so, cool |
| 11:15:14 | <euouae> | Recently I've been trying to understand basic things about formal verification and how to use dependent type theory |
| 11:15:18 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 11:15:39 | <euouae> | and this sort of thing about parametric polymorphism seems to be requiring proofs on the level of types themselves |
| 11:17:16 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 11:18:17 | × | xff0x quits (~xff0x@2001:1a81:5253:5900:c0c8:bfdc:4cf0:476f) (Ping timeout: 240 seconds) |
| 11:20:04 | → | Topsi joins (~Tobias@dyndsl-095-033-018-101.ewe-ip-backbone.de) |
| 11:20:28 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 11:21:47 | <euouae> | for example the simple formula `f x n = if n = 0 then x else f [x] n` can be proven to be such that `f x n === iterate singleton x !! n` |
| 11:22:49 | → | lavaman joins (~lavaman@98.38.249.169) |
| 11:23:34 | <tomsmeding> | what even is the type of that f |
| 11:23:45 | <tomsmeding> | oh dependent types, /me nods |
| 11:24:09 | <euouae> | right but OK in the case of Haskell you can use `show` there |
| 11:25:10 | <euouae> | I think at this point I'm just rambling. I got a lot of new info, thanks everyone |
| 11:27:09 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 11:27:37 | × | euouae quits (~euouae@user/euouae) (Quit: ) |
| 11:28:16 | × | acidjnk quits (~acidjnk@p200300d0c7271e850c94254067925f57.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 11:30:47 | → | xff0x joins (~xff0x@2001:1a81:5253:5900:c0c8:bfdc:4cf0:476f) |
| 11:32:11 | × | fef quits (~thedawn@user/thedawn) (Remote host closed the connection) |
| 11:33:29 | <Inst> | right now, i have a case of expression and i'd like to do pattern matching |
| 11:33:35 | <Inst> | within the syntax case x of |
| 11:33:44 | <Inst> | x = three different expressions, and haskell is apparently letting me do this |
| 11:34:05 | <Inst> | in the k -> j, k i want to be 3 separate values for the different expressions |
| 11:34:18 | <Inst> | currently, i'm using tuples, but for performance reasons, i'd like to ditch the tuples |
| 11:34:21 | <Inst> | any idea what i can do? |
| 11:35:31 | → | cfricke joins (~cfricke@user/cfricke) |
| 11:36:00 | <Inst> | right now, i'm using a where block to define a function instead of case |
| 11:36:09 | <Inst> | but is there any way i can do this without the where block? |
| 11:37:23 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 11:38:53 | <geekosaur> | show your code? |
| 11:38:56 | <geekosaur> | @paste |
| 11:38:56 | <lambdabot> | A pastebin: https://paste.debian.net/ |
| 11:41:16 | × | dhil quits (~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net) (Ping timeout: 250 seconds) |
| 11:41:19 | <Inst> | https://paste.debian.net/1227090/ |
| 11:41:37 | <Inst> | the tupled version is actually more performant |
| 11:41:42 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 11:41:51 | <Inst> | or actually less resource intensive than the mainline version |
| 11:42:37 | <Inst> | with where |
| 11:42:50 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:44:46 | <geekosaur> | I don't think I understand what your problem is. I'd probably separate out the case expression for clarity, but as your code shows this isn't necessary syntactically |
| 11:45:15 | <Inst> | i'm trying to implement an imperative loop with checks in haskell |
| 11:45:25 | → | mastarija joins (~mastarija@2a05:4f46:e0e:5000:81fe:1ebc:de4c:76ed) |
| 11:45:54 | <Inst> | that is to say, there are three conditions, if they're met, a certain action occurs per condition (accumulator is increased), and if none are met, the accumulator is also increased (by a different amount) |
| 11:46:17 | <Inst> | the tupled version works, but i'd like to avoid the tuple |
| 11:47:09 | <geekosaur> | I think the only way you avoid it is by having separate `case-of`s, and in this case that would get fairly ugly |
| 11:48:09 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) |
| 11:48:17 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 11:48:44 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:50:32 | <geekosaur> | personally I'd just go with the tuples. even if you discarded them entirely and did pattern matching in the definition, you'd have a decent amount of code duplication |
| 11:53:32 | → | fef joins (~thedawn@user/thedawn) |
| 11:53:50 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 11:54:32 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:54:32 | <Inst> | there's a way to do it with where, bind the mod statements to k, it's a bit more succinct that way, but performance and resource penalty |
| 11:57:45 | <opticblast> | unboxed tuples? if you really want to be performant |
| 11:59:46 | × | MajorBiscuit quits (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) (Quit: WeeChat 3.3) |
| 11:59:56 | → | MajorBiscuit joins (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) |
| 12:00:01 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 12:00:11 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:02:27 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 12:02:29 | <geekosaur> | pretty sure ghc already unboxes any strict tuple |
| 12:02:40 | × | Codaraxis_ quits (~Codaraxis@user/codaraxis) (Remote host closed the connection) |
| 12:03:00 | → | Codaraxis_ joins (~Codaraxis@user/codaraxis) |
| 12:03:18 | <geekosaur> | and since these are Ints or at least Integers, they're strict |
| 12:03:36 | × | kaph_ quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Read error: Connection reset by peer) |
| 12:05:04 | <lortabac> | are Int's strict? I don't see any strictness annotation in the definition |
| 12:05:41 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 12:05:50 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:05:55 | × | fef quits (~thedawn@user/thedawn) (Remote host closed the connection) |
| 12:05:59 | <geekosaur> | they don't need one, Int# is necessarily strict because it's a machine word |
| 12:06:35 | <lortabac> | yes Int# is strict, but Int? |
| 12:06:37 | → | unknown__ joins (~thedawn@user/thedawn) |
| 12:07:03 | <geekosaur> | the only source of laziness is the I# wrapper and ghc treats that as strict because the underlying type and all basic operations are strict |
| 12:07:33 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 12:08:47 | <geekosaur> | basically the Int itself (I# Int#) is strict by necessity because the Int# is, the laziness comes in with whatever's holding an Int. in this case it's a tuple, and ghc will seek to make the tuple strict as one of the first optimizations it does. since I# Int# is strict, this is trivially satisfiable and the whole thing becomes strict |
| 12:09:46 | <geekosaur> | (this is also why ghci has no optimizations enabled, you can't turn off that strictifying-tuples optimization and ghc bytecode can't tell the difference between boxed and unboxed tuples so it crashes when it encounters an unboxed tuple) |
| 12:10:15 | × | razetime quits (~quassel@49.207.203.87) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 12:11:21 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 12:11:29 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:12:25 | <lortabac> | geekosaur: what about the optimization of I#? is it enabled by -fstrictness or is it something else? |
| 12:13:26 | <geekosaur> | not sure I understand the question. a constructor tag can't separately be strict or lazy |
| 12:15:02 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 12:15:54 | <lortabac> | oh ok I see what you mean |
| 12:15:59 | <geekosaur> | again, any laziness comes with whatever's holding the whole vslue. and in this case ghc really wants to strictify that tuple, so it'll look inside and see three strict values and go ahead and strictify and unbox the tuple |
| 12:16:26 | <geekosaur> | things would rapidly become really confused if the constructor tag were separately allowed to be lazy |
| 12:16:37 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 12:17:26 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:17:33 | → | kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it) |
| 12:18:34 | <geekosaur> | hm, although I guess we do not know that the values originally were strict, since it could have been produced by a lazy function. that said, it's going into a case-of, and pattern matching strictifies by default so it still works out |
| 12:18:47 | <Inst> | btw |
| 12:18:58 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 250 seconds) |
| 12:19:26 | <Inst> | my cabal refuses to install packages, it can't determine the version of ghc |
| 12:19:38 | <Inst> | i've been manually editing my GHCup managed GHC installation |
| 12:19:53 | <geekosaur> | did you select a particular ghc? |
| 12:20:11 | <geekosaur> | ("ghcup tui" is good for checking and managing this) |
| 12:21:18 | <geekosaur> | also doublecheck $PATH is set properly. there should be a file ~/.ghcup/env that you can "." or "source" from your shell startup files |
| 12:21:45 | × | CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 12:22:52 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 12:23:17 | → | CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 12:23:23 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:23:34 | → | ksqsf joins (~user@2001:da8:d800:611:9111:d58c:6bc4:c652) |
| 12:23:51 | × | yauhsien quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 12:24:32 | → | yauhsien joins (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) |
| 12:26:16 | → | Techcable joins (~Techcable@168.235.93.147) |
| 12:28:31 | × | mikoto-chan quits (~mikoto-ch@194.157.16.89) (Ping timeout: 256 seconds) |
| 12:28:55 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 12:29:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:30:09 | <maerwald> | Inst: manually editing? |
| 12:30:43 | <Inst> | the shim files |
| 12:30:50 | <maerwald> | you're on windows? |
| 12:31:12 | <Inst> | yeah |
| 12:31:22 | <maerwald> | you shouldn't do that lol |
| 12:31:32 | <Inst> | i don't dev enough to learn *nix |
| 12:31:41 | <Inst> | going to get a Macbook Air in May |
| 12:31:57 | → | cfricke joins (~cfricke@user/cfricke) |
| 12:32:03 | <maerwald> | if you want to set the default ghc to 8.10.7 run: ghcup set ghc 8.10.7 |
| 12:32:11 | <Inst> | and probably if my fucking computer stops being a piece of shit (i.e, it's reliable), I'll update the workstation laptop with a new SSD and install Arch Linux on it |
| 12:32:12 | <maerwald> | unfortunately, windows doesn't have 'ghcup tui' |
| 12:32:16 | → | burnsidesLlama joins (~burnsides@dhcp168-039.wadham.ox.ac.uk) |
| 12:32:21 | <geekosaur> | you can install wsl2 now, although there are quite a few differences between linux and os x |
| 12:32:25 | <geekosaur> | oh :( |
| 12:32:42 | <maerwald> | yeah, brick has no windows support |
| 12:32:53 | <maerwald> | unsurprisingly |
| 12:33:00 | <Inst> | "the version of ghc 9.0.1 is not supported" |
| 12:33:03 | <Inst> | oh, no wonder |
| 12:33:30 | × | cfricke quits (~cfricke@user/cfricke) (Client Quit) |
| 12:33:36 | × | whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 12:33:37 | <maerwald> | I'm still confused why I'm not getting any windows user bug reports... because they don't know how to report bugs or because there are none? |
| 12:33:39 | <Inst> | i don't have 9.0.1 installed |
| 12:33:40 | → | cfricke joins (~cfricke@user/cfricke) |
| 12:33:46 | <maerwald> | Inst: ghcup install ghc 9.0.1 |
| 12:34:00 | <Inst> | can ghcup uninstall? I don't need ghc 9.0.2 |
| 12:34:04 | <maerwald> | yes |
| 12:34:07 | <geekosaur> | at this point (a) if I used 9.x at all it'd be 9.0.2 (b) still stick to 8.10.7 |
| 12:34:10 | <maerwald> | ghcup rm ghc 9.0.2 |
| 12:34:21 | × | yauhsien quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 12:34:24 | <maerwald> | but 9.0.1 isn't really a good choice |
| 12:34:32 | <maerwald> | unless you like to have soundness issues in your code |
| 12:34:35 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 12:34:46 | <Inst> | doip, but HLS hasn't updated to support 9.0.2 yet :( |
| 12:34:50 | <maerwald> | true |
| 12:35:00 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 250 seconds) |
| 12:35:02 | → | yauhsien joins (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) |
| 12:35:08 | <Inst> | i'd rather it just support 9.2.1 |
| 12:35:22 | <geekosaur> | that'll take more work |
| 12:35:36 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:35:49 | <geekosaur> | they redid a bunch of stuff, in the long run things should work better but in the short run there's a fair number of breaking changes |
| 12:35:57 | × | nunggu quits (~q@gateway/tor-sasl/nunggu) (Ping timeout: 276 seconds) |
| 12:36:06 | <geekosaur> | "should work better" meaning it should be easier to support new versions |
| 12:36:10 | <Inst> | i'm fairly annoyed that they changed record syntax |
| 12:36:12 | <Inst> | now it's confusing with . |
| 12:36:17 | × | CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 12:36:28 | <geekosaur> | you have to enable that |
| 12:36:28 | <Inst> | totally should have tried screwing a different operator instead |
| 12:36:33 | <Inst> | oh, so an option |
| 12:36:37 | <Inst> | nice |
| 12:36:39 | → | nunggu joins (~q@gateway/tor-sasl/nunggu) |
| 12:36:42 | <geekosaur> | RecordDotSyntax |
| 12:36:48 | <geekosaur> | iirc |
| 12:37:15 | <geekosaur> | they did seriously discuss using # instead. but users wanted . |
| 12:37:15 | <Inst> | jesus, my ghcup is already 10 gb |
| 12:37:33 | <maerwald> | Inst: ghcup gc --help |
| 12:37:35 | <Inst> | the lack of windows support with haskell ecosystem is bad |
| 12:37:37 | × | burnsidesLlama quits (~burnsides@dhcp168-039.wadham.ox.ac.uk) (Remote host closed the connection) |
| 12:38:12 | → | burnsidesLlama joins (~burnsides@dhcp168-039.wadham.ox.ac.uk) |
| 12:38:14 | <Inst> | haskell imo has to get them early / get them young |
| 12:38:23 | → | da39a3ee5e6b4b0d joins (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) |
| 12:38:35 | <Inst> | if people wanted to do FP, the FP support in mainstream languages is increasingly good |
| 12:38:52 | <Inst> | and they avoid Haskell's purity issues with GUI, they avoid Haskell's issues with unpredictable and lost performance |
| 12:39:43 | <Inst> | only thing that really makes me want to learn Haskell, despite seeing that there's a huge moountain to climb |
| 12:39:46 | <Inst> | haskell syntax is bae |
| 12:40:38 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 12:41:30 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:42:22 | × | burnsidesLlama quits (~burnsides@dhcp168-039.wadham.ox.ac.uk) (Ping timeout: 250 seconds) |
| 12:43:17 | × | In0perable quits (~PLAYER_1@fancydata.science) (Quit: All your buffer are belong to us!) |
| 12:43:37 | <maerwald> | salt bae? |
| 12:46:39 | AlexNoo_ | is now known as AlexNoo |
| 12:46:42 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 12:46:54 | → | geranim0 joins (~geranim0@modemcable242.171-178-173.mc.videotron.ca) |
| 12:47:18 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:47:37 | → | Inoperable joins (~PLAYER_1@fancydata.science) |
| 12:49:40 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 12:49:47 | → | biog joins (~user1@static.39.160.132.142.clients.your-server.de) |
| 12:56:14 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 250 seconds) |
| 12:56:25 | × | max22- quits (~maxime@2a01cb08833598000a8db68817efc706.ipv6.abo.wanadoo.fr) (Ping timeout: 250 seconds) |
| 12:59:46 | × | LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection) |
| 13:01:00 | <Inst> | bae is apparently some youth slang for baby |
| 13:01:06 | → | LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao) |
| 13:01:19 | <Inst> | as a term of endearment |
| 13:05:06 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3) |
| 13:05:47 | × | hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection) |
| 13:05:49 | <maerwald> | TIL |
| 13:05:59 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 13:06:39 | <merijn> | more like babe, imho |
| 13:06:59 | <geekosaur> | no, "bae" is a thing |
| 13:07:12 | <geekosaur> | not sure I want to know why |
| 13:07:28 | <merijn> | geekosaur: I meant bae is more like babe than baby |
| 13:08:30 | <merijn> | it'a just a written form of letting the final syllable drop |
| 13:08:45 | × | Topsi quits (~Tobias@dyndsl-095-033-018-101.ewe-ip-backbone.de) (Ping timeout: 256 seconds) |
| 13:08:46 | → | hughjfchen joins (~hughjfche@vmi556545.contaboserver.net) |
| 13:09:06 | <maerwald> | babe is a subset of baby? |
| 13:09:57 | <merijn> | only if your opinion is that words are exclusively defined by their dictionary meaning with zero emotional connotations and context |
| 13:10:08 | <maerwald> | of course |
| 13:11:11 | → | zincy joins (~zincy@host86-151-99-97.range86-151.btcentralplus.com) |
| 13:12:03 | <merijn> | in other news...my typo rate is gonna skyrocket until I get used to the new keyboard >.> |
| 13:12:48 | <Clint> | that's called progress |
| 13:13:52 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 13:14:51 | → | epolanski joins (uid312403@id-312403.helmsley.irccloud.com) |
| 13:14:57 | → | burnsidesLlama joins (~burnsides@dhcp168-039.wadham.ox.ac.uk) |
| 13:17:42 | → | shriekingnoise joins (~shrieking@156-16-231-201.fibertel.com.ar) |
| 13:21:22 | × | zincy quits (~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Remote host closed the connection) |
| 13:21:39 | × | Erutuon quits (~Erutuon@user/erutuon) (Quit: WeeChat 2.8) |
| 13:21:47 | × | burnsidesLlama quits (~burnsides@dhcp168-039.wadham.ox.ac.uk) (Ping timeout: 256 seconds) |
| 13:25:41 | → | cfricke joins (~cfricke@user/cfricke) |
| 13:26:16 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 13:28:44 | × | ksqsf quits (~user@2001:da8:d800:611:9111:d58c:6bc4:c652) (Ping timeout: 250 seconds) |
| 13:29:20 | × | MajorBiscuit quits (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) (Quit: WeeChat 3.3) |
| 13:29:29 | → | MajorBiscuit joins (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) |
| 13:32:19 | → | nschoe joins (~quassel@178.251.84.79) |
| 13:32:31 | → | slack1256 joins (~slack1256@191.125.99.72) |
| 13:33:30 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 250 seconds) |
| 13:34:35 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 13:37:05 | <Inst> | okay |
| 13:37:25 | <Inst> | i have cabal complaining that it can't determine the version of ghc-pkg.exe |
| 13:38:48 | <Inst> | also, for my gui issue, readline has IO String / char solutions for my problem |
| 13:39:22 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4) |
| 13:41:13 | → | Guest21 joins (~Guest21@2a00:23c8:1510:8b01:f5c5:cd35:22b1:ed5c) |
| 13:43:09 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 256 seconds) |
| 13:47:48 | <maerwald> | Inst: can you pastebin the exact error? |
| 13:47:53 | <maerwald> | I believe I've heard that one before |
| 13:49:34 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 13:49:37 | → | perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) |
| 13:49:54 | <maerwald> | https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/197 |
| 13:50:23 | <maerwald> | are you on windows 7? |
| 13:51:57 | → | jkaye joins (~jkaye@2601:281:8300:7530:91a1:7dca:589a:aaae) |
| 13:52:01 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Quit: ZNC 1.8.2 - https://znc.in) |
| 13:52:25 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 13:53:55 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 256 seconds) |
| 13:56:43 | → | max22- joins (~maxime@2a01cb088335980019ec243b097a98b9.ipv6.abo.wanadoo.fr) |
| 13:58:16 | × | Guest21 quits (~Guest21@2a00:23c8:1510:8b01:f5c5:cd35:22b1:ed5c) (Quit: Client closed) |
| 14:02:42 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 14:06:56 | × | max22- quits (~maxime@2a01cb088335980019ec243b097a98b9.ipv6.abo.wanadoo.fr) (Ping timeout: 252 seconds) |
| 14:13:33 | → | burnsidesLlama joins (~burnsides@dhcp168-039.wadham.ox.ac.uk) |
| 14:14:19 | → | pera joins (~pera@user/pera) |
| 14:20:06 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 14:20:28 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 14:21:09 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 14:21:36 | × | MajorBiscuit quits (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) (Ping timeout: 250 seconds) |
| 14:22:32 | → | stef204 joins (~stef204@user/stef204) |
| 14:23:01 | × | stef204 quits (~stef204@user/stef204) (Client Quit) |
| 14:25:30 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 250 seconds) |
| 14:27:14 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 250 seconds) |
| 14:28:16 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 14:28:16 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 14:28:16 | → | wroathe joins (~wroathe@user/wroathe) |
| 14:29:39 | → | n3rdy1 joins (~n3rdy1@2600:1700:4570:3480::41) |
| 14:31:34 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 250 seconds) |
| 14:32:48 | → | MajorBiscuit joins (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) |
| 14:33:20 | <geekosaur> | kinda wish (a) linux had ^T (b) cabal-install supported it |
| 14:33:36 | → | ksqsf joins (~user@2001:da8:d800:611:7dce:871f:1852:dbd6) |
| 14:33:57 | × | madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Read error: Connection reset by peer) |
| 14:35:40 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Quit: Leaving) |
| 14:35:45 | × | da39a3ee5e6b4b0d quits (~textual@2403:6200:8876:c04a:44a7:987:8de2:98bb) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 14:36:14 | <merijn> | what do you mean? |
| 14:36:41 | <byorgey> | ^T as in swap the previous two characters?? |
| 14:36:58 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 14:40:20 | → | stef204 joins (~stef204@user/stef204) |
| 14:40:47 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 14:41:05 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 14:42:19 | → | IndecisionTree joins (mike@user/IndecisionTree) |
| 14:45:53 | → | emad joins (~emad@102.42.146.250) |
| 14:49:53 | × | pera quits (~pera@user/pera) (Quit: leaving) |
| 14:50:02 | <pavonia> | Matrix transposition |
| 14:50:04 | → | max22- joins (~maxime@2a01cb0883359800ad92d79b8ec75caf.ipv6.abo.wanadoo.fr) |
| 14:50:20 | ← | f33d1[m] parts (~g0nkstead@2001:470:69fc:105::1:320b) () |
| 14:50:24 | → | xkuru joins (~xkuru@user/xkuru) |
| 14:54:27 | × | xb0o2 quits (~xb0o2@user/xb0o2) (Quit: Client closed) |
| 14:54:34 | <geekosaur> | status, on *bsd |
| 14:55:05 | <geekosaur> | so for example cabal-install could trap SIGSTAT and report what it's working on currently and around how far it is |
| 14:55:57 | <maerwald> | not sure cabal-install knows that |
| 14:56:30 | <geekosaur> | linus has consistently rejectred supporting it or anything like it because it's a bit of an ugly hack… but looking at the rest of the linux kernel I don't see how that's any different :) |
| 14:57:29 | <geekosaur> | it captures logs and can parse e.g. [3 of 197] |
| 14:57:34 | × | ksqsf quits (~user@2001:da8:d800:611:7dce:871f:1852:dbd6) (Ping timeout: 250 seconds) |
| 14:59:05 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 14:59:11 | → | EvanR joins (~EvanR@user/evanr) |
| 15:07:57 | → | shapr joins (~user@2601:7c0:c37c:46d0:c5e9:5422:b6fa:e10b) |
| 15:10:01 | × | dsrt^ quits (~dsrt@wsip-98-188-242-61.mc.at.cox.net) (Remote host closed the connection) |
| 15:12:13 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 15:12:19 | → | slowButPresent joins (~slowButPr@user/slowbutpresent) |
| 15:14:28 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
| 15:14:57 | → | xb0o2 joins (~xb0o2@user/xb0o2) |
| 15:15:02 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 15:16:06 | → | Guest1824 joins (~Guest18@2a02:8388:6bc1:1d00:6d47:dee9:5eda:9fbe) |
| 15:16:17 | × | n3rdy1 quits (~n3rdy1@2600:1700:4570:3480::41) (Ping timeout: 240 seconds) |
| 15:19:06 | <Guest1824> | hi all. I'm looking for a function `[a] -> [[[a]]]`, that given a list produces all possible combinations of sublists, such that each combination concats to the original list, if that makes sense |
| 15:21:07 | <Guest1824> | e.g. foo [1,2,3] -> [ [ [1], [2], [3] ], [ [1], [2, 3] ], [ [1, 2], [3] ], [ [1, 2, 3] ] ] |
| 15:22:03 | <EvanR> | all possible list factorizations (relative to ++) xD |
| 15:22:22 | <Guest1824> | yes |
| 15:22:24 | <EvanR> | sounds like a job for the list monad |
| 15:23:42 | <EvanR> | :t inits |
| 15:23:42 | → | cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) |
| 15:23:43 | <lambdabot> | [a] -> [[a]] |
| 15:23:44 | → | ksqsf joins (~user@2001:da8:d800:611:7dce:871f:1852:dbd6) |
| 15:24:24 | → | lavaman joins (~lavaman@98.38.249.169) |
| 15:24:55 | <EvanR> | hmm, if you had a function to return all cuts of a list, then you can map each one of those over the recursive question function and then join |
| 15:25:28 | <EvanR> | cuts :: [a] -> [([a],[a])] |
| 15:25:42 | <EvanR> | or, breaks |
| 15:28:03 | <EvanR> | factor xs = concatMap (\l r -> map (l ++) (factor r)) (breaks xs) |
| 15:28:19 | <EvanR> | er |
| 15:28:20 | × | ksqsf quits (~user@2001:da8:d800:611:7dce:871f:1852:dbd6) (Ping timeout: 252 seconds) |
| 15:28:23 | <EvanR> | factor xs = concatMap (\l r -> map (l:) (factor r)) (breaks xs) |
| 15:28:43 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 15:29:27 | → | n3rdy1 joins (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293) |
| 15:29:32 | <EvanR> | factor xs = concatMap (\(l,r) -> map (l:) (factor r)) (breaks xs) |
| 15:29:38 | <EvanR> | at this point, to the ghci mobile |
| 15:29:53 | <xsperry> | > let xs = [1..3] in zip (inits xs) (tails xs) |
| 15:29:53 | → | alx741 joins (~alx741@157.100.93.160) |
| 15:29:54 | <lambdabot> | [([],[1,2,3]),([1],[2,3]),([1,2],[3]),([1,2,3],[])] |
| 15:30:06 | <EvanR> | i forgot about tails xD |
| 15:30:15 | → | cdeln joins (~cdeln@m83-185-94-137.cust.tele2.se) |
| 15:30:20 | <xsperry> | it is missing [1], [2], [3] though |
| 15:30:37 | <EvanR> | that implements breaks though |
| 15:30:57 | × | Techcable quits (~Techcable@168.235.93.147) (Remote host closed the connection) |
| 15:31:06 | → | Techcable joins (~Techcable@168.235.93.147) |
| 15:31:30 | <cdeln> | hello |
| 15:31:44 | <geekosaur> | o/ |
| 15:32:42 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 15:33:19 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 15:33:41 | <cdeln> | first time using irc, cool stuff |
| 15:34:10 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 15:34:52 | <Guest1824> | EvanR: this function is tricky >:D |
| 15:35:04 | <EvanR> | did that factor idea work? |
| 15:35:27 | <Guest1824> | not yet. but the idea definitely makes sense |
| 15:36:26 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.4) |
| 15:36:32 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 15:38:04 | <EvanR> | to get fancy... something like... do { (l,r) <- breaks xs; fmap (l:) (loop r) } |
| 15:39:01 | <EvanR> | = loop xs |
| 15:39:55 | <cdeln> | I have a question about HTTP(S). What libs do you think that I should look into? Browsing hackage there seem to be quite a few. |
| 15:43:36 | <Profpatsch> | Can I :reload cabal packages in my `cabal repl`? |
| 15:44:00 | <Profpatsch> | e.g. I have a separate package coming from /cabal.project and I change something in it, can I tell cabal to reload the package incrementally? |
| 15:44:14 | <sclv> | no |
| 15:44:22 | <Profpatsch> | schade |
| 15:44:28 | <Profpatsch> | sclv: do you have a workaround? |
| 15:44:35 | <merijn> | That's a fundamental limitation in ghci atm |
| 15:44:36 | <sclv> | no |
| 15:44:52 | <merijn> | I think someone was working on multi-component ghci, but it's not done, afaik |
| 15:44:57 | <Profpatsch> | Very close to building my own wrapper which generates a cabal file with all the modules in hs-source-dirs and all the dependencies merged |
| 15:45:20 | <Profpatsch> | So you can develop as if everything was in the same package, but package with different packages |
| 15:45:34 | <Profpatsch> | Generate one cabal file for one use case, generate another for the other |
| 15:46:00 | → | euandreh joins (~euandreh@2804:14c:33:9fe5:6113:2671:c33c:ef4a) |
| 15:46:01 | <Profpatsch> | Transparently switch between treating some packages as static (and pre-compile instead of interpret) and making everything run interpreted |
| 15:46:36 | <Profpatsch> | Use a toml config file to not feel dead inside |
| 15:47:11 | <Guest1824> | EvanR: using your recursive definition with concatMap gives me only []. my definition of breaks is: `breaks xs = zipWith ($) (map splitAt [1..length xs]) (repeat xs)` |
| 15:47:33 | <EvanR> | try xsperry's version of breaks |
| 15:47:57 | <EvanR> | well, if it works, then my code's broke |
| 15:48:22 | × | kaph quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Read error: Connection reset by peer) |
| 15:48:37 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 15:49:14 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 15:49:30 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 15:49:32 | <Guest1824> | xsperry's version has ([], xs) as the first element though, which causes infinite recursion, afaics |
| 15:50:19 | <EvanR> | shoot |
| 15:50:22 | → | alx741 joins (~alx741@157.100.93.160) |
| 15:50:52 | × | xff0x quits (~xff0x@2001:1a81:5253:5900:c0c8:bfdc:4cf0:476f) (Ping timeout: 250 seconds) |
| 15:51:51 | → | xff0x joins (~xff0x@2001:1a81:5253:5900:d5e3:e4eb:c9c5:42b2) |
| 15:55:13 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 15:55:47 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 15:56:23 | × | jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Ping timeout: 252 seconds) |
| 15:57:34 | <Cale> | cdeln: As a client? I've mostly used http-conduit for that. |
| 15:57:59 | → | ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) |
| 15:58:08 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 15:58:31 | <Cale> | merijn: I think I heard the other day that multi-component ghci was basically working on HEAD now :) |
| 15:58:49 | × | dut quits (~dut@user/dut) (Quit: Leaving) |
| 15:59:13 | <Cale> | (but I could have misunderstood or something, I'm not involved in that) |
| 15:59:53 | × | nschoe quits (~quassel@178.251.84.79) (Ping timeout: 256 seconds) |
| 16:00:17 | × | xddq[m] quits (~xddqmatri@2001:470:69fc:105::bfd8) (Quit: You have been kicked for being idle) |
| 16:00:23 | <Guest1824> | EvanR: got it working now. the base case simply was missing :-) |
| 16:00:36 | → | xddq[m] joins (~xddqmatri@2001:470:69fc:105::bfd8) |
| 16:00:41 | <EvanR> | bah, that just means it was co-working |
| 16:01:11 | ← | xddq[m] parts (~xddqmatri@2001:470:69fc:105::bfd8) () |
| 16:01:29 | × | Kaipi quits (~Kaiepi@156.34.47.253) (Read error: Connection reset by peer) |
| 16:01:31 | × | SummerSonw quits (~The_viole@203.77.49.232) (Read error: Connection reset by peer) |
| 16:01:46 | → | Kaipi joins (~Kaiepi@156.34.47.253) |
| 16:02:31 | <Guest1824> | heh. thanks for your help! |
| 16:03:09 | <Cale> | Profpatsch, merijn: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6805 |
| 16:03:47 | → | stef204 joins (~stef204@user/stef204) |
| 16:03:52 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 16:06:32 | <Cale> | https://mpickering.github.io/ide/posts/2020-10-12-multiple-home-units.html -- the high-level overview |
| 16:06:32 | <fendor[m]> | note, this does not have proper ghci support yet, iirc |
| 16:06:34 | unknown__ | is now known as fef |
| 16:07:18 | <geekosaur> | yeh, that seemed to be the last "future work" entry |
| 16:08:18 | <Cale> | Ahh |
| 16:08:24 | <geekosaur> | also no backpack support although I'm not sure if anyone cares |
| 16:08:35 | <EvanR> | :'( |
| 16:08:56 | <geekosaur> | there's a backpack internal that doesn't support multiple home units |
| 16:09:10 | <geekosaur> | they have to sort out how to teach it that without breaking everything |
| 16:09:16 | <cdeln> | Cale: Yes exactly. I am a bit confused about getResponseHeader giving a [ByteString] . Do you know why it's a list and not just ByteString? Would be nice to get something like (MimeType, Encoding) instead... |
| 16:09:43 | → | kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it) |
| 16:10:04 | <Cale> | It gives you all the response headers that have the given name |
| 16:10:17 | <Cale> | There's no guarantee that there's only one, sadly. |
| 16:11:14 | → | Rum joins (~bourbon@user/rum) |
| 16:12:54 | → | alx741 joins (~alx741@157.100.93.160) |
| 16:12:58 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 250 seconds) |
| 16:13:15 | <cdeln> | Oh really? So in practice you just grab the first one and move on with your life i guess |
| 16:13:28 | <Cale> | For those ones, probably |
| 16:13:42 | → | CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 16:13:44 | <EvanR> | if there is even a first one xD |
| 16:13:49 | <Cale> | Some of the possible headers it makes a bit more sense why there might be more than one |
| 16:15:08 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 16:15:19 | → | nschoe joins (~quassel@178.251.84.79) |
| 16:16:35 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 16:16:43 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 16:16:46 | <Cale> | (especially the Via: header, where each proxy or gateway that forwards the response will have added its own) |
| 16:17:21 | <cdeln> | Ok, makes sense for this level of abstraction in the http-conduit API. |
| 16:18:10 | <cdeln> | Do you know of any lib that parses HTTP stuff to a proper ADT? |
| 16:18:22 | <wmacmil> | i've upgraded ghc (8.10.7) and now a project which used import Data.Aeson is now not finding it |
| 16:18:47 | <cdeln> | I want to pattern match on the media type, wondering if i need to parse the content type header myself or not |
| 16:18:51 | <wmacmil> | when i run "cabal install aeson" it gives me this @ WARNING: Installation might not be completed as desired! @ |
| 16:19:05 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.4) |
| 16:19:21 | <geekosaur> | if you are doing this the old-gfashioned way then you want to add --lib |
| 16:19:31 | <cdeln> | EvanR: True :p gotta do some Maybe wrapping |
| 16:19:37 | <geekosaur> | but ideally you make a cabal project and let cabal manage the deps for you instead of doing it manually |
| 16:20:24 | <geekosaur> | this avoids things like version collisions between multiple projects |
| 16:22:27 | → | waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
| 16:22:46 | <Cale> | cdeln: I don't know of anything too nice in that direction. Presumably it shouldn't be impossible to write some parsers for further processing the various HTTP headers and use them alongside something like http-conduit. I suspect that everyone is currently just looking for particular details and processing things by hand. |
| 16:23:40 | <geekosaur> | I'm pretty sure there is no general HTTP/HTML ADT that is any better than just working with HTTP/HTML directly |
| 16:23:55 | <Cale> | https://hackage.haskell.org/package/http-media -- this looks vaguely related |
| 16:24:48 | <Cale> | (but it's kind of a different thing really) |
| 16:26:06 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 16:26:06 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 16:26:06 | → | wroathe joins (~wroathe@user/wroathe) |
| 16:26:17 | <Cale> | (Yeah, I think it's meant more for use on the server side to select a form of content to deliver) |
| 16:26:20 | <wmacmil> | @geekosaur : where's the best place to read about this? so do i just run 'cabal init' and 'cabal run' and then add aeson as a dependency in 'code.cabal' |
| 16:26:20 | <lambdabot> | Unknown command, try @list |
| 16:27:23 | <geekosaur> | that's part of it. you also use a cabal.project file although it may only contain a "src" stanza, then cabal v2-build |
| 16:27:56 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:58ed:c475:7de8:f0f9) (Quit: WeeChat 2.8) |
| 16:28:18 | <geekosaur> | it should manage building dependencies automatically and make them available only to your project (but if some other project at some point needs the same version of the same dependency/ies, it'll reuse them instead of rebuilding) |
| 16:28:30 | <cdeln> | Cale: Ok thx. Yeah looks so.. |
| 16:28:34 | → | merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) |
| 16:28:54 | <geekosaur> | you get some real messes when you install dependencies "globally" which is why tools like cabal (v2+) and stack exist |
| 16:29:08 | → | Akiva joins (~Akiva@user/Akiva) |
| 16:32:46 | <wmacmil> | do you manually add them to .cabal, or is there a way to do it from the |
| 16:32:49 | <wmacmil> | command line |
| 16:33:11 | <geekosaur> | currently you add them manually |
| 16:33:22 | → | alx741 joins (~alx741@157.100.93.160) |
| 16:34:30 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3) |
| 16:35:32 | <wmacmil> | so once you've added them, how to do you tell cabal to update |
| 16:36:05 | <wmacmil> | just cabal update? |
| 16:36:08 | <sclv> | you just "cabal build" again or "cabal repl" or whatever |
| 16:36:13 | <sclv> | and it picks it up from the changed file |
| 16:36:30 | <sclv> | `cabal update` just tells cabal to fetch the new package index from hackage if any new packages have been uploaded, etc |
| 16:37:01 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 16:37:07 | → | lbseale joins (~ep1ctetus@user/ep1ctetus) |
| 16:39:18 | <fendor[m]> | is "sort" an overloaded (ad-hoc polymorphic) function because it depends on Ord or is it a parametric polymorphic function since it basically has only one function-body? |
| 16:39:18 | × | cdeln quits (~cdeln@m83-185-94-137.cust.tele2.se) (Read error: Connection reset by peer) |
| 16:39:26 | → | cdeln joins (~cdeln@m83-185-94-137.cust.tele2.se) |
| 16:42:17 | × | Akiva quits (~Akiva@user/Akiva) (Ping timeout: 240 seconds) |
| 16:42:45 | → | notzmv joins (~zmv@user/notzmv) |
| 16:43:03 | → | ph88 joins (~ph88@2a02:8109:9e00:71d0::7e04) |
| 16:43:47 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 16:44:00 | <jchia[m]> | I want to do "[x] <- .." in a do block without requiring a MonadFail instance. I want the program to just error/crash if the pattern match fails. Is there a ergonomic way to do this? Currently, GHC complains "Could not deduce (MonadFail m) arising from a do statement with the failable pattern...". |
| 16:45:34 | <EvanR> | fendor[m], it's "constrained polymorphism", the Ord support is magically passed as another argument at runtime |
| 16:45:42 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 16:46:05 | <EvanR> | so it's a subset of parametric |
| 16:46:34 | → | cosimone` joins (~user@93-44-186-159.ip98.fastwebnet.it) |
| 16:46:52 | <geekosaur> | jchia[m], MonadFail is what adds the code that enables it to crash at runtime, so no |
| 16:47:29 | <jchia[m]> | geekosaur: But I can use error in a monad without MonadFail, correct? |
| 16:49:04 | <sclv> | I'd say looking up the dictionary is ad-hoc polymorphism, and sorting relative to the dictionary is parametric polymorphism |
| 16:49:16 | <geekosaur> | you can, manually (and presuming you make sure an asynchronous exception is the right thing to do; for example, in IO it makes much more sense to throwIO). ghc won't |
| 16:49:22 | × | cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Ping timeout: 250 seconds) |
| 16:49:32 | <geekosaur> | it demands MonadFail and there is no way to turn this off |
| 16:49:42 | <jchia[m]> | I'm allowed to do "xs <- ...; let [x] = xs", it's just more long winded |
| 16:49:45 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 16:50:08 | <sclv> | x <- head <$> .. |
| 16:50:25 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:50:40 | × | nschoe quits (~quassel@178.251.84.79) (Ping timeout: 250 seconds) |
| 16:50:44 | <jchia[m]> | so i'm hoping to find a more direct way. the pattern should not fail unless i have a bug |
| 16:50:51 | <sclv> | right, so use head |
| 16:51:20 | <jchia[m]> | thanks, that works |
| 16:51:34 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 16:52:28 | <geekosaur> | it's not quite identical since head will silently throw away the rest of a 2-item or more list, whereas your original demands an exactly 1 item list |
| 16:53:15 | <fendor[m]> | EvanR: Thanks! |
| 16:53:17 | <EvanR> | [x] <- looks better because you are daring the program to challenge your certitude that the result is a singleton |
| 16:54:06 | <EvanR> | exercised truth is more true than assumed truth |
| 16:54:10 | <EvanR> | or something |
| 16:54:25 | <maerwald> | https://hackage.haskell.org/package/ghc-9.2.1/docs/GHC-Utils-Misc.html#v:only |
| 16:54:47 | <maerwald> | eh, `singleton` rather |
| 16:54:59 | → | alx741 joins (~alx741@157.100.93.160) |
| 16:55:39 | × | cdeln quits (~cdeln@m83-185-94-137.cust.tele2.se) (Read error: Connection reset by peer) |
| 16:57:50 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 16:57:50 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 16:57:50 | → | wroathe joins (~wroathe@user/wroathe) |
| 16:58:08 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 16:58:08 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 16:58:42 | → | vicfred joins (~vicfred@user/vicfred) |
| 16:59:05 | → | jackson99 joins (~bc8147f2@cerf.good1.com) |
| 17:00:46 | <jchia[m]> | [x] <- looks better, but GHC doesn't allow me to use it. What's the rational for GHC requiring MonadFail considering that error could be used regardless of MonadFail? |
| 17:01:42 | <maerwald> | error sucks |
| 17:01:55 | × | Rum quits (~bourbon@user/rum) (Quit: WeeChat 3.4) |
| 17:02:21 | <jchia[m]> | How so? |
| 17:02:25 | → | mikoto-chan joins (~mikoto-ch@194.157.16.89) |
| 17:02:34 | <maerwald> | eh, because it can escape your exception handler due to laziness |
| 17:02:47 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 17:02:52 | <geekosaur> | that was a large part of what I meant by the conmment about throwIO |
| 17:03:00 | × | slack1256 quits (~slack1256@191.125.99.72) (Read error: Connection reset by peer) |
| 17:03:04 | <geekosaur> | error *will* bite your ass at some point |
| 17:03:06 | → | slac97765 joins (~slack1256@191.126.99.72) |
| 17:03:19 | <jchia[m]> | I just want my program to crash if there is a bug |
| 17:03:29 | <EvanR> | error "foo" is a thunk that if evaluated, crashes |
| 17:03:41 | <EvanR> | length [1, 2, error "foo", 3] |
| 17:03:46 | <EvanR> | > length [1, 2, error "foo", 3] |
| 17:03:48 | <lambdabot> | 4 |
| 17:03:57 | <EvanR> | to crash IO, use throwIO |
| 17:04:06 | <jackson99> | > sum [1, 2, error "foo", 3] |
| 17:04:15 | <jackson99> | > sum [1, 2, error "foo", 3] |
| 17:04:16 | <lambdabot> | *Exception: foo |
| 17:04:30 | <jchia[m]> | I suppose one has to be mindful of evaluation when using it. |
| 17:04:44 | <geekosaur> | yes |
| 17:04:49 | <geekosaur> | which is why ghc doesn't |
| 17:05:04 | <maerwald> | if you use error, then you will have to `evaluate . force $ pureComputation` if you wanna catch it |
| 17:05:04 | <geekosaur> | it can't know whether you will force evaluation of it |
| 17:05:10 | <jackson99> | even better to not use it in the first place. use Maybe/Either/Something similar in non-IO functions, and throw in IO functions |
| 17:05:27 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 17:05:27 | <EvanR> | also catching error is... not proper etiquette |
| 17:05:37 | × | merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 17:05:48 | × | MajorBiscuit quits (~MajorBisc@wlan-145-94-216-150.wlan.tudelft.nl) (Quit: WeeChat 3.3) |
| 17:05:50 | × | kaph quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Ping timeout: 250 seconds) |
| 17:06:36 | × | lbseale quits (~ep1ctetus@user/ep1ctetus) (Quit: Leaving) |
| 17:07:08 | <EvanR> | you can also throw exceptions from pure code |
| 17:07:12 | <EvanR> | :t throw |
| 17:07:13 | <lambdabot> | Exception e => e -> a |
| 17:07:25 | <EvanR> | but it has the same "gotchas" as error |
| 17:07:55 | <maerwald> | @hoogle MonadThrow |
| 17:07:55 | <lambdabot> | Control.Monad.Catch class Monad m => MonadThrow m |
| 17:07:55 | <lambdabot> | Conduit class Monad m => MonadThrow (m :: Type -> Type) |
| 17:07:55 | <lambdabot> | Control.Monad.Trans.Resource class Monad m => MonadThrow (m :: Type -> Type) |
| 17:08:16 | → | lbseale joins (~ep1ctetus@user/ep1ctetus) |
| 17:08:28 | <EvanR> | use MonadThrow to throw exceptions from a monad |
| 17:08:49 | <maerwald> | it's neat, because you can decide whether you wanna turn it into Maybe or cause a real exception in IO |
| 17:08:56 | <jchia[m]> | > error "foo" :: Either Bool Bool |
| 17:08:58 | <lambdabot> | *Exception: foo |
| 17:09:01 | × | lbseale quits (~ep1ctetus@user/ep1ctetus) (Client Quit) |
| 17:09:12 | <EvanR> | > Left "foo" |
| 17:09:13 | <jchia[m]> | [error "foo" :: Either Bool Bool] |
| 17:09:14 | <lambdabot> | Left "foo" |
| 17:09:29 | <jchia[m]> | * length [error "foo" |
| 17:09:34 | <EvanR> | > throwError "foo" :: Either String Int |
| 17:09:36 | <lambdabot> | Left "foo" |
| 17:09:56 | × | DNH quits (~DNH@2a02:8108:1100:16d8:b0c0:5871:210d:15db) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 17:10:19 | <jackson99> | I like MonadThrow too. caller can pick between Maybe, Either, List or IO exception |
| 17:10:45 | <maerwald> | right... because having functions returning Maybe all the time is annoying when you're in IO and don't really care about it |
| 17:12:43 | → | DNH joins (~DNH@2a02:8108:1100:16d8:b0c0:5871:210d:15db) |
| 17:13:10 | <maerwald> | https://hackage.haskell.org/package/relude-1.0.0.1/docs/Relude-List.html |
| 17:13:16 | <maerwald> | not a fan of that api |
| 17:13:28 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 17:13:56 | × | aeka quits (~aeka@user/hiruji) (Ping timeout: 252 seconds) |
| 17:14:28 | <EvanR> | !!? returns a Maybe. So then you can safely use the maybe with safeFromJust :: Maybe a -> Maybe a xD |
| 17:14:31 | × | epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity) |
| 17:14:47 | <jchia[m]> | My programs are command-line apps that don't try to recover from errors, including errors due to bad input data and bad config, and just crashes. Is it good to just throw a UserError from IO when bad input is detected? (The pure parts will just signal failure using Either, Maybe or similar things and when the results reaches the IO part, UserError is thrown.) Is there a better way? |
| 17:15:15 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Ping timeout: 256 seconds) |
| 17:15:15 | <maerwald> | 'fail' throws a UserError in IO afair |
| 17:15:30 | × | mastarija quits (~mastarija@2a05:4f46:e0e:5000:81fe:1ebc:de4c:76ed) (Quit: Leaving) |
| 17:15:40 | <EvanR> | % fail "yahoo" :: IO a |
| 17:15:40 | <yahb> | EvanR: *** Exception: user error (yahoo) |
| 17:15:48 | × | opticblast quits (~june@secure-165.caltech.edu) (Ping timeout: 250 seconds) |
| 17:16:07 | <EvanR> | jchia[m], "let it crash" xD |
| 17:16:07 | <geekosaur> | but uses thrwIO so it won't get lost |
| 17:16:37 | → | alx741 joins (~alx741@157.100.93.160) |
| 17:16:44 | → | lavaman joins (~lavaman@98.38.249.169) |
| 17:17:01 | <maerwald> | dunno... I think there's no programming language that has figured out how to do error handling correctly |
| 17:17:18 | <maerwald> | Haskell is certainly not in the top 5 |
| 17:17:20 | × | CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
| 17:18:27 | → | kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it) |
| 17:18:35 | geekosaur | is not sure there is a "correctly" for all cases |
| 17:19:04 | <EvanR> | I appreciate how async spawns a thread which can return an answer or an error. And you can choose to have the answer and rethrow, or not. I don't know what the difference is between that and normal exception handling but it feels better |
| 17:19:20 | <jchia[m]> | What to do for assert? E.g. upon detecting an 'impossible' situation that can happen only because of a bug, what should be done if I want to crash? Exceptions can be caught but I don't want this the assert to make a catchable exception. |
| 17:19:35 | <monochrom> | I think a lot of languages have figured out, but people don't use the solutions. |
| 17:19:37 | <EvanR> | > assert (4 == 5) -- lights |
| 17:19:39 | <lambdabot> | error: |
| 17:19:39 | <lambdabot> | • No instance for (Typeable a0) |
| 17:19:39 | <lambdabot> | arising from a use of ‘show_M73303100616269230597’ |
| 17:20:01 | <EvanR> | :t assert |
| 17:20:03 | <lambdabot> | Bool -> a -> a |
| 17:20:25 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 17:20:42 | <jchia[m]> | In C++, I just use assert(). In Haskell, I sometime throw a UserError but I'm not sure what to do in a pure function. |
| 17:20:44 | <EvanR> | > assert (4==5) "There are _ lights" |
| 17:20:45 | <lambdabot> | "*Exception: Assertion failed |
| 17:20:45 | <lambdabot> | CallStack (from HasCallStack): |
| 17:20:45 | <lambdabot> | assert, called at <interactive>:3:1 in interactive:Ghci1 |
| 17:21:22 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 17:21:27 | <EvanR> | it can be inserted anywhere |
| 17:21:35 | <monochrom> | assert is in Control.Exception |
| 17:21:37 | <EvanR> | but then it crashes upon evaluation, when is who knows when |
| 17:21:42 | <EvanR> | which is* |
| 17:22:03 | <EvanR> | I guess a failed assertion at the end of time has no bearing on reality! |
| 17:22:04 | <jchia[m]> | "correct" for me means unconditionally crashes and prints an error message that I specify |
| 17:22:25 | <monochrom> | Yeah take lazy evaluation into account. "const 10 (assert (4==5))" no error. |
| 17:22:28 | <EvanR> | but flies in the face of usual advice to fail as early as possible |
| 17:22:30 | <jchia[m]> | s/unconditionally/uncatchably/ |
| 17:22:43 | <EvanR> | it's a conflict with laziness |
| 17:22:54 | <monochrom> | Then again, even in C, "1 ? 10 : assert(4==5)" is no error either. |
| 17:23:11 | <EvanR> | similar to how in stream processing, you might fail 9 miles down the stream, which sucks for whatever effects already happened |
| 17:23:33 | <jackson99> | aren't asserts ignored in C and C++ unless you compile with debug flag? |
| 17:23:39 | <EvanR> | transactions to the rescue |
| 17:23:50 | <jchia[m]> | I'm not clear how/whether the assert works when the expression is not evaluated |
| 17:23:59 | <EvanR> | it doesn't work |
| 17:24:00 | <jchia[m]> | because of laziness |
| 17:24:26 | → | lbseale joins (~ep1ctetus@user/ep1ctetus) |
| 17:24:53 | <monochrom> | At some point I don't think lazy evaluation is as special as it sounds. |
| 17:25:19 | <monochrom> | In C, if your "assert(4==5)" is not evaluated, then there is no crash. |
| 17:25:41 | <monochrom> | The only difference from Haskell is that C evaluates more things than Haskell does. |
| 17:25:53 | <maerwald> | does the C standard define an evaluation strategy? |
| 17:25:55 | <monochrom> | But the rule "if unevaluated then no crash" is true of all languages. |
| 17:26:05 | <EvanR> | sequence points right |
| 17:26:24 | <monochrom> | Yes, enough for predicting assert crashes. |
| 17:26:37 | <jackson99> | monochrom, good point. if (True || myfunction()) assert in myfunction won't crash the program |
| 17:26:54 | × | lbseale quits (~ep1ctetus@user/ep1ctetus) (Client Quit) |
| 17:26:55 | <monochrom> | Hell, it has to be enough for predicting debugging printfs in the first place. |
| 17:27:14 | <EvanR> | assert seems like a different kind of cultural tool from validation |
| 17:27:45 | <EvanR> | implicitly tossing a test somewhere, vs explicitly checking and explicitly failing at an explicit step |
| 17:28:12 | <monochrom> | Right, you expect production code to be -O2 and omits the asserts after compilation. |
| 17:28:34 | <monochrom> | It's strictly for internal testing phases. |
| 17:28:46 | <monochrom> | engineering sample |
| 17:28:53 | <maerwald> | production code is external testing phase |
| 17:28:56 | × | DNH quits (~DNH@2a02:8108:1100:16d8:b0c0:5871:210d:15db) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 17:29:00 | <maerwald> | so keep the asserts... |
| 17:30:01 | <monochrom> | Well yeah you can do what you want. I'm describing what the inventors of assert did. |
| 17:30:27 | <EvanR> | your manager may complain about leaving the asserts in xD |
| 17:30:32 | <monochrom> | Therefore what it was probably optimized for. |
| 17:30:37 | <EvanR> | it causes the program to crash more |
| 17:32:15 | <EvanR> | "if the client doesn't know about the garbage out, it's not a bug after all?" |
| 17:32:18 | <maerwald> | reminds me of a property test that failed every other month and no one understood why... it freaked out the coders, but the managers suggested to remove it, becauce it wasted so much time ppl investigating and not finding the cause |
| 17:33:01 | <maerwald> | "close enough" is sometimes ok |
| 17:33:10 | <Rembane> | I like that |
| 17:33:34 | → | merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) |
| 17:34:02 | <maerwald> | just mark the test as "flaky"... done |
| 17:34:08 | <monochrom> | Ugh, from the perfectionist who thinks no language has done error handling correctly? |
| 17:35:16 | <maerwald> | I don't think the manager was a perfectionist |
| 17:35:18 | <maerwald> | xD |
| 17:35:29 | → | aeka joins (~aeka@user/hiruji) |
| 17:37:35 | → | alMalsamo joins (~alMalsamo@gateway/tor-sasl/almalsamo) |
| 17:38:29 | × | merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 17:39:08 | → | alx741 joins (~alx741@157.100.93.160) |
| 17:43:14 | → | vglfr joins (~vglfr@46.96.174.100) |
| 17:43:36 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 17:45:35 | × | ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection) |
| 17:45:54 | → | ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) |
| 17:48:53 | × | Jing quits (~hedgehog@240e:390:7c53:a7e1:87f:3f13:7a62:d6c7) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 17:50:13 | × | ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Ping timeout: 256 seconds) |
| 17:50:42 | × | Guest1824 quits (~Guest18@2a02:8388:6bc1:1d00:6d47:dee9:5eda:9fbe) (Quit: Client closed) |
| 17:52:38 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 250 seconds) |
| 17:53:13 | × | ouestbillie quits (~gallup@192-222-138-215.qc.cable.ebox.net) (Ping timeout: 256 seconds) |
| 17:53:15 | → | SnowNeo joins (~SnowNeo@49.36.127.54) |
| 17:53:16 | <SnowNeo> | sup guys |
| 17:53:21 | <SnowNeo> | sup guys |
| 17:53:32 | <SnowNeo> | jackdk sir do you ever take a break |
| 18:00:04 | → | alx741 joins (~alx741@157.100.93.160) |
| 18:01:21 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 18:03:39 | × | SnowNeo quits (~SnowNeo@49.36.127.54) (Quit: Client closed) |
| 18:04:45 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 18:05:21 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 18:06:55 | → | ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) |
| 18:13:11 | → | Akiva joins (~Akiva@user/Akiva) |
| 18:19:17 | → | merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) |
| 18:19:17 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
| 18:20:18 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 18:22:36 | → | alx741 joins (~alx741@157.100.93.160) |
| 18:23:07 | → | fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
| 18:24:05 | → | zachjs joins (~zachjs@148-59-188-143.3rivers.net) |
| 18:24:12 | <dsal> | jackdk is a bot |
| 18:24:39 | dsal | isn't used to people with short-term connections |
| 18:24:42 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 250 seconds) |
| 18:25:28 | <EvanR> | that little timer showing how long you've been dialed in |
| 18:25:51 | <EvanR> | at ten cents a minute |
| 18:26:02 | × | jackson99 quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC) |
| 18:26:17 | → | jackson99 joins (~bc8147f2@cerf.good1.com) |
| 18:26:23 | <monochrom> | Haha nice, AOL and CompuServe |
| 18:26:23 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 18:26:50 | <monochrom> | "AOL keyword: Haskell" |
| 18:28:29 | <geekosaur> | delphi was my poison back then |
| 18:28:58 | <int-e> | AOL's coaster design never convinced me |
| 18:28:58 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 18:29:10 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 18:29:20 | <int-e> | (too smooth, too brittle, and wtf is that hole in the middle?) |
| 18:29:33 | <monochrom> | Oh haha that. |
| 18:29:38 | <EvanR> | I thought they were frisbees |
| 18:29:56 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 18:30:14 | <monochrom> | But have you heard of the complement joke: Someone was impressed that a multimedia PC came with a cup holder? >:) |
| 18:30:15 | → | kmein joins (~weechat@user/kmein) |
| 18:30:32 | <int-e> | I have |
| 18:30:58 | <int-e> | It was more dramatic as a support call: "My cup holder broke!" |
| 18:31:17 | <monochrom> | Ah yeah I forgot the tech support context. |
| 18:31:51 | × | cosimone` quits (~user@93-44-186-159.ip98.fastwebnet.it) (Remote host closed the connection) |
| 18:32:36 | → | cosimone joins (~user@93-44-186-159.ip98.fastwebnet.it) |
| 18:33:48 | → | zincy joins (~zincy@2a00:23c8:970c:4801:911c:c4ab:2f7e:d3f1) |
| 18:37:08 | → | opticblast joins (~june@secure-165.caltech.edu) |
| 18:38:11 | justIrresolute | is now known as justJustache |
| 18:38:28 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 18:39:26 | × | Akiva quits (~Akiva@user/Akiva) (Ping timeout: 250 seconds) |
| 18:39:46 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 18:40:47 | → | DNH joins (~DNH@2a02:8108:1100:16d8:b0c0:5871:210d:15db) |
| 18:40:55 | → | wre^ joins (~wre@wsip-98-188-242-61.mc.at.cox.net) |
| 18:42:29 | × | fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Quit: Leaving) |
| 18:42:38 | → | alx741 joins (~alx741@157.100.93.160) |
| 18:44:09 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 18:46:21 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 18:46:40 | × | mbuf quits (~Shakthi@122.174.202.253) (Quit: Leaving) |
| 18:48:16 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 18:51:25 | × | merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 18:54:46 | × | vicfred quits (~vicfred@user/vicfred) (Quit: Leaving) |
| 18:57:50 | → | jgeerds joins (~jgeerds@55d4bbed.access.ecotel.net) |
| 19:00:05 | × | vysn quits (~vysn@user/vysn) (Ping timeout: 252 seconds) |
| 19:01:06 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 19:01:46 | → | whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com) |
| 19:02:11 | × | zachjs quits (~zachjs@148-59-188-143.3rivers.net) (Quit: zachjs) |
| 19:04:15 | → | alx741 joins (~alx741@157.100.93.160) |
| 19:08:25 | × | yauhsien quits (~yauhsien@61-231-29-214.dynamic-ip.hinet.net) (Ping timeout: 256 seconds) |
| 19:09:06 | → | yauhsien joins (~yauhsien@61-231-24-192.dynamic-ip.hinet.net) |
| 19:10:22 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 19:11:12 | <Inst> | maerwald: win10 |
| 19:11:16 | <Inst> | re cabal |
| 19:14:16 | → | Topsi joins (~Tobias@dyndsl-095-033-018-101.ewe-ip-backbone.de) |
| 19:18:50 | <maerwald> | Inst: can you reproduce that? |
| 19:19:01 | <Inst> | bleh, i probably nuked my system |
| 19:19:05 | <Inst> | ghcup nuke doesn't even work |
| 19:19:14 | <maerwald> | what? |
| 19:19:27 | <Inst> | time to delete everything related to ghcup on my system! |
| 19:19:41 | <maerwald> | ok |
| 19:20:07 | <tomsmeding> | TIL 'ghcup nuke' |
| 19:20:16 | <tomsmeding> | I guess it's a useful thing to have |
| 19:20:43 | <maerwald> | Inst: are you saying ghcup nuked your system or you did? |
| 19:20:56 | <Inst> | going to nuke it |
| 19:21:00 | <Inst> | i'm going to nuek it |
| 19:21:10 | <maerwald> | ok, I guess I won't get useful information here |
| 19:21:14 | <tomsmeding> | :) |
| 19:21:18 | <Inst> | sorry |
| 19:21:57 | <monochrom> | "Waiting 10 seconds before commencing, if you want to cancel it, now would be the time." saved me |
| 19:21:58 | <maerwald> | windows is a shit-show of file-locking... so "ghcup nuke" indeed doesn't work if there's a process still locking files |
| 19:22:08 | <tomsmeding> | RT monochrom |
| 19:22:30 | <maerwald> | all you can do is retry file deletion and hope that process died |
| 19:22:44 | <maerwald> | don't blame us :) |
| 19:22:44 | <tomsmeding> | perhaps it would be an idea to have that ask for a 'y' or something |
| 19:22:54 | <maerwald> | tomsmeding: no... ghcup is non-interactive |
| 19:23:01 | <tomsmeding> | right |
| 19:23:06 | <monochrom> | Nah I'm OK with the current way. |
| 19:23:14 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 19:23:15 | <Inst> | you'll humor me if i say something stupid, right? just this once? |
| 19:23:16 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 19:23:18 | <tomsmeding> | well, except 'ghcup tui', but then you're asking for it |
| 19:23:26 | <maerwald> | tomsmeding: correct |
| 19:23:35 | <maerwald> | there could be a nuke option |
| 19:23:41 | → | ouestbillie joins (~gallup@142.169.82.16) |
| 19:24:08 | <monochrom> | My story is that I disbelieved that "nuke" existed so I entered "ghcup nuke" expecting "invalid argument". |
| 19:24:14 | <maerwald> | lol |
| 19:24:28 | <Inst> | does it really matter? |
| 19:24:37 | <Inst> | i'm used to manually nuking and reinstalling GHCup every few weeks |
| 19:24:42 | <tomsmeding> | same as monochrom here lol |
| 19:24:43 | <maerwald> | I don't believe --no-preserve-root exists ;> |
| 19:25:19 | <maerwald> | Inst: why do you do that? |
| 19:25:41 | → | merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) |
| 19:25:56 | → | ub joins (~Thunderbi@141.98.252.232) |
| 19:26:01 | <Inst> | to get cabal working / fixing random bugs |
| 19:26:30 | <geekosaur> | o.O |
| 19:26:34 | <tomsmeding> | the creator of ghcup happens to be here in this channel, so if you want to report bugs, this is your chance :p |
| 19:26:41 | <maerwald> | yeah... that's why I'm saying. We don't get many bug reports from windows users. It seems they just reinstall and try again |
| 19:26:51 | <Inst> | i hope Haskell Foundation gets enough money |
| 19:27:02 | <Inst> | they're absolutely right that tooling needs fixing |
| 19:27:05 | <maerwald> | :D |
| 19:27:25 | → | danso joins (~danso@danso.ca) |
| 19:27:33 | <maerwald> | well, they requested windows support in ghcup... I haven't seen a single dollar for it though :p |
| 19:27:42 | <Inst> | guessing, with 50% admin expenses, they can hire 200-350k worth of programming work |
| 19:27:46 | <maerwald> | (not that I asked) |
| 19:27:46 | → | aliosablack joins (~chomwitt@athedsl-15695.home.otenet.gr) |
| 19:27:47 | <Inst> | you're the creator of GHCup, aren't you? |
| 19:27:57 | <monochrom> | Here be a great irony comparing Linux people and Windows people. |
| 19:28:07 | ← | danso parts (~danso@danso.ca) (WeeChat 3.3) |
| 19:28:17 | × | chomwitt quits (~chomwitt@2a02:587:dc11:fb00:12c3:7bff:fe6d:d374) (Ping timeout: 240 seconds) |
| 19:28:17 | → | danso joins (~danso@danso.ca) |
| 19:28:18 | <maerwald> | Inst: https://www.haskell.org/ghcup/about/#team |
| 19:28:40 | <monochrom> | Linux people whine and cry bug reports upon the slightest pretext, so most bugs aren't reproducible. |
| 19:28:41 | <Inst> | Hello, Mr. Ospald. |
| 19:28:44 | ← | danso parts (~danso@danso.ca) (WeeChat 3.3) |
| 19:28:45 | <Inst> | It's an honor to meet you. |
| 19:28:48 | → | danso joins (~danso@danso.ca) |
| 19:28:49 | → | alx741 joins (~alx741@157.100.93.160) |
| 19:28:54 | ← | danso parts (~danso@danso.ca) (WeeChat 3.3) |
| 19:28:57 | <maerwald> | allrighty |
| 19:29:12 | <monochrom> | Windows people can reproduce the bug 10 times, in fact they will go on to repeat and reproduce for 100 more times. Just that they will never talk about it. |
| 19:29:51 | <maerwald> | interestingly... windows devs/admins are *extremely* helpful |
| 19:30:08 | <maerwald> | I probably asked 200 questions in #powershell and always got an answer |
| 19:30:13 | <Inst> | windows users just reimage their system |
| 19:30:29 | <xerox> | also the first time they ever had a decent terminal |
| 19:30:34 | × | merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 250 seconds) |
| 19:30:39 | <monochrom> | Yeah I just mean the users. |
| 19:31:43 | <maerwald> | Inst: anyway... if you have bug reports with useful information, go here https://gitlab.haskell.org/haskell/ghcup-hs/-/issues |
| 19:31:51 | <Inst> | thanks |
| 19:32:04 | <Inst> | have a root canal in 90 minutes! |
| 19:32:33 | geekosaur | sends novocaine |
| 19:32:36 | <Inst> | still less painful than cabal |
| 19:32:44 | <maerwald> | will there be a twitch stream? |
| 19:33:05 | <monochrom> | "viewer discretion is advised" |
| 19:33:06 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 19:34:06 | <Inst> | i'm pissed off, i get monads somewhat |
| 19:34:21 | <maerwald> | but yeah... I think WSL2 experience is better on windows (and ghcup/ghc/etc. work there) |
| 19:34:32 | <Inst> | like, there's 23928 bad tutorials on monads and 3-5 ones that actually work |
| 19:34:53 | <monochrom> | s/bad tutorials/blogs/ |
| 19:34:57 | <sm> | Inst: lol |
| 19:35:01 | <sm> | sorry, good luck |
| 19:35:09 | <Inst> | but i'm more interested in the Haskell type system, or at least, the full possibilities of what data declarations can do |
| 19:35:14 | <geekosaur> | monad tutorials are a (bad) joke in the haskell community |
| 19:35:14 | <monochrom> | This is why you should just stay away from blogs. |
| 19:35:24 | <Inst> | this is why monad obsessions are bad |
| 19:35:31 | <Inst> | Haskell type system -> more interesting than monads |
| 19:35:45 | <Inst> | i'd kill if all the 23928 bad tutorials on monads were instead bad tutorials on the Haskell type system |
| 19:35:47 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Ping timeout: 256 seconds) |
| 19:35:54 | <Inst> | you get the type system, monads come automatically |
| 19:36:06 | <monochrom> | Bloggers write blogs for self gratification. Very obvious anti-thesis to teaching and learning. |
| 19:36:11 | <geekosaur> | except we had the same type system backj before monads |
| 19:36:18 | <Inst> | FYI: I get the FAM typeclasses, maybe, [], IO monad, either to an extent, but not state |
| 19:36:20 | <maerwald> | Tutorials on type level programming are probably worse than monad tutorials. There's a good book on it though |
| 19:36:26 | × | ub quits (~Thunderbi@141.98.252.232) (Quit: ub) |
| 19:36:27 | <geekosaur> | back in the [Response] -> [Request] days |
| 19:36:32 | <monochrom> | Moreoever, most people write on the haskell wiki as if it's a blog, too. |
| 19:36:35 | <sm> | @remember Inst have a root canal in 90 minutes! still less painful than cabal |
| 19:36:35 | <lambdabot> | I will never forget. |
| 19:36:45 | <maerwald> | Inst: https://leanpub.com/thinking-with-types |
| 19:36:49 | <Inst> | saw that |
| 19:37:13 | <Inst> | the stupid thing i wanted to say is that i'm fantasizing about having a completely ass-backwards Haskell course |
| 19:37:32 | <Inst> | as in, in the previous version, IO was lesson 3, including reading and writing files |
| 19:37:38 | <Inst> | monads were introed in lesson 2 |
| 19:37:46 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 19:37:49 | <monochrom> | You can find blogs on type systems from for example the Java and Scala communities. |
| 19:38:30 | <Inst> | maerwald: I just want to know what I can and can't do with a data declaration, exactly what a type and data constructor is (beyond the capital letters to the left and right respectively of the = in a data declaration) |
| 19:38:48 | → | econo joins (uid147250@user/econo) |
| 19:38:49 | <Inst> | then again, I'm probably screwed in lesson 1, wherein I don't have a clear and definite idea of what functional programming is |
| 19:38:55 | <EvanR> | make sure you don't make an ass-backwards infinite haskell course, or you can't even get started |
| 19:39:03 | <monochrom> | haha |
| 19:39:11 | × | ouestbillie quits (~gallup@142.169.82.16) (Ping timeout: 256 seconds) |
| 19:39:34 | <maerwald> | if you want to learn nothing, but know a lot about random things, check out http://dev.stephendiehl.com/hask/ |
| 19:39:49 | <Inst> | that's sort of my learning style |
| 19:40:34 | <sm> | Inst: there are docs which cover that sort of thing, you may not have found the write one |
| 19:40:48 | <monochrom> | I should write a category theory "tutorial" (so, blog post) called "what I wish I knew when learning math". |
| 19:40:54 | <sm> | oops, that was not a subliminal suggestion. The right one. |
| 19:40:54 | <Inst> | 4th attempt on Haskell Report 2010 |
| 19:40:57 | <Inst> | will make 20-50 |
| 19:41:13 | <sm> | have you tried graham hutton ? (book or youtube course) |
| 19:41:23 | <sm> | or the haskell wiki ? |
| 19:41:29 | <maerwald> | also, if you want a lot of random links without knowing which one to pick, there's https://www.haskell.org/documentation/ |
| 19:41:30 | <yushyin> | haskell report and ghc user guide cover most things what 'data ...' can do |
| 19:42:16 | <ephemient> | {-# LANGUAGE EmptyDataDecls #-} and {-# LANGUAGE GADTs #-} aren't in the report, but are in the GHC docs |
| 19:42:18 | <Inst> | i have the hutton book |
| 19:42:30 | sm | meant haskell wikibook, not haskell wiki. Not the same thing |
| 19:42:56 | <maerwald> | haskell wiki is that thing from 2005, right? :) |
| 19:43:16 | <monochrom> | It's been so long, I forgot the year. |
| 19:43:43 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Ping timeout: 256 seconds) |
| 19:43:56 | <Inst> | also, is there a relationship between the concepts immutable and ephemeral? |
| 19:44:17 | × | cstml quits (~cstml@user/cstml) (Ping timeout: 256 seconds) |
| 19:46:26 | <Inst> | that's probably too many dumb things to say for one day, i'm wondering how, at some point, I can learn / teach GUI with Haskell |
| 19:46:46 | <sm> | not one that we think about much, Inst. |
| 19:47:35 | <Inst> | immutability means that if you try to implement objects, you either can't actually change them (immutability) or they stop existing the moment they're no longer referenced (ephemerality) |
| 19:48:31 | × | jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Ping timeout: 250 seconds) |
| 19:48:56 | <sm> | there's a recent reddit thread listing GUI libs, did you see it ? https://code.world/haskell or Gloss are the easiest ways to start with GUI |
| 19:49:12 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 19:49:24 | → | Hildegunst joins (~luc@80.248.12.109.rev.sfr.net) |
| 19:50:16 | <Inst> | i get directed to code.world repeatedly |
| 19:50:42 | → | ouestbillie joins (~gallup@142.169.82.16) |
| 19:50:56 | × | Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Quit: leaving) |
| 19:51:21 | → | alx741 joins (~alx741@157.100.93.160) |
| 19:52:02 | → | Hildegunst joins (~luc@80.248.12.109.rev.sfr.net) |
| 19:52:08 | <Inst> | is code.wordl FRP? |
| 19:52:25 | <EvanR> | I think immutability means you can't change them |
| 19:52:50 | × | Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Client Quit) |
| 19:53:14 | <EvanR> | GUI with haskell seems to be reactive banana + wxwidgets, or three-penny-gui for a long time |
| 19:53:45 | <maerwald> | if you delete an object, is it really immutable? |
| 19:54:15 | <Inst> | you mean this? |
| 19:54:16 | <Inst> | https://wiki.haskell.org/WxHaskell |
| 19:54:20 | <EvanR> | yeah |
| 19:54:26 | <Inst> | supposedly no longer being supported |
| 19:54:31 | <EvanR> | unsurprised |
| 19:55:24 | <geekosaur> | got desupported when wxwidgets was changing too quickly for the haskell bindings to keep up. if it got picked up again now things might go better |
| 19:55:26 | → | Hildegunst joins (~luc@80.248.12.109.rev.sfr.net) |
| 19:55:37 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Ping timeout: 256 seconds) |
| 19:55:56 | <maerwald> | no one's doing gui anymore... it's either web or tui |
| 19:56:01 | <maerwald> | and I think I'm ok with it |
| 19:56:17 | <EvanR> | or how ever you do a GUI in a video game |
| 19:56:23 | <EvanR> | other than text UI |
| 19:56:35 | <monochrom> | I still want gui instead of tui, but since I'm too lazy to do it, I am not complaining :) |
| 19:56:36 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 19:57:12 | <geekosaur> | pretty much all of my programming these days in any language is tui |
| 19:57:16 | <Inst> | text ui |
| 19:57:18 | <maerwald> | monochrom: well, I started a haskell filemanager in GTK+:3 long time ago, but never finished. Today I would write it in TUI |
| 19:57:23 | <geekosaur> | just how ancient geeks roll |
| 19:57:40 | <Inst> | i had a problem wherein a simple Haskell line reader / writer wouldn't accept chars |
| 19:57:42 | <maerwald> | TUI with mouse support |
| 19:57:45 | <Inst> | the reason I'm reinstalling cabal is because |
| 19:57:54 | <geekosaur> | doable |
| 19:57:58 | <monochrom> | And tui is still better than command line flags |
| 19:58:05 | <Inst> | apparently by default, at least on windows, you can't get a detect key |
| 19:58:14 | <Inst> | hmmm, damnit, ghcup is reinstalling |
| 19:58:37 | <maerwald> | why? |
| 19:58:52 | × | michalz quits (~michalz@185.246.204.104) (Remote host closed the connection) |
| 19:59:22 | <monochrom> | Hrm, FRP for TUI, now that's an idea... |
| 20:00:09 | <Inst> | detect keypress |
| 20:00:14 | <geekosaur> | thought someone had played with that |
| 20:00:32 | <Inst> | not in SystemIO, getChar with powershell GHCI wants a line, but only processes the first item |
| 20:00:46 | <Inst> | alternative: readLine, Haskeline, depending on comfort with monad transformers |
| 20:01:07 | → | merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) |
| 20:01:20 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 20:01:22 | <maerwald> | monochrom: already exists |
| 20:01:22 | <Inst> | readKey (iirc) returns IO Char |
| 20:01:41 | <Cale> | maerwald: I am sort of sad though that all the web view widgets decided to drop their API that lets you manipulate the DOM from outside without javascript |
| 20:01:47 | <maerwald> | https://hackage.haskell.org/package/reflex-vty |
| 20:02:08 | <monochrom> | Ah nice |
| 20:02:27 | <Cale> | maerwald: For a little while, we could use the DOM as a glorified drawing library and control the contents 100% with native Haskell, now it needs some kinda janky JS websocket hackery. |
| 20:02:43 | <monochrom> | Oh Obidian again. |
| 20:02:45 | <Cale> | Oh, if you're trying out reflex-vty, let me know how you get on with it |
| 20:03:10 | × | ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection) |
| 20:03:11 | × | mud quits (~mud@user/kadoban) (Quit: quit) |
| 20:03:30 | → | ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) |
| 20:03:57 | <Cale> | (Ali Abrar and I made it over the course of a few weekends spread out over a couple of years) |
| 20:03:59 | × | ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Remote host closed the connection) |
| 20:05:05 | × | juhp quits (~juhp@128.106.188.82) (Ping timeout: 256 seconds) |
| 20:06:01 | <tomsmeding> | Inst: trying to get a single key will probably fail in interesting ways in ghci, but that's probably due to the interaction with ghci more than anything else. Did you try to compile and run the executable? |
| 20:06:07 | <tomsmeding> | (or use 'runhaskell' |
| 20:06:08 | <tomsmeding> | ) |
| 20:06:48 | <geekosaur> | runhaskell behaves like ghci |
| 20:06:58 | <tomsmeding> | but not the repl part ;) |
| 20:07:10 | <tomsmeding> | which is what I think interacts with this |
| 20:07:18 | → | juhp joins (~juhp@128.106.188.82) |
| 20:07:55 | × | ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Ping timeout: 256 seconds) |
| 20:08:11 | → | dhil joins (~dhil@cpc103052-sgyl39-2-0-cust260.18-2.cable.virginm.net) |
| 20:10:18 | × | fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds) |
| 20:11:51 | <geekosaur> | and as for getting a single key vs. ghci, I think that actually works *better* in ghci because it's running in character at a time mode, on unix at least. compiled programs have to do an extra step to get character at a time |
| 20:12:03 | <geekosaur> | might have to do that same extra step on windows too |
| 20:12:20 | <geekosaur> | hSetBuffering stdout NoBuffering |
| 20:12:26 | <geekosaur> | (import System.IO for this) |
| 20:13:21 | <tomsmeding> | geekosaur: https://ircbrowse.tomsmeding.com/day/lchaskell/2022/01/14?id=375142#trid375142 |
| 20:13:25 | → | alx741 joins (~alx741@157.100.93.160) |
| 20:14:08 | → | ezzieyguywuf joins (~Unknown@user/ezzieyguywuf) |
| 20:14:16 | <tomsmeding> | presumably that didn't work for them, perhaps because they're working in ghci -- I have no clue what ghci does on windows, but given the dragons that come out sometimes with stack ghci vs stack exec ghci vs ghci vs ghc --interactive, I'm not hopeful |
| 20:14:30 | <tomsmeding> | vs ghci.sh |
| 20:16:24 | tomsmeding | was thinking about this https://github.com/commercialhaskell/stack/issues/4737 |
| 20:16:40 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 20:20:24 | → | lispy joins (~lispy4@84.69.59.93) |
| 20:21:50 | × | lispy quits (~lispy4@84.69.59.93) (Client Quit) |
| 20:22:26 | → | lispy joins (~lispy4@84.69.59.93) |
| 20:24:30 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 20:24:50 | → | spaceseller joins (~spacesell@31.147.205.13) |
| 20:26:13 | × | IndecisionTree quits (mike@user/IndecisionTree) (Ping timeout: 256 seconds) |
| 20:30:49 | → | mud joins (~mud@user/kadoban) |
| 20:32:58 | × | cheater quits (~Username@user/cheater) (Ping timeout: 250 seconds) |
| 20:34:46 | × | mud quits (~mud@user/kadoban) (Remote host closed the connection) |
| 20:34:49 | → | alx741 joins (~alx741@157.100.93.160) |
| 20:35:17 | × | merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 20:36:54 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 20:36:59 | × | wre^ quits (~wre@wsip-98-188-242-61.mc.at.cox.net) (Ping timeout: 256 seconds) |
| 20:38:33 | → | wre^ joins (~wre@wsip-98-188-242-61.mc.at.cox.net) |
| 20:39:33 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 276 seconds) |
| 20:40:32 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 20:41:24 | × | spaceseller quits (~spacesell@31.147.205.13) (Quit: Leaving) |
| 20:41:28 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 20:41:33 | <polyphem> | latest addition to haskell guis : https://github.com/fjvallarino/monomer |
| 20:41:48 | → | cheater joins (~Username@user/cheater) |
| 20:46:55 | <jackdk> | polyphem: cool, I like that it has an explicit statement of objectives/non-objectives as well as design decisions. We could do with more active development in the GUI space (I'm a backend guy, mostly) |
| 20:47:45 | × | Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Ping timeout: 256 seconds) |
| 20:47:50 | <polyphem> | jackdk: have never tried it though, but it looks reasonable and nice |
| 20:48:41 | → | ProfSimm joins (~ProfSimm@87.227.196.109) |
| 20:49:27 | → | Hildegunst joins (~luc@80.248.12.109.rev.sfr.net) |
| 20:50:02 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 20:54:09 | → | Codaraxis__ joins (~Codaraxis@user/codaraxis) |
| 20:55:17 | → | alx741 joins (~alx741@157.100.93.160) |
| 20:58:06 | × | Codaraxis_ quits (~Codaraxis@user/codaraxis) (Ping timeout: 250 seconds) |
| 20:58:29 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 20:58:29 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 20:58:29 | → | wroathe joins (~wroathe@user/wroathe) |
| 20:59:04 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 20:59:44 | <EvanR> | monomer, nice |
| 21:01:34 | × | burnsidesLlama quits (~burnsides@dhcp168-039.wadham.ox.ac.uk) (Remote host closed the connection) |
| 21:02:06 | → | burnsidesLlama joins (~burnsides@client-8-70.eduroam.oxuni.org.uk) |
| 21:02:22 | → | root____ joins (~root@185.234.208.208.r.toneticgroup.pl) |
| 21:02:24 | root____ | is now known as briandaed |
| 21:03:14 | × | ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
| 21:03:37 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 21:04:11 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Ping timeout: 256 seconds) |
| 21:05:07 | × | Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Quit: leaving) |
| 21:06:20 | × | burnsidesLlama quits (~burnsides@client-8-70.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds) |
| 21:06:25 | × | _ht quits (~quassel@2a02:a468:b619:1:b63a:bf2b:8ee:fbf2) (Remote host closed the connection) |
| 21:07:13 | → | bitmapper joins (uid464869@id-464869.lymington.irccloud.com) |
| 21:08:54 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 21:09:39 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 21:11:42 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 21:11:42 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 21:11:42 | → | wroathe joins (~wroathe@user/wroathe) |
| 21:15:19 | → | alx741 joins (~alx741@157.100.93.160) |
| 21:15:31 | → | spaceseller joins (~spacesell@31.147.205.13) |
| 21:16:29 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 21:18:19 | × | spaceseller quits (~spacesell@31.147.205.13) (Client Quit) |
| 21:18:42 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 21:22:22 | × | euandreh quits (~euandreh@2804:14c:33:9fe5:6113:2671:c33c:ef4a) (Ping timeout: 250 seconds) |
| 21:22:57 | → | kn07_ joins (~kn07_@86.121.166.134) |
| 21:25:29 | → | ProfSimm joins (~ProfSimm@87.227.196.109) |
| 21:25:58 | <oak-> | Isn't Qt quite well supported in Haskell? Or at least it was couple of years ago |
| 21:28:05 | → | Constraintegic joins (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) |
| 21:28:11 | <oak-> | GTK and cross-platform development was pain, I never got Gtk compiled on macOs |
| 21:28:53 | <oak-> | qtah on the contrary was quite easy to set up |
| 21:32:20 | <EvanR> | cocoa is cool |
| 21:32:52 | <EvanR> | but I guess rats ass chance that will work on e.g. windows |
| 21:36:42 | → | alx741 joins (~alx741@157.100.93.160) |
| 21:37:37 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 21:37:37 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 21:37:37 | → | wroathe joins (~wroathe@user/wroathe) |
| 21:39:40 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 21:40:45 | → | burnsidesLlama joins (~burnsides@dhcp168-039.wadham.ox.ac.uk) |
| 21:40:49 | <ephemient> | cocotron supposedly works on windows |
| 21:45:02 | × | ubert quits (~Thunderbi@p200300ecdf0994cfb11256a527c2b165.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 21:46:38 | × | lispy quits (~lispy4@84.69.59.93) (Quit: Leaving) |
| 21:48:48 | → | kupi joins (uid212005@id-212005.hampstead.irccloud.com) |
| 21:51:20 | → | jgeerds joins (~jgeerds@55d4bbed.access.ecotel.net) |
| 21:53:34 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 250 seconds) |
| 21:57:01 | × | `2jt quits (~jtomas@10.red-83-58-228.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 21:57:24 | → | `2jt joins (~jtomas@10.red-83-58-228.dynamicip.rima-tde.net) |
| 21:58:06 | → | alx741 joins (~alx741@157.100.93.160) |
| 21:58:20 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
| 21:59:38 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 21:59:38 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 21:59:38 | → | wroathe joins (~wroathe@user/wroathe) |
| 22:02:48 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 22:04:24 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
| 22:04:33 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 22:09:28 | → | Pickchea joins (~private@user/pickchea) |
| 22:10:00 | → | euandreh joins (~euandreh@2804:14c:33:9fe5:877b:86ff:8e37:7e9b) |
| 22:10:58 | ← | bsima parts (~bsima@2604:a880:400:d0::19f1:7001) (WeeChat 3.3) |
| 22:12:00 | → | gustik joins (~gustik@2a01:c844:2436:6920:9e9:f97c:41d1:634c) |
| 22:12:12 | × | briandaed quits (~root@185.234.208.208.r.toneticgroup.pl) (Ping timeout: 250 seconds) |
| 22:13:23 | × | gustik quits (~gustik@2a01:c844:2436:6920:9e9:f97c:41d1:634c) (Remote host closed the connection) |
| 22:13:39 | → | zebrag joins (~chris@user/zebrag) |
| 22:16:28 | → | lavaman joins (~lavaman@98.38.249.169) |
| 22:21:15 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 22:22:31 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 22:22:40 | → | alx741 joins (~alx741@157.100.93.160) |
| 22:25:28 | <EvanR> | what is the difference between a DSL, and Embedded DSL, and a "Deeply Embedded" DSL |
| 22:25:46 | <EvanR> | and how deep does this rabbit hole go |
| 22:25:57 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 22:26:00 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 22:26:00 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 22:26:00 | finn_elija | is now known as FinnElija |
| 22:26:17 | <Cale> | DSL means domain-specific language. You can imagine having a domain specific language which has its own concrete syntax that gets parsed and either compiled or interpreted separately |
| 22:26:17 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 22:26:23 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 22:26:41 | <monochrom> | "embedded" sticks to the host language. Without "embedded", it can mean your own syntax, your own parser. |
| 22:26:49 | <geekosaur> | I think that's not quite the question. more "why are there three different kinds? |
| 22:27:04 | <Cale> | An embedded domain specific language is essentially a library for a more general purpose programming language, where you use the host language's syntax, and usually many of its means of abstraction. |
| 22:27:40 | <monochrom> | And then "shallow embedding" vs "deep embedding" is about how much features of the host language you reuse (as opposed to reinvent). I forgot which end is deep. |
| 22:27:57 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 22:28:15 | <monochrom> | For example suppose your DSL is untyped lambda calculus again! :D |
| 22:28:20 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 22:28:20 | <Cale> | Yeah, shallow embeddings are closer to the sort where you're parsing concrete syntax, instead, you just have an abstract syntax tree as a data structure in your host language and use that |
| 22:28:41 | <Cale> | While deep embeddings are harder to distinguish from straightforward libraries in the host language. |
| 22:29:11 | × | opticblast quits (~june@secure-165.caltech.edu) (Ping timeout: 256 seconds) |
| 22:29:20 | <monochrom> | You may choose "data L = ... | Function{argument::String, body::L}" or "data L = ... | Function (L -> L)". That would be one way "shallow" and "deep" differ. |
| 22:29:36 | <Cale> | At least, if *I'm* remembering which way around that goes :D |
| 22:30:28 | <Cale> | Oh, it seems like some people use shallow embedding to mean something rather different from what I suggested |
| 22:30:42 | <Cale> | https://wiki.haskell.org/Embedded_domain_specific_language |
| 22:31:37 | × | neverwas quits (jpneverwas@swissbox.unperson.link) (Ping timeout: 240 seconds) |
| 22:31:45 | <Cale> | That seems to indicate that shallow embeddings are ones where Haskell (or host language) expressions construct concrete syntax of the domain specific language, and then that gets interpreted. |
| 22:32:20 | <Cale> | While deep embeddings only build the abstract syntax tree. So that's a different split point than I was thinking of :) |
| 22:32:33 | <Cale> | Maybe depth of embedding is relative :D |
| 22:32:45 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 250 seconds) |
| 22:32:48 | <Cale> | As their deep embedding was my shallow one |
| 22:32:52 | <EvanR> | I'm going to partition monochrom Cale msgs and read them as separate streams now |
| 22:32:57 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 22:33:18 | <EvanR> | oh wouldn't that be a cool irc client feature |
| 22:33:24 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 22:33:26 | <Cale> | (and their shallow embedding was even shallower than I was thinking) |
| 22:33:43 | × | random__ quits (~random@185.219.68.251) (Remote host closed the connection) |
| 22:34:06 | → | random__ joins (~random@185.219.68.251) |
| 22:34:17 | <Cale> | Yeah, for a long time I've wished I could e.g. ctrl-click on a bunch of people's nicks in the message log and then have the view restricted to those people. |
| 22:34:56 | <EvanR> | alright so... |
| 22:35:08 | <monochrom> | Well, "bus factor" suffers from the same problem. Half of the people define a formula that says a higher number means more single-person failures, and the other half does the opposite. |
| 22:35:23 | <EvanR> | a DSL could be implemented as data structure interpreter, or... |
| 22:35:33 | <EvanR> | I think that's 1 kind |
| 22:35:44 | <monochrom> | And now, which direction is reify, which direction is reflect? >:) |
| 22:36:19 | <EvanR> | so what does deep mean again |
| 22:36:32 | <EvanR> | it sounds good |
| 22:37:45 | <EvanR> | I'd say haskell is making it hard to figure this out, but I've only heard of these terms in haskell |
| 22:37:51 | geekosaur | wonders where xmonad lies on this axis, since it's clearly a DSL but is not related to an interpreter really |
| 22:37:56 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 22:38:21 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 22:39:36 | <monochrom> | I learned deep vs shallow from using a theorem prover to prove Gödel incompleteness so you begin by embedding your own FOL in the host FOL... |
| 22:40:00 | <EvanR> | in that case, what's the diff between deep and shallow |
| 22:40:16 | <Cale> | EvanR: Well, let's be a little more general, I think the idea of "deep" vs. "shallow" is that one embedding is "deeper" than another if it feels more like a native use of the host language, rather than an entirely separate construction. |
| 22:40:36 | <monochrom> | Like I said, how much of the host language features you just reuse. And I forgot whether "deep" means more or it means less. |
| 22:40:46 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 22:40:56 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 22:40:56 | <monochrom> | For example do you use the host languages "and" or do you roll your own. |
| 22:41:23 | <EvanR> | this is funny, now I get what you mean |
| 22:41:23 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 22:41:40 | <EvanR> | but am more confused about the direction of deep and shallow |
| 22:41:42 | × | xb0o2 quits (~xb0o2@user/xb0o2) (Quit: Client closed) |
| 22:41:58 | <Cale> | Another important one: do you use the host language's functions, or do you manage variable bindings and function evaluation yourself |
| 22:42:17 | <EvanR> | if you implement variables and functions yourself... is that deep or shallow |
| 22:42:30 | <Cale> | After looking at some things, I'm pretty sure "deeper" means "closer to just using the host language" |
| 22:42:42 | → | alx741 joins (~alx741@157.100.93.160) |
| 22:42:47 | <EvanR> | so deeply embedded is easier |
| 22:42:50 | <monochrom> | Yeah I vaguely remember the direction is like that. |
| 22:43:03 | <EvanR> | that's counterintuitive |
| 22:43:06 | <Cale> | i.e. a shallow embedding is one which is closer to being not embedded |
| 22:43:13 | <sm> | there's this: https://wiki.haskell.org/Embedded_domain_specific_language#Degree_of_embedding |
| 22:43:29 | <Cale> | Yeah, that's the thing I linked before :) |
| 22:43:41 | <sm> | oops, carry on :) |
| 22:44:03 | <Cale> | Their notion of shallow embedding is really quite shallow indeed, but you're likely to see it when it comes to SQL |
| 22:44:11 | <monochrom> | Well, "you use Haskell in a shallow way" can mean "you don't use many Haskell features" -> "you don't let Haskell do the heavy lifting" -> "you code up your own heavy lifting". |
| 22:44:27 | <Cale> | since the end goal there is usually not to run SQL statements in Haskell, but to send them over to a database server to be executed |
| 22:45:10 | <monochrom> | Also, "embed deep" can mean "the semantics of your EDSL is tightly tied to the semantics of Haskell because you just let Haskell do it" |
| 22:45:10 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 22:46:15 | <monochrom> | Shallow Query Language </roast> |
| 22:46:18 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 22:47:11 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 22:47:26 | <EvanR> | if i'm not mistaken you usually don't see stuff advertising itself as shallow |
| 22:47:32 | <EvanR> | making it seem worse |
| 22:48:11 | <monochrom> | Fortunately I read academic works for these things, where people don't have that marketing burden. |
| 22:49:12 | <jackdk> | @src for_ |
| 22:49:12 | <lambdabot> | Source not found. Have you considered trying to match wits with a rutabaga? |
| 22:49:19 | <monochrom> | Well, academia has a different marketing burden, but it is more interesting and justified than just avoiding some words. |
| 22:50:13 | <ephemient> | @src forM_ |
| 22:50:13 | <lambdabot> | forM_ = flip mapM_ |
| 22:50:52 | <EvanR> | :t for_ |
| 22:50:53 | <lambdabot> | (Foldable t, Applicative f) => t a -> (a -> f b) -> f () |
| 22:51:01 | <monochrom> | yeah, for_ is an alias of forM_, and traces back to mapM_. Don't worry, mapM_ has been improved to use just Applicative. |
| 22:51:28 | <EvanR> | wow that is cool I thought for_ needed Traversable |
| 22:51:51 | <sm> | perhaps some concrete examples are in order. Cabal file: DSL; Hamlet template: DSL with EDSL elements ? blaze-html or lucid or Shake or Hakyll script: deep EDSL ? |
| 22:52:17 | <Cale> | Attoparsec: even deeper EDSL? |
| 22:53:48 | × | ouestbillie quits (~gallup@142.169.82.16) (Ping timeout: 250 seconds) |
| 22:58:33 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:59:03 | <sm> | I guess when it just looks like function calls we call it code, and what makes it an EDSL is when it aims to give a visual/cognitive impression of being a different language from the host language |
| 23:01:07 | × | geranim0 quits (~geranim0@modemcable242.171-178-173.mc.videotron.ca) (Remote host closed the connection) |
| 23:01:49 | → | alx741 joins (~alx741@157.100.93.160) |
| 23:01:51 | <jackdk> | > :t flip $ \f -> foldr ((*>) . f) (pure ()) -- EvanR |
| 23:01:52 | <lambdabot> | <hint>:1:1: error: parse error on input ‘:’ |
| 23:02:02 | <jackdk> | % :t flip $ \f -> foldr ((*>) . f) (pure ()) -- EvanR |
| 23:02:02 | <yahb> | jackdk: ; <interactive>:1:26: error:; Ambiguous occurrence `.'; It could refer to; either `Control.Category..', imported from `Control.Category'; or `Prelude..', imported from `Prelude' (and originally defined in `GHC.Base') |
| 23:02:13 | <jackdk> | ahh you know what I mena |
| 23:02:16 | <jackdk> | mean* |
| 23:02:42 | <geekosaur> | % :m - Control.Category |
| 23:02:42 | <yahb> | geekosaur: |
| 23:02:43 | sm | plays with smalltalk |
| 23:02:47 | → | xb0o2 joins (~xb0o2@user/xb0o2) |
| 23:04:01 | <EvanR> | who left prelude and category imported in conflict xD |
| 23:04:04 | <sm> | flipping between smalltalk and haskell windows is quite mind-stretching |
| 23:04:20 | <EvanR> | just think of smalltalk as a DSL |
| 23:04:34 | <EvanR> | smalltalk monad |
| 23:07:14 | <monochrom> | I like Smalltalk blocks. It shows that lambda, not objects, is how you achieve compositionality, component reuse, all that good stuff. |
| 23:08:00 | <EvanR> | once you write a single class, you can reuse that single class as many times as you like |
| 23:08:07 | <EvanR> | code reuse |
| 23:08:11 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 23:08:16 | → | deadmarshal joins (~deadmarsh@95.38.231.124) |
| 23:09:06 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 23:10:42 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 23:12:39 | × | deadmarshal quits (~deadmarsh@95.38.231.124) (Ping timeout: 256 seconds) |
| 23:12:59 | sm | stumbled into https://gtoolkit.com , a clean modern layer on top of pharo, which is a fork of squeak, which is the OSS descendant of smaltalk-80 |
| 23:13:26 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 23:13:50 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 23:13:51 | <sm> | I always wanted to see smalltalk (good OO) and haskell (good FP) combined. |
| 23:13:54 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 23:14:23 | <sm> | just now I'm wondering what image-based Haskell dev could look like |
| 23:14:25 | → | merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) |
| 23:14:49 | <Inst> | do you know how to override cabal version checks? |
| 23:15:09 | <geekosaur> | --allow-{newer,older}[=package,...] |
| 23:15:11 | <Inst> | Warning: readline.cabal:27:32: version operators used. To use version |
| 23:15:11 | <Inst> | operators the package needs to specify at least 'cabal-version: >= 1.8'. |
| 23:15:11 | <Inst> | Warning: readline.cabal:9:3: Tabs used as indentation at 9:3, 10:3, 12:3, |
| 23:15:11 | <Inst> | 13:3, 15:3, 16:3 |
| 23:15:11 | <Inst> | Configuring readline-1.0.3.0... |
| 23:15:12 | <Inst> | cabal-3.6.2.0.exe: The package has a './configure' script. If you are on |
| 23:15:13 | <Inst> | Windows, This requires a Unix compatibility toolchain such as MinGW+MSYS or |
| 23:15:16 | <Inst> | Cygwin. If you are not on Windows, ensure that an 'sh' command is discoverable |
| 23:15:18 | <Inst> | in your path. |
| 23:15:20 | <Inst> | cabal-3.6.2.0.exe: Failed to build readline-1.0.3.0. See the build log above |
| 23:15:22 | <Inst> | for details. |
| 23:15:24 | <Inst> | whoops, sorry |
| 23:15:26 | <Inst> | didn't know it'd be that long |
| 23:15:42 | <geekosaur> | anyway that does not show any errors, just warnings |
| 23:16:05 | <geekosaur> | if you don't have mingw, it won't build, it tells you this |
| 23:16:25 | <geekosaur> | you can't "override" that |
| 23:16:41 | → | jgeerds_ joins (~jgeerds@55d4af63.access.ecotel.net) |
| 23:17:18 | <Inst> | i should have mingw |
| 23:17:22 | <Inst> | should that be added to path? |
| 23:18:16 | <geekosaur> | actually you should run the install from a mingw sh window |
| 23:19:33 | × | jgeerds quits (~jgeerds@55d4bbed.access.ecotel.net) (Ping timeout: 250 seconds) |
| 23:21:09 | × | zincy quits (~zincy@2a00:23c8:970c:4801:911c:c4ab:2f7e:d3f1) (Remote host closed the connection) |
| 23:22:09 | <Nate[m]1> | can I ask agda related question here? |
| 23:25:09 | <Nate[m]1> | can someone tell me how to call agda standard library? |
| 23:26:04 | × | cosimone quits (~user@93-44-186-159.ip98.fastwebnet.it) (Remote host closed the connection) |
| 23:26:51 | → | alx741 joins (~alx741@157.100.93.160) |
| 23:29:39 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 23:29:56 | <EvanR> | hrm to make monad an instance of mtl classes like MonadReader and MonadRWS the type variables need to line up exactly... |
| 23:30:14 | <EvanR> | which might be a different order from other convenience |
| 23:31:04 | <EvanR> | or I'm trippin |
| 23:31:17 | × | jkaye quits (~jkaye@2601:281:8300:7530:91a1:7dca:589a:aaae) (Ping timeout: 240 seconds) |
| 23:32:13 | <Inst> | https://media.discordapp.net/attachments/528863657363505159/931692175132090398/unknown.png |
| 23:32:28 | <Inst> | added mingw to path |
| 23:33:04 | <geekosaur> | you will need to use pacman to install the mingw readline package |
| 23:33:05 | <Inst> | bash in mingw64 doesn't recognize cabal |
| 23:33:14 | × | aliosablack quits (~chomwitt@athedsl-15695.home.otenet.gr) (Ping timeout: 250 seconds) |
| 23:33:25 | <Inst> | just ran pacman, mingw stopped responding |
| 23:33:50 | <Inst> | okay, should be able to take care of myself, ex-Arch user |
| 23:35:19 | <Inst> | is mingw literally using arch pacman? |
| 23:36:17 | <geekosaur> | a port of it |
| 23:36:25 | <geekosaur> | with its own packages though, not from arch |
| 23:37:51 | × | xb0o2 quits (~xb0o2@user/xb0o2) (Quit: Client closed) |
| 23:38:29 | <ephemient> | like almost all other development tools, Haskell is much less painful on Linux or WSL than on Windows natively </opinion> |
| 23:39:03 | × | jackson99 quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Session timeout)) |
| 23:39:03 | → | xb0o2 joins (~xb0o2@user/xb0o2) |
| 23:40:50 | <Inst> | also, that feel when you realize you have to learn monad transformers to get readkey support on Haskell |
| 23:40:55 | → | slack1256 joins (~slack1256@191.126.99.209) |
| 23:42:38 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 23:42:38 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 23:42:38 | → | wroathe joins (~wroathe@user/wroathe) |
| 23:43:09 | × | slac97765 quits (~slack1256@191.126.99.72) (Read error: Connection reset by peer) |
| 23:43:09 | <EvanR> | you think you need transformers to use Maybe and IO again |
| 23:43:15 | × | merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 23:43:26 | <Inst> | Haskeline uses InputT datatype |
| 23:43:45 | <EvanR> | groovy |
| 23:44:12 | <ephemient> | did none of the other terminal manipulation suggestions from earlier work? |
| 23:44:44 | <Inst> | tbh i have no idea how to pacman readline |
| 23:45:24 | <Inst> | i'll try compile and seeing if it works, but GHCi and GHC generated executables having different behavior -> baaaaad |
| 23:45:45 | → | neverwas joins (jpneverwas@swissbox.unperson.link) |
| 23:46:45 | <hpc> | differences between interpreted and compiled code are very very rare, and iirc all have to do with ffi |
| 23:46:58 | × | bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 23:47:13 | <Inst> | okay, somehow runhaskell died? |
| 23:47:30 | × | shriekingnoise quits (~shrieking@156-16-231-201.fibertel.com.ar) (Quit: Quit) |
| 23:47:33 | → | alx741 joins (~alx741@157.100.93.160) |
| 23:47:36 | × | max22- quits (~maxime@2a01cb0883359800ad92d79b8ec75caf.ipv6.abo.wanadoo.fr) (Remote host closed the connection) |
| 23:48:31 | <Inst> | also did hutton during a dental cleaning |
| 23:48:50 | <Inst> | contrary to the insistence of the hygienist, it is in fact possible to read a haskell textbook during routine dental care |
| 23:49:21 | → | shriekingnoise joins (~shrieking@201.231.16.156) |
| 23:49:24 | <Inst> | so getting into state monad, although it's still hard, not completely getting the syntax (or the notion that functions can be typeconstructed or type-synonymed types) |
| 23:49:37 | <Inst> | ::smug:: |
| 23:50:10 | × | bastelfreak quits (~bastelfre@basteles-bastelknecht.bastelfreak.org) (Quit: WeeChat 3.3) |
| 23:50:37 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 23:51:26 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 23:51:57 | <EvanR> | hmm funny MonadRWS class has no |
| 23:52:00 | <EvanR> | methods |
| 23:52:44 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 23:52:44 | × | Constraintegic quits (~DundiDund@ppp-212-114-229-73.dynamic.mnet-online.de) (Ping timeout: 250 seconds) |
| 23:53:56 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 23:54:02 | × | red-snail quits (~snail@static.151.210.203.116.clients.your-server.de) (Quit: ZNC 1.8.2 - https://znc.in) |
| 23:54:23 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 23:54:25 | × | DNH quits (~DNH@2a02:8108:1100:16d8:b0c0:5871:210d:15db) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 23:54:51 | → | red-snail joins (~snail@static.151.210.203.116.clients.your-server.de) |
| 23:55:26 | × | wmacmil quits (~wmacmil@83-233-165-97.cust.bredband2.com) (Remote host closed the connection) |
| 23:55:39 | × | dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.4) |
| 23:55:42 | <Athas> | Is it right that stackage nightly still isn't on aeson 2? |
| 23:55:50 | → | wmacmil joins (~wmacmil@83-233-165-97.cust.bredband2.com) |
| 23:58:35 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 23:58:35 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 23:58:35 | → | wroathe joins (~wroathe@user/wroathe) |
| 23:58:37 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 23:58:40 | <geekosaur> | EvanR, it doesn't need them, the "superclasses" provide them |
| 23:59:17 | × | `2jt quits (~jtomas@10.red-83-58-228.dynamicip.rima-tde.net) (Ping timeout: 256 seconds) |
| 23:59:51 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
All times are in UTC on 2022-01-14.