2025/10/20

Newest at the top

2025-10-20 20:13:00 +0200 <EvanR> what do you mean by generic, maybe write the desired type signature
2025-10-20 20:12:13 +0200 <yabobay> is there a generic version of splitWith somewhere in the standard library? or at least one that works on String's?
2025-10-20 20:11:44 +0200yabobay(~pizza@2a02:85f:fcd5:1601:439e:d9b3:6a5d:d567) yabobay
2025-10-20 20:10:54 +0200flipflops(~cmo@2604:3d09:207f:8000::d1dc) (Ping timeout: 252 seconds)
2025-10-20 20:09:35 +0200Natch(~natch@c-92-34-15-120.bbcust.telenor.se)
2025-10-20 20:05:44 +0200Googulator7(~Googulato@2a01-036d-0106-03fa-0485-6a66-0733-0e38.pool6.digikabel.hu)
2025-10-20 20:05:43 +0200Googulator67(~Googulato@2a01-036d-0106-03fa-0485-6a66-0733-0e38.pool6.digikabel.hu) (Quit: Client closed)
2025-10-20 19:55:04 +0200flipflops(~cmo@2604:3d09:207f:8000::d1dc)
2025-10-20 19:53:26 +0200ephilalethes(~noumenon@113.51-175-156.customer.lyse.net) (Remote host closed the connection)
2025-10-20 19:53:17 +0200ephilalethes(~noumenon@113.51-175-156.customer.lyse.net) noumenon
2025-10-20 19:47:33 +0200wbrawner(~wbrawner@static.56.224.132.142.clients.your-server.de) wbrawner
2025-10-20 19:47:25 +0200wbrawner(~wbrawner@static.56.224.132.142.clients.your-server.de) (Ping timeout: 264 seconds)
2025-10-20 19:47:20 +0200 <monochrom> Could be!
2025-10-20 19:44:30 +0200 <dolio> Is that a pun?
2025-10-20 19:43:57 +0200 <monochrom> Not sure what you read, but generally "could" could (pun!) be highly hypothetical as in "in another parallel universe" and/or "if I were World Dictator".
2025-10-20 19:43:55 +0200 <mastarija> Yeah. Thanks. I somehow misremembered stuff and got stuck thinking my thinking is correct xD
2025-10-20 19:43:15 +0200 <tomsmeding> if you want to recurse into a field, then yes
2025-10-20 19:43:11 +0200 <mastarija> Now it's coming back to me...
2025-10-20 19:43:03 +0200 <mastarija> Yeah. I guess on Rec0 we are supposed to manually call Rep if we want to go deeper, right?
2025-10-20 19:42:53 +0200 <tomsmeding> dcpagan: well you can always define (>>=) in terms of join yourself
2025-10-20 19:42:50 +0200 <monochrom> I don't think join was ever a method.
2025-10-20 19:42:39 +0200 <mastarija> I don't know what I was thinking.
2025-10-20 19:42:35 +0200 <dcpagan> Did "join" used to be a class method that one could optionally define for a Monad instance? I could have sworn that I read somewhere that you could define a Monad instance by defining join instead of defining bind, since m >>= k = join $ fmap k m
2025-10-20 19:42:32 +0200 <mastarija> Huh. It does.
2025-10-20 19:42:28 +0200 <tomsmeding> what do you mean? Do you have a simple example type?
2025-10-20 19:41:39 +0200 <mastarija> But will that work for a field that's another product? I just want to go one level deep.
2025-10-20 19:41:05 +0200 <tomsmeding> I don't even see any string forms anywhere
2025-10-20 19:40:53 +0200 <tomsmeding> note the Int and Bool in there
2025-10-20 19:40:43 +0200 <yahb2> https://paste.tomsmeding.com/UQWaOWBa
2025-10-20 19:40:43 +0200 <tomsmeding> %% :k! Rep A
2025-10-20 19:40:43 +0200 <geekosaur> yes
2025-10-20 19:40:40 +0200 <yahb2> <no output>
2025-10-20 19:40:40 +0200 <tomsmeding> % data A = A Int Bool deriving (Generic)
2025-10-20 19:40:39 +0200ljdarj(~Thunderbi@user/ljdarj) ljdarj
2025-10-20 19:40:37 +0200 <yahb2> <no output>
2025-10-20 19:40:37 +0200 <tomsmeding> % import GHC.Generics
2025-10-20 19:40:32 +0200 <yahb2> <interactive>:63:31: error: [GHC-76037] ; Not in scope: type constructor or class ‘Generic’
2025-10-20 19:40:32 +0200 <tomsmeding> % data A = A Int Bool deriving (Generic)
2025-10-20 19:40:26 +0200 <yahb2> <no output>
2025-10-20 19:40:26 +0200 <tomsmeding> % :seti -XDeriveGeneric
2025-10-20 19:40:21 +0200 <mastarija> Wait, really?
2025-10-20 19:40:16 +0200 <mastarija> When using `Rep` I unfortunatelly do not get that.
2025-10-20 19:39:58 +0200 <tomsmeding> the field types are simply there inside the Rec0 constructors
2025-10-20 19:39:51 +0200 <mastarija> But yes. Type of a field is what I'm looking for.
2025-10-20 19:39:35 +0200 <mastarija> Like, my ultimate goal is to be able to make a `toTuple` / `fromTuple` instances where I could generically convert any product type into a tuple.
2025-10-20 19:39:07 +0200 <tomsmeding> mastarija: which type exactly are you looking for? The type of a field?
2025-10-20 19:39:00 +0200 <geekosaur> it's not; like I said, it's not strong enough
2025-10-20 19:38:42 +0200 <mastarija> I think Typeable is not what I want.
2025-10-20 19:38:41 +0200 <tomsmeding> Data.Data is untyped, and GHC.Generics is quite typed
2025-10-20 19:38:33 +0200 <tomsmeding> I'm fairly sure Data.Data is not involved here