2025/10/18

Newest at the top

2025-10-18 22:32:47 +0200 <EvanR> if you get an instance you know it was the right one for that type
2025-10-18 22:32:11 +0200 <EvanR> doesn't that cripple the entire cool part of type classes
2025-10-18 22:32:02 +0200Zemy_(~Zemy@72.178.108.235)
2025-10-18 22:31:46 +0200 <mreh> is there any downside to AllowAmbiguousTypes project wide?
2025-10-18 22:31:45 +0200morj(~morj@user/morj) (Quit: Konversation terminated!)
2025-10-18 22:31:28 +0200Zemy_(~Zemy@72.178.108.235) (Read error: Connection reset by peer)
2025-10-18 22:31:27 +0200Zemy(~Zemy@2600:100c:b0a7:4bfb:24c8:fcff:fe1d:80e8)
2025-10-18 22:29:32 +0200 <mreh> monochrom: it's pretty easy to translate to that form, and you only need AllowAmbiguousTypes on the file with the Class in
2025-10-18 22:29:03 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-18 22:28:44 +0200 <monochrom> Yeah the extreme way requires AllowAmbiguousTypes too.
2025-10-18 22:28:15 +0200 <monochrom> whodunit
2025-10-18 22:27:13 +0200 <mreh> I have so many Arrows that I need from some instance, which I don't always use to compute an actual value, so I'm always feeding undefined into those too
2025-10-18 22:22:27 +0200Zemy(~Zemy@2600:100c:b0a7:4bfb:f0d2:72ff:fe86:260e) (Ping timeout: 260 seconds)
2025-10-18 22:20:14 +0200Zemy_(~Zemy@72.178.108.235)
2025-10-18 22:19:41 +0200jreicher(~user@user/jreicher) (Quit: In transit)
2025-10-18 22:18:13 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-10-18 22:16:31 +0200 <EvanR> ["a string"]
2025-10-18 22:16:29 +0200 <mreh> morj: that's funny
2025-10-18 22:16:28 +0200 <EvanR> whodis
2025-10-18 22:16:20 +0200 <EvanR> knock knock
2025-10-18 22:16:01 +0200 <morj> As a fun bonus, you can also do like `whodis ["a string"]`, which gives you the instance for the string
2025-10-18 22:15:24 +0200 <morj> Then this works with Proxy from base, or anything else the user has defined themselves
2025-10-18 22:15:23 +0200 <mreh> don't you also have to turn on AllowAmbiguousTypes?
2025-10-18 22:14:49 +0200 <morj> If you want to be fancy, you can also use an abstract proxy type: class Who a where whodis :: forall (proxy :: Type -> Type). proxy a -> String
2025-10-18 22:14:15 +0200 <mreh> I've already got it turned on, so I might start using that instead
2025-10-18 22:14:14 +0200morj(~morj@user/morj) morj
2025-10-18 22:13:46 +0200 <mreh> monochrom: that's a nice use of type applications I hadn't thought of
2025-10-18 22:13:17 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-18 22:12:07 +0200humasect(~humasect@dyn-192-249-132-90.nexicom.net)
2025-10-18 22:11:18 +0200jmcantrell(~weechat@user/jmcantrell) jmcantrell
2025-10-18 22:09:08 +0200forell(~forell@user/forell) forell
2025-10-18 22:07:17 +0200CiaoSen(~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 260 seconds)
2025-10-18 22:03:32 +0200 <monochrom> (Just replied on the discourse why I would use Maybe even though in general there are a million different causes of errors and Maybe doesn't tell you which. Oh because sometimes there is only one cause, and some other times it doesn't matter.)
2025-10-18 22:03:18 +0200trickard_(~trickard@cpe-57-98-47-163.wireline.com.au)
2025-10-18 22:03:05 +0200trickard(~trickard@cpe-57-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-10-18 22:01:47 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2025-10-18 22:01:08 +0200 <monochrom> But otherwise I am against over-engineering too.
2025-10-18 22:00:31 +0200 <monochrom> I recommend Proxy over undefined for these use cases because going Proxy does not take you more time than going undefined. (OK, apart from scrolling to the top to add "import Data.Proxy".)
2025-10-18 21:59:59 +0200 <EvanR> everything's a function, including Integers
2025-10-18 21:57:59 +0200 <EvanR> a variable constant
2025-10-18 21:57:12 +0200 <monochrom> If you take TypeApplication to the extreme, you can even change "method"'s type to "method :: Integer" and then the use site goes like "method @m". But I am not that extremist yet. :)
2025-10-18 21:57:09 +0200werneta(~werneta@71.83.160.242) (Remote host closed the connection)
2025-10-18 21:56:55 +0200Unicorn_Princes-Unicorn_Princes
2025-10-18 21:56:05 +0200 <monochrom> ("method" is like "method :: p m -> Integer")
2025-10-18 21:55:42 +0200 <monochrom> I write a type sig "foo :: Modulus m => ..." and the the implementation goes like "foo ... = ... method (Proxy @m) ...".
2025-10-18 21:55:18 +0200werneta(~werneta@71.83.160.242) werneta
2025-10-18 21:55:13 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-18 21:54:43 +0200 <monochrom> If you turn on TypeApplication, then "Proxy :: Proxy MyType" can be compressed to "Proxy @MyType". It's very pleasing if you came from a System-F background. I did that en masse recently. :)
2025-10-18 21:50:13 +0200Unicorn_Princes-(~Unicorn_P@89.143.18.181)
2025-10-18 21:48:47 +0200Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving)