Newest at the top
2025-10-20 20:19:06 +0200 | wbrawner | (~wbrawner@static.56.224.132.142.clients.your-server.de) (Ping timeout: 248 seconds) |
2025-10-20 20:18:07 +0200 | tabaqui | (~tabaqui@167.71.80.236) (Ping timeout: 260 seconds) |
2025-10-20 20:17:26 +0200 | <EvanR> | splitWhen :: (a -> Bool) -> [a] -> [[a]] is in there |
2025-10-20 20:16:55 +0200 | <EvanR> | yeah |
2025-10-20 20:16:52 +0200 | <yabobay> | you mean the package? |
2025-10-20 20:16:32 +0200 | <EvanR> | it's called `split' |
2025-10-20 20:16:23 +0200 | <yabobay> | you can probably write it easily but gimme a moment to figure it out for fun |
2025-10-20 20:16:20 +0200 | <EvanR> | there is a package with a bunch of splitting utilities |
2025-10-20 20:16:10 +0200 | <EvanR> | which I reimplemented a few times |
2025-10-20 20:15:56 +0200 | <EvanR> | that is a pretty simple combination of break and scanl |
2025-10-20 20:15:50 +0200 | <yabobay> | and so return a list |
2025-10-20 20:15:40 +0200 | <yabobay> | well what if i want it to break at every delimiter instead of just the first one |
2025-10-20 20:15:18 +0200 | <lambdabot> | (a -> Bool) -> [a] -> ([a], [a]) |
2025-10-20 20:15:17 +0200 | <EvanR> | :t break |
2025-10-20 20:15:04 +0200 | <lambdabot> | • Perhaps you meant one of these: |
2025-10-20 20:15:04 +0200 | <lambdabot> | • Variable not in scope: breakOn |
2025-10-20 20:15:03 +0200 | <lambdabot> | error: |
2025-10-20 20:15:02 +0200 | <EvanR> | :t breakOn |
2025-10-20 20:14:51 +0200 | <yabobay> | uh |
2025-10-20 20:14:44 +0200 | <yabobay> | (a -> Bool) -> [a] -> http://en.wikipedia.org/wiki/Special:Search?go=Go&search=a |
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 +0200 | yabobay | (~pizza@2a02:85f:fcd5:1601:439e:d9b3:6a5d:d567) yabobay |
2025-10-20 20:10:54 +0200 | flipflops | (~cmo@2604:3d09:207f:8000::d1dc) (Ping timeout: 252 seconds) |
2025-10-20 20:09:35 +0200 | Natch | (~natch@c-92-34-15-120.bbcust.telenor.se) |
2025-10-20 20:05:44 +0200 | Googulator7 | (~Googulato@2a01-036d-0106-03fa-0485-6a66-0733-0e38.pool6.digikabel.hu) |
2025-10-20 20:05:43 +0200 | Googulator67 | (~Googulato@2a01-036d-0106-03fa-0485-6a66-0733-0e38.pool6.digikabel.hu) (Quit: Client closed) |
2025-10-20 19:55:04 +0200 | flipflops | (~cmo@2604:3d09:207f:8000::d1dc) |
2025-10-20 19:53:26 +0200 | ephilalethes | (~noumenon@113.51-175-156.customer.lyse.net) (Remote host closed the connection) |
2025-10-20 19:53:17 +0200 | ephilalethes | (~noumenon@113.51-175-156.customer.lyse.net) noumenon |
2025-10-20 19:47:33 +0200 | wbrawner | (~wbrawner@static.56.224.132.142.clients.your-server.de) wbrawner |
2025-10-20 19:47:25 +0200 | wbrawner | (~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 |