2025/10/18

Newest at the top

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)
2025-10-18 21:44:08 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2025-10-18 21:39:25 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-18 21:38:27 +0200ephilalethes(~noumenon@113.51-175-156.customer.lyse.net) (Quit: Leaving)
2025-10-18 21:38:27 +0200 <EvanR> Proxy is pretty easy and doesn't explode in your face
2025-10-18 21:37:34 +0200 <mreh> so I feel I can get away with it
2025-10-18 21:37:21 +0200 <mreh> it's only for internal use
2025-10-18 21:36:38 +0200 <mreh> monochrom: I usually settle with (undefined :: a)
2025-10-18 21:30:38 +0200karenw_(~karenw@user/karenw) karenw
2025-10-18 21:28:39 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2025-10-18 21:23:37 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-18 21:21:43 +0200forell(~forell@user/forell) (Ping timeout: 265 seconds)
2025-10-18 21:20:22 +0200 <monochrom> mreh: You can also consider "p a -> Colour a (ColourComponent a) -> ByteString". The user will usually supply "Proxy :: Proxy MyType", then a = MyType.