2025/01/11

Newest at the top

2025-01-11 22:53:58 +0100 <c_wraith> there are anti-patterns in Haskell. Things like the existential typeclass pattern, which laziness turns out to be a much simpler solution to in nearly every case.
2025-01-11 22:53:25 +0100rekahsoft(~rekahsoft@70.51.99.237) (Remote host closed the connection)
2025-01-11 22:46:27 +0100 <geekosaur> ("anti-pattern"?)
2025-01-11 22:45:23 +0100 <ash3en> i did use them in the past already, but I often am too afraid to use anti-patterns I am not aware of
2025-01-11 22:45:18 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-11 22:43:13 +0100 <geekosaur> you'll get used to HOFs eventually 🙂
2025-01-11 22:42:03 +0100 <ash3en> geekosaur: yes, thank you. i will keep it like this for now and maybe put them into a single function later on : )
2025-01-11 22:41:32 +0100 <tomsmeding> I think I'm going to stay with a helper function. :)
2025-01-11 22:40:47 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-11 22:40:46 +0100 <geekosaur> ash3en, that works. I think you should also be able to write tokenizeNumber in terms of tokenizeString though
2025-01-11 22:40:41 +0100 <tomsmeding> the tail blows up but the zipWith doesn't evaluate the tail on []
2025-01-11 22:40:02 +0100 <tomsmeding> probie: I did not
2025-01-11 22:39:58 +0100 <tomsmeding> oh the zipWith saves you here, cute
2025-01-11 22:39:44 +0100 <lambdabot> True
2025-01-11 22:39:43 +0100 <tomsmeding> > (and . (zipWith (==) <*> tail)) []
2025-01-11 22:39:41 +0100 <probie> You didn't specify that you wanted it to be readable
2025-01-11 22:39:24 +0100 <tomsmeding> ah yes I can read that
2025-01-11 22:39:18 +0100tomsmeding. o O ( (<*>) = S = \f g x -> f x (g x) )
2025-01-11 22:38:28 +0100 <ash3en> tomsmeding: i am not aware of something off the top of my hat
2025-01-11 22:38:15 +0100 <lambdabot> Eq a => [a] -> Bool
2025-01-11 22:38:14 +0100 <probie> :t and . (zipWith (==) <*> tail)
2025-01-11 22:37:29 +0100 <ash3en> geekosaur: this is what i did now. does it look good to you? https://paste.tomsmeding.com/WfD77OU3
2025-01-11 22:32:39 +0100 <tomsmeding> i.e. "allEqual"
2025-01-11 22:32:30 +0100 <tomsmeding> is there a shorter way to write (\case [] -> True ; x:xs -> all (== x) xs)
2025-01-11 22:30:37 +0100supercode(~supercode@user/supercode) (Quit: Client closed)
2025-01-11 22:29:38 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 244 seconds)
2025-01-11 22:29:29 +0100philopsos(~caecilius@user/philopsos) philopsos
2025-01-11 22:25:24 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-11 22:20:33 +0100 <ash3en> geekosaur: thank you!
2025-01-11 22:20:12 +0100 <ash3en> i think i get it now and i will try it out
2025-01-11 22:18:29 +0100 <ncf> monochrom: i'm still curious. how do you prove the obvious free theorem for forall a b. b -> ((a -> a) -> b) -> b ?
2025-01-11 22:17:58 +0100 <geekosaur> you can put any Haskell code inside the braces, and as long as the type of rtToken is available (since it's generating a normal Haskell source file and not using TH, it will be) you can use it
2025-01-11 22:17:58 +0100gmg(~user@user/gehmehgeh) gehmehgeh
2025-01-11 22:17:14 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2025-01-11 22:16:47 +0100chexum(~quassel@gateway/tor-sasl/chexum) chexum
2025-01-11 22:16:38 +0100 <geekosaur> why wouldn't that work?
2025-01-11 22:16:17 +0100chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2025-01-11 22:15:02 +0100 <ash3en> <0> @id { tokenizeString }
2025-01-11 22:14:54 +0100 <ash3en> @id = ($alpha | \_) ($alpha | $digit | \_ | \' | \?)*
2025-01-11 22:14:51 +0100 <ash3en> this probably won't work, but im not sure, since the functions are called using Alex like this:
2025-01-11 22:14:45 +0100chiselfuse(~chiselfus@user/chiselfuse) chiselfuse
2025-01-11 22:14:07 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 252 seconds)
2025-01-11 22:13:04 +0100chiselfuse(~chiselfus@user/chiselfuse) (Remote host closed the connection)
2025-01-11 22:12:19 +0100 <geekosaur> so tokenizeAddressPattern becomes tokenize AddrPattern, tokenizeInt becomes tokenize (Integer . read . BS.unpack), etc.
2025-01-11 22:11:34 +0100 <geekosaur> you can make one "master function" with wrappers for the specific uses, unless you want to pass the extra HOF at use sites. you pass a function (Text -> <whatever type rtToken is>)
2025-01-11 22:11:34 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) bitdex
2025-01-11 22:11:09 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2025-01-11 22:08:19 +0100 <ash3en> i'm still not sure how i'd make a single function out of these.
2025-01-11 22:07:21 +0100merijn(~merijn@128-137-045-062.dynamic.caiway.nl) merijn
2025-01-11 22:06:21 +0100 <geekosaur> it could be even simpler but you need to apply more than just the constructor sometimes (e.g. Integer)