2022/01/14

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