2024/11/19

Newest at the top

2024-11-19 14:35:48 +0100rvalue(~rvalue@user/rvalue) (Ping timeout: 265 seconds)
2024-11-19 14:35:23 +0100 <dminuoso> And it will probably require using ScopedTypeVariables and some annoyances.
2024-11-19 14:35:11 +0100 <dminuoso> Const will constantly (the pun!) be in the way because you need to wrap/unwrap potentially many times
2024-11-19 14:34:51 +0100 <dminuoso> bwe: Id say Proxy is the least akward and most common way.
2024-11-19 14:34:21 +0100 <Leary> Personally, I would go with `asum`. Either way, get them from `Data.Foldable`; a `Data.List` import suggests list specialisation (which could actually happen at some point).
2024-11-19 14:31:48 +0100 <hellwolf> import Data.List (find) is required though
2024-11-19 14:31:38 +0100 <hellwolf> hard to choose :)
2024-11-19 14:31:00 +0100 <hellwolf> either (const Nothing) (Just . ADDR) (S.decode b)
2024-11-19 14:30:59 +0100 <hellwolf> or
2024-11-19 14:30:53 +0100 <hellwolf> fmap ADDR . find (const True) $ S.decode b
2024-11-19 14:28:28 +0100 <hellwolf> Left elements are mempty, right elements are actually "foldable"
2024-11-19 14:28:05 +0100 <hellwolf> it all hinges all the fact of the Foldable Either instance.
2024-11-19 14:27:46 +0100 <hellwolf> that's very cute, indeed
2024-11-19 14:19:34 +0100housemate(~housemate@2a04:9dc0:0:162::5d91:d7ed) housemate
2024-11-19 14:10:18 +0100housemate(~housemate@2a04:9dc0:0:162::5d91:d7ed) (Ping timeout: 244 seconds)
2024-11-19 14:07:17 +0100 <Leary> hellwolf: ^
2024-11-19 14:07:14 +0100 <yahb2> find \_ -> True :: Foldable t => t a -> Maybe a
2024-11-19 14:07:14 +0100 <Leary> % :t find \_ -> True
2024-11-19 14:07:08 +0100 <Leary> Oh, bit late, but I thought of something cute and silly!
2024-11-19 14:05:37 +0100sand-witch(~m-mzmz6l@vmi833741.contaboserver.net)
2024-11-19 14:01:28 +0100ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Remote host closed the connection)
2024-11-19 14:01:21 +0100ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) ash3en
2024-11-19 14:01:13 +0100acidjnk_new(~acidjnk@p200300d6e7283f33f1310e0154b357f3.dip0.t-ipconnect.de) acidjnk
2024-11-19 14:01:03 +0100ash3en(~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en)
2024-11-19 14:00:27 +0100Digit(~user@user/digit) Digit
2024-11-19 13:56:49 +0100acidjnk_new(~acidjnk@p200300d6e7283f33f1310e0154b357f3.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2024-11-19 13:56:10 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-11-19 13:56:06 +0100lxsameer(~lxsameer@Serene/lxsameer) (Ping timeout: 252 seconds)
2024-11-19 13:52:13 +0100 <hellwolf> right. I also misread the original question, in the first place.
2024-11-19 13:50:56 +0100carbolymer(~carbolyme@dropacid.net) carbolymer
2024-11-19 13:50:09 +0100 <mauke> that's just Proxy
2024-11-19 13:49:49 +0100 <hellwolf> Const () a probably could work too
2024-11-19 13:49:37 +0100 <hellwolf> interesting :)
2024-11-19 13:47:11 +0100 <bwe> mauke: Excellent. Does my job.
2024-11-19 13:44:39 +0100alexherbo2(~alexherbo@2a02-8440-3201-1725-d030-8edc-2b2b-9bf9.rev.sfr.net) alexherbo2
2024-11-19 13:41:48 +0100notzmv(~daniel@user/notzmv) notzmv
2024-11-19 13:40:23 +0100sawilagar(~sawilagar@user/sawilagar) sawilagar
2024-11-19 13:40:05 +0100sawilagar(~sawilagar@user/sawilagar) (Remote host closed the connection)
2024-11-19 13:36:30 +0100 <mauke> f :: Const Int a
2024-11-19 13:34:55 +0100 <Leary> bwe: Proxies and TypeApplications are the usual options. If you're fine with being limited to GHC 9.10 or newer you can use RequiredTypeArguments instead.
2024-11-19 13:34:47 +0100 <haskellbridge> or AmbiguousTypes
2024-11-19 13:34:47 +0100 <haskellbridge> <hellwolf> Proxy
2024-11-19 13:31:26 +0100 <bwe> I'd like to define some instances for a type class without the member of the class as argument, like `f :: Int` instead of `f :: a -> Int`. Reason: Before `a` gets constructed, I need some functions that are specific to the variant of `a`. Which approaches do you recommend?
2024-11-19 13:31:18 +0100JuanDaugherty(~juan@user/JuanDaugherty) JuanDaugherty
2024-11-19 13:23:29 +0100 <mauke> structural doctyping
2024-11-19 13:21:34 +0100 <dminuoso> kuribas: Structural subtyping captures some, but not all commonly mentioned, ideas of duck typing.
2024-11-19 13:20:41 +0100 <dminuoso> It mostly arises from the idea of smalltalk object orientation, where if some object behaves as if it was a duck, you can just call it a duck.
2024-11-19 13:20:17 +0100 <kuribas> looks like structural subtyping to me: https://peps.python.org/pep-0544/
2024-11-19 13:20:04 +0100 <dminuoso> Well, the "if it doesn't" is not something that duck type proponents really worry about.
2024-11-19 13:19:47 +0100 <dminuoso> Duck typing is nothing that you can sensibly annotate with formal names, because its a very loose abstract idea.