2022-12-04 00:00:00 +0100 | <EvanR> | d-_-b |
2022-12-04 00:01:48 +0100 | <EvanR> | :t (=<<) |
2022-12-04 00:01:49 +0100 | <lambdabot> | Monad m => (a -> m b) -> m a -> m b |
2022-12-04 00:04:36 +0100 | <mauke> | it doesn't help that the monad in question is the naked reader |
2022-12-04 00:04:36 +0100 | <mauke> | @pl \x -> f (g x) x |
2022-12-04 00:04:37 +0100 | <lambdabot> | f =<< g |
2022-12-04 00:04:37 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 256 seconds) |
2022-12-04 00:04:41 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-04 00:06:35 +0100 | <mauke> | > let f' = f :: Expr -> Expr -> Expr in (f' =<< g) x |
2022-12-04 00:06:36 +0100 | <lambdabot> | f (g x) x |
2022-12-04 00:06:53 +0100 | <EvanR> | how to type application (=<<) to the (->) r type |
2022-12-04 00:08:42 +0100 | <mauke> | ? |
2022-12-04 00:08:50 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 00:08:57 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Quit: Leaving) |
2022-12-04 00:09:01 +0100 | <EvanR> | like, specialize the type to a particular m |
2022-12-04 00:09:45 +0100 | <EvanR> | :t (=<<) @Maybe |
2022-12-04 00:09:46 +0100 | <lambdabot> | error: |
2022-12-04 00:09:46 +0100 | <lambdabot> | Pattern syntax in expression context: (=<<)@Maybe |
2022-12-04 00:09:46 +0100 | <lambdabot> | Did you mean to enable TypeApplications? |
2022-12-04 00:09:57 +0100 | <mauke> | was that a question? |
2022-12-04 00:10:11 +0100 | <EvanR> | I'll just keep trying stuff until you tell me lol |
2022-12-04 00:10:19 +0100 | <mauke> | tell you what? |
2022-12-04 00:10:28 +0100 | <EvanR> | % (=<<) @((->) r) |
2022-12-04 00:10:28 +0100 | <yahb2> | <interactive>:22:14: error: Not in scope: type variable ‘r’ |
2022-12-04 00:10:41 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
2022-12-04 00:10:48 +0100 | <EvanR> | % (=<<) @Maybe |
2022-12-04 00:10:48 +0100 | <yahb2> | <interactive>:24:1: error: ; • No instance for (Show ((a0 -> Maybe b0) -> Maybe a0 -> Maybe b0)) ; arising from a use of ‘Yahb2Defs.limitedPrint’ ; (maybe you haven't applied a ... |
2022-12-04 00:13:45 +0100 | <ballast> | I'm looking for a function of type (a -> Maybe a) -> a -> [a]. Sort of like a bounded iterate. Should I just write takeWhile pred . iterate f |
2022-12-04 00:14:53 +0100 | jakalx | (~jakalx@base.jakalx.net) (Error from remote client) |
2022-12-04 00:15:10 +0100 | <EvanR> | :t unfoldr |
2022-12-04 00:15:11 +0100 | <geekosaur> | :t unfoldM |
2022-12-04 00:15:11 +0100 | <lambdabot> | (b -> Maybe (a, b)) -> b -> [a] |
2022-12-04 00:15:11 +0100 | <lambdabot> | error: |
2022-12-04 00:15:11 +0100 | <lambdabot> | • Variable not in scope: unfoldM |
2022-12-04 00:15:11 +0100 | <lambdabot> | • Perhaps you meant one of these: |
2022-12-04 00:15:16 +0100 | <geekosaur> | er, unfoldr, yes |
2022-12-04 00:15:34 +0100 | <mniip> | cpli, mathematical physics |
2022-12-04 00:15:58 +0100 | <ballast> | bah i figured it was unfoldr, thanks |
2022-12-04 00:16:01 +0100 | <EvanR> | % :t (=<<) @Maybe |
2022-12-04 00:16:01 +0100 | <yahb2> | (=<<) @Maybe :: Monad Maybe => (a -> Maybe b) -> Maybe a -> Maybe b |
2022-12-04 00:16:13 +0100 | <EvanR> | % :t (=<<) @((->) [Int]) -- Guest26 |
2022-12-04 00:16:13 +0100 | <yahb2> | (=<<) @((->) [Int]) -- Guest26 ; :: Monad ((->) [Int]) => ; (a -> [Int] -> b) -> ([Int] -> a) -> [Int] -> b |
2022-12-04 00:16:27 +0100 | <ballast> | now to figure out how to make it compatible with what i wrote |
2022-12-04 00:16:41 +0100 | <EvanR> | write your function in terms of unfoldr xD |
2022-12-04 00:16:46 +0100 | <EvanR> | then use your function |
2022-12-04 00:16:58 +0100 | <ballast> | that's the tricky part haa |
2022-12-04 00:17:04 +0100 | <mauke> | :t fmap (join (,)) |
2022-12-04 00:17:05 +0100 | <lambdabot> | Functor f => f a -> f (a, a) |
2022-12-04 00:17:13 +0100 | <EvanR> | b = a in this case |
2022-12-04 00:17:35 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Ping timeout: 268 seconds) |
2022-12-04 00:17:44 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
2022-12-04 00:17:48 +0100 | <mauke> | @pl \f a -> unfoldr (fmap (join (,)) . f) a |
2022-12-04 00:17:48 +0100 | <lambdabot> | unfoldr . (fmap (join (,)) .) |
2022-12-04 00:18:00 +0100 | <mauke> | :t unfoldr . (fmap (join (,)) .) |
2022-12-04 00:18:01 +0100 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
2022-12-04 00:18:22 +0100 | <mniip> | tomsmeding, looks like you're using a different ghci config |
2022-12-04 00:18:35 +0100 | <mauke> | @unpl unfoldr . (fmap (join (,)) .) |
2022-12-04 00:18:35 +0100 | <lambdabot> | (\ x -> unfoldr (\ x0 -> fmap (((,)) >>= \ x1 -> x1) (x x0))) |
2022-12-04 00:18:41 +0100 | <mauke> | heh |
2022-12-04 00:18:43 +0100 | <mniip> | idk if you're aware but you can set something like -dppr-cols10000 |
2022-12-04 00:18:44 +0100 | <mauke> | that's even worse! |
2022-12-04 00:18:55 +0100 | <ballast> | hmmm not enough symbols. :t unfoldr <$> ((<$>) (join (,)) <$>) |
2022-12-04 00:18:58 +0100 | <mniip> | so that it doesn't try to pretty-print vertically |
2022-12-04 00:19:05 +0100 | <mauke> | I "like" how it expands join to >>= id |
2022-12-04 00:19:09 +0100 | <EvanR> | (\ x -> unfoldr (\ x0 -> fmap (((,)) >>= \ x1 -> x1) (x x0))) has a certain charm though |
2022-12-04 00:19:11 +0100 | <ballast> | :t unfoldr <$> ((<$>) (join (,)) <$>) |
2022-12-04 00:19:12 +0100 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
2022-12-04 00:19:22 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2022-12-04 00:19:46 +0100 | <ballast> | now i'll just define (\/) = join and (||=>) = unfoldr |
2022-12-04 00:19:51 +0100 | ddellacosta | (~ddellacos@143.244.47.73) (Quit: WeeChat 3.7.1) |
2022-12-04 00:19:52 +0100 | <mauke> | :t unfoldr `fmap` (fmap (join (,)) `fmap`) |
2022-12-04 00:19:53 +0100 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
2022-12-04 00:20:06 +0100 | <EvanR> | use unicode operators for good measure |
2022-12-04 00:20:23 +0100 | <ballast> | but i can't type those |
2022-12-04 00:20:27 +0100 | <ballast> | maybe if i get an APL keyboard |
2022-12-04 00:20:28 +0100 | <mauke> | :t fmap unfoldr (fmap (fmap (join (,)))) |
2022-12-04 00:20:29 +0100 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
2022-12-04 00:20:37 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-04 00:20:44 +0100 | <EvanR> | typing is overrated, it leads to write-only code anyway |
2022-12-04 00:20:52 +0100 | ddellacosta | (~ddellacos@143.244.47.73) |
2022-12-04 00:20:52 +0100 | <mauke> | as a general rule, at least half of the identifiers in any given Haskell program should be fmap |
2022-12-04 00:21:08 +0100 | <ballast> | no need for lenses, just fmap 7 times |
2022-12-04 00:21:11 +0100 | chomwitt | (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 246 seconds) |
2022-12-04 00:21:18 +0100 | <c_wraith> | lenses fmap plenty. :P |
2022-12-04 00:21:24 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-04 00:21:28 +0100 | <mauke> | "good luck, I'm behind seven functors!" |
2022-12-04 00:21:45 +0100 | <EvanR> | I'm starting to think renaming fmap to map wouldn't be that great after all |
2022-12-04 00:23:12 +0100 | <ballast> | we should adopt the lisp style and let fffmap = fmap . fmap . fmap |
2022-12-04 00:23:30 +0100 | <EvanR> | rather, fmap should just take any number of arguments? |
2022-12-04 00:23:51 +0100 | <ballast> | i'm scared now |
2022-12-04 00:24:08 +0100 | <mniip> | pure = liftA @0; fmap = liftA @1 |
2022-12-04 00:24:31 +0100 | <EvanR> | liftA\0 liftA\1 |
2022-12-04 00:24:31 +0100 | <mauke> | :t fmap (fmap unfoldr) (fmap fmap (fmap fmap join)) (,) |
2022-12-04 00:24:32 +0100 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
2022-12-04 00:24:32 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 00:24:39 +0100 | talismanick | (~talismani@76.133.152.122) |
2022-12-04 00:25:20 +0100 | Guest192 | (~Guest19@69.181.32.7) |
2022-12-04 00:27:50 +0100 | <Guest192> | hey I'm new to haskell and i'm trying to print my commit messages from github to a web page in ihp |
2022-12-04 00:27:52 +0100 | <Guest192> | https://paste.tomsmeding.com/eWhrZJq0 |
2022-12-04 00:27:59 +0100 | <mauke> | :t fmap fmap fmap unfoldr (fmap (fmap fmap) (fmap fmap) join) (,) |
2022-12-04 00:28:00 +0100 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
2022-12-04 00:28:02 +0100 | <mauke> | h e l p |
2022-12-04 00:28:21 +0100 | <Guest192> | this is what I came up with so far but I cannot seem to get they types to match up for liftIO |
2022-12-04 00:29:03 +0100 | <Guest192> | I'm actually very lost as to how to proceed so any direction would be appreciated |
2022-12-04 00:29:17 +0100 | <mauke> | I don't know this web stuff, but I don't think you're supposed to do I/O in your views |
2022-12-04 00:29:37 +0100 | <dsal> | Guest192: General advice is to put type definitions on at least your toplevel bindings. I don't know what any of this is. |
2022-12-04 00:30:24 +0100 | <dsal> | The bindings will give you better error messages at times. That first one, at least, isn't unclear, but is it what you mean to be doing? |
2022-12-04 00:30:49 +0100 | EvanR | looks up ihp |
2022-12-04 00:31:05 +0100 | <Guest192> | okay they display on my editor i can update the text one moment plz |
2022-12-04 00:31:15 +0100 | <mauke> | why does CommitsView even exist here? isn't it supposed to contain the data you want to render? |
2022-12-04 00:32:48 +0100 | <Guest192> | EvanR: https://ihp.digitallyinduced.com/ |
2022-12-04 00:33:37 +0100 | <EvanR> | *The World's Most Powerful Programming Language At Your Fingertips* |
2022-12-04 00:33:41 +0100 | <EvanR> | damn |
2022-12-04 00:33:55 +0100 | <Guest192> | https://paste.tomsmeding.com/VhaJWi6b |
2022-12-04 00:34:15 +0100 | <Guest192> | CommitsView exists to render the page |
2022-12-04 00:34:32 +0100 | <Guest192> | I need to append I think to most of the stuff i say ehre |
2022-12-04 00:35:01 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-04 00:35:56 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 00:37:06 +0100 | <Guest192> | it gets imported here https://paste.tomsmeding.com/UatnF9dz |
2022-12-04 00:38:04 +0100 | <Guest192> | is there a difference between MonadIO and IO |
2022-12-04 00:39:01 +0100 | <mauke> | is there a difference between Num and Integer? |
2022-12-04 00:39:15 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-04 00:39:45 +0100 | <EvanR> | yes there is a difference |
2022-12-04 00:40:01 +0100 | <dsal> | Guest192: MonadIO is a type class that is used to allow arbitrary monads to provide access to IO. |
2022-12-04 00:40:11 +0100 | <EvanR> | one is a class, one is a type |
2022-12-04 00:40:28 +0100 | <EvanR> | :t liftIO |
2022-12-04 00:40:29 +0100 | <lambdabot> | MonadIO m => IO a -> m a |
2022-12-04 00:41:13 +0100 | <mauke> | :t fromInteger |
2022-12-04 00:41:14 +0100 | <lambdabot> | Num a => Integer -> a |
2022-12-04 00:41:52 +0100 | sammelweis | (~quassel@c-68-48-18-140.hsd1.mi.comcast.net) |
2022-12-04 00:42:00 +0100 | <Guest192> | if i understand correctly, liftIO provides the result of a MonadIO, which will be the left or right side depending on what happened |
2022-12-04 00:42:29 +0100 | <EvanR> | it's for running an IO action within your monad that's not IO |
2022-12-04 00:42:51 +0100 | <Guest192> | mmmm okay so I don't need this |
2022-12-04 00:43:15 +0100 | <Guest192> | What I want is to go from IO Html -> Html |
2022-12-04 00:43:17 +0100 | <EvanR> | or you can't do this if you aren't in a MonadIO |
2022-12-04 00:43:25 +0100 | <dsal> | Guest192: That's not a thing. |
2022-12-04 00:43:29 +0100 | Bocaneri | (~sauvin@user/Sauvin) |
2022-12-04 00:43:32 +0100 | Sauvin | (~sauvin@user/Sauvin) (Killed (NickServ (GHOST command used by Bocaneri))) |
2022-12-04 00:43:41 +0100 | emmanuelux | (~emmanuelu@user/emmanuelux) |
2022-12-04 00:43:46 +0100 | Bocaneri | Sauvin |
2022-12-04 00:43:47 +0100 | <EvanR> | IO Html contains an Html like the ls command contains a list of files |
2022-12-04 00:44:03 +0100 | <EvanR> | that's an old saying, I'm not sure if it helps xD |
2022-12-04 00:44:33 +0100 | <dsal> | You can put stuff in IO, but you can't take stuff out of IO. You can manipulate things in IO, though. |
2022-12-04 00:44:41 +0100 | <EvanR> | (I hate container analogies) |
2022-12-04 00:44:45 +0100 | <dsal> | The question, I suppose, is why do you want the Html out of the IO? Aren't you going to send the HTML somewhere? |
2022-12-04 00:45:49 +0100 | <mauke> | I think the real issue is, why are you trying to do controller/model stuff in your view? |
2022-12-04 00:47:23 +0100 | <Guest192> | no reason, just generated a static view using ihp's admin |
2022-12-04 00:47:37 +0100 | <EvanR> | pass what the view needs in as an argument |
2022-12-04 00:48:03 +0100 | <EvanR> | pull it in from somewhere else |
2022-12-04 00:48:23 +0100 | <Guest192> | mauke idk I was trying to do this https://paste.tomsmeding.com/2gUfbrjO and I just don't know where to proceed from here |
2022-12-04 00:48:46 +0100 | <Guest192> | ohh interesting! |
2022-12-04 00:49:07 +0100 | <Guest192> | EvanR I think I do need to do this somewhere |
2022-12-04 00:49:50 +0100 | <mauke> | yeah, the MarkupM Html thing sounds like it simply assembles HTML from data |
2022-12-04 00:50:05 +0100 | <mauke> | it's not supposed to reach out and fetch things on its own |
2022-12-04 00:50:11 +0100 | <Guest192> | the tutorial has a controller for blog posts and comments and i had to do this for getting a posts comments https://paste.tomsmeding.com/LtTzH4f3 |
2022-12-04 00:50:27 +0100 | <Guest192> | so i need to make a controller for this page and collect the messages there |
2022-12-04 00:50:34 +0100 | gqplox | (~textual@97e650e2.skybroadband.com) |
2022-12-04 00:50:35 +0100 | <Guest192> | and pass that into the view? |
2022-12-04 00:50:44 +0100 | <EvanR> | yeah you did I/O to get the data in the action, then you passed something to the view |
2022-12-04 00:51:09 +0100 | <mauke> | that's why I said the CommitsView thing was weird; it doesn't contain any data |
2022-12-04 00:51:55 +0100 | <mauke> | I assume the ShowView from the tutorial has a post (or postId) parameter? |
2022-12-04 00:52:06 +0100 | <EvanR> | what is going on here |
2022-12-04 00:52:07 +0100 | <EvanR> | render ShowView { .. } |
2022-12-04 00:52:15 +0100 | <mauke> | ~magic~ |
2022-12-04 00:52:43 +0100 | <EvanR> | why does web always require magic |
2022-12-04 00:53:01 +0100 | <gqplox> | yo guys im back with my advent of code, any feedback? http://sprunge.us/jJVvn8 |
2022-12-04 00:53:20 +0100 | <mauke> | EvanR: https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/record_wildcards.html |
2022-12-04 00:53:22 +0100 | <Guest192> | EvanR data ShowView = ShowView { post :: Include "comments" Post } |
2022-12-04 00:53:48 +0100 | <mniip> | gqplox, exercise: come up with a single pass "half" function |
2022-12-04 00:53:53 +0100 | <mauke> | in this case, it means ShowView{ post = post } -- where 'post' is a local variable in that function |
2022-12-04 00:54:10 +0100 | <mniip> | chunks is available in Data.List.Split.chunksOf |
2022-12-04 00:54:12 +0100 | albet70 | (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
2022-12-04 00:54:15 +0100 | <EvanR> | the space character threw me off |
2022-12-04 00:54:41 +0100 | <EvanR> | (render ShowView) { .. } -- xD |
2022-12-04 00:54:50 +0100 | <mauke> | yeah, nah |
2022-12-04 00:54:51 +0100 | <mniip> | take &&& drop = splitAt |
2022-12-04 00:55:02 +0100 | <gqplox> | <no location info>: error: |
2022-12-04 00:55:02 +0100 | <gqplox> | Could not find module ‘Data.List.Split’ |
2022-12-04 00:55:02 +0100 | <gqplox> | It is not a module in the current program, or in any known package. |
2022-12-04 00:55:26 +0100 | <mauke> | record update syntax is at the secret 11th precedence level |
2022-12-04 00:55:29 +0100 | <gqplox> | i think i tried before i get this |
2022-12-04 00:55:43 +0100 | <c_wraith> | you need to depend on the split package for that module |
2022-12-04 00:55:48 +0100 | <mauke> | even more powerful than function application |
2022-12-04 00:55:58 +0100 | <EvanR> | :t splitAt |
2022-12-04 00:55:58 +0100 | <lambdabot> | Int -> [a] -> ([a], [a]) |
2022-12-04 00:56:19 +0100 | <dsal> | gqplox: higher level, don't use a list for exactly two things. :) |
2022-12-04 00:56:36 +0100 | <EvanR> | in this case it works out better |
2022-12-04 00:56:47 +0100 | <EvanR> | because you can do foldl1 intersect on stuff |
2022-12-04 00:56:51 +0100 | <mniip> | dsal, using a list here helps unify later code |
2022-12-04 00:56:54 +0100 | <gqplox> | yeah I remembered from last time, But with lists i could solve on as many things as i wanted |
2022-12-04 00:57:10 +0100 | <gqplox> | first solution it had two i used a tuple then next time i saw it needed three so i thought to use a list |
2022-12-04 00:57:12 +0100 | <dsal> | Yeah, that's true. I did end up using a list myself, I think. |
2022-12-04 00:57:16 +0100 | <mniip> | I used `readInput1 = map (toListOf both . halves) . lines` |
2022-12-04 00:58:26 +0100 | <dsal> | I don't really like `head` here (partial function). I did a similar thing, but just folded my answer. |
2022-12-04 00:58:26 +0100 | <mauke> | gqplox: for comparison, here is mine: http://sprunge.us/DpHnCc |
2022-12-04 00:58:49 +0100 | <EvanR> | head isn't partial in this problem, because you're guaranteed to have duplicates xD |
2022-12-04 00:58:56 +0100 | <dsal> | Oh, I totally forgot I wrote a BitSet type. Should use that. |
2022-12-04 00:59:06 +0100 | <EvanR> | if you never use the bad input, partial functions are total! |
2022-12-04 00:59:45 +0100 | <dsal> | Heh. `head` is bad for two reasons: 1. it doesn't work if there are 0 results. 2. it silently works if there's more than 1 result. |
2022-12-04 01:00:01 +0100 | <dsal> | Just because someone promised me that won't be the case doesn't mean I'm going to listen. |
2022-12-04 01:00:06 +0100 | <EvanR> | 2. is also covered because the result of intersect will have all the same letter for another reason |
2022-12-04 01:00:12 +0100 | <EvanR> | dictated in the problem |
2022-12-04 01:00:20 +0100 | albet70 | (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
2022-12-04 01:00:44 +0100 | <EvanR> | so head is provably correct |
2022-12-04 01:01:09 +0100 | <dsal> | It's the difference between `priority . head` and `foldMap priority` |
2022-12-04 01:01:31 +0100 | <EvanR> | the problem doesn't even say there will be a power outage half way through the program run, but I'm not dealing with that |
2022-12-04 01:01:39 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) (Quit: Client closed) |
2022-12-04 01:01:40 +0100 | <dsal> | It says that, sure, but I'm pretty used to people lying to me about what the input they're going to give me is, and it's not inconvenient to avoid `head` |
2022-12-04 01:02:41 +0100 | <monochrom> | I have a UPS, so power outage is a solved problem, at least if the program just needs 5 minutes. :) |
2022-12-04 01:03:07 +0100 | <EvanR> | sometimes dealing with the impossible case is useless or impossible |
2022-12-04 01:03:13 +0100 | <EvanR> | or redundant (crash) |
2022-12-04 01:03:15 +0100 | <mauke> | everyone is fixating on 'head' and ignoring the problem with 'priority' |
2022-12-04 01:04:04 +0100 | <gqplox> | the otherwise? |
2022-12-04 01:04:21 +0100 | <mauke> | > isLower 'ß' |
2022-12-04 01:04:22 +0100 | <lambdabot> | True |
2022-12-04 01:04:26 +0100 | <EvanR> | that's not one of the letters |
2022-12-04 01:04:49 +0100 | <mauke> | it's a partial function disguised as a total function (by returning nonsense for invalid input) |
2022-12-04 01:04:53 +0100 | <gqplox> | the problem description stated that only 'a'..'z' ++ 'A' .. 'Z' will be inputs |
2022-12-04 01:05:06 +0100 | <dsal> | Sure, but you do parse more than that. |
2022-12-04 01:05:17 +0100 | <gqplox> | I should have put isUperr .. and then _ = error maybe? |
2022-12-04 01:05:34 +0100 | <EvanR> | crashing on invalid input... doesn't actually change anything |
2022-12-04 01:05:44 +0100 | <dsal> | Well, no, ß is lower, but it's going to give you a weird answer. |
2022-12-04 01:05:57 +0100 | <dsal> | > ord 'ß' - ord 'a' + 1 |
2022-12-04 01:05:58 +0100 | <lambdabot> | 127 |
2022-12-04 01:06:08 +0100 | <gqplox> | But i mean the point is my program is supposed to give an output for the specified input |
2022-12-04 01:06:15 +0100 | <mauke> | right |
2022-12-04 01:06:19 +0100 | <EvanR> | what if you parse the file and it contains bytes over 255? xD |
2022-12-04 01:06:32 +0100 | <EvanR> | unlikely but it would give weird answers! |
2022-12-04 01:06:34 +0100 | <geekosaur> | bytes?? |
2022-12-04 01:06:34 +0100 | <EvanR> | better check |
2022-12-04 01:06:34 +0100 | Topsi | (~Topsi@dialin-80-228-141-008.ewe-ip-backbone.de) (Read error: Connection reset by peer) |
2022-12-04 01:06:36 +0100 | <gqplox> | and if i know my input for the purpose of the problem, is ok right? i mean ofc for real code this would not be good practice |
2022-12-04 01:06:48 +0100 | <EvanR> | ok, characters above 1112111 |
2022-12-04 01:06:49 +0100 | <dsal> | Sure. Depends on what you want to get out of it and what you're asking for WRT input on your code. |
2022-12-04 01:06:51 +0100 | <geekosaur> | slightly more than "unlikely" |
2022-12-04 01:07:06 +0100 | <dsal> | For me, if it's not good practice in the real world, then I'd want to avoid it. |
2022-12-04 01:07:13 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Quit: Leaving) |
2022-12-04 01:07:17 +0100 | <gqplox> | Oh right, I agree asking for feedback the question was vaugue |
2022-12-04 01:07:23 +0100 | <EvanR> | yeah real code should properly parse the input and reject invalid |
2022-12-04 01:07:27 +0100 | <mauke> | my point is: if you're going to complain about head (because the sample input might be malformed), then you should also be wary of priority (because the sample input might be malformed) |
2022-12-04 01:07:35 +0100 | <gqplox> | Thanks for the info, I will keep that in mind |
2022-12-04 01:07:39 +0100 | <mauke> | personally, I'm not going to complain about head :-) |
2022-12-04 01:08:00 +0100 | <dsal> | Yeah, that's valid. I'm also parsing satisfying `isLetter` so I have the same bug. |
2022-12-04 01:08:03 +0100 | <mauke> | (but I did implement a proper range check on prio in my version) |
2022-12-04 01:08:10 +0100 | <gqplox> | tomorrow ill try to write it to handle a wider range |
2022-12-04 01:09:11 +0100 | <dsal> | OK. Mine only parses characters I told it are valid now. woo. |
2022-12-04 01:09:11 +0100 | <EvanR> | AoC has an FAQ about bugs in the problem. The answer is basically, "by the time you figured this out, so many people will have solved the problem, it's probably you" xD |
2022-12-04 01:10:23 +0100 | <mauke> | my solution for part 2: http://sprunge.us/pRoBDG |
2022-12-04 01:10:58 +0100 | Guest26 | (~Guest26@2001:999:488:5cc:e5b0:b492:b43a:8f46) (Ping timeout: 260 seconds) |
2022-12-04 01:11:34 +0100 | <dsal> | gqplox: In my case, I am using `Sum Int` instead of `Int` so I can just `fold` any values. `foldMap priority` will give the same answer as `priority . head` in the case where there's exactly one result, but will not fail for 0 and not discard findings > 1. If you do find yourself in either of those situations, it's a bug. Not impossible you get the wrong answer in the latter case, but program will crash in the former. |
2022-12-04 01:12:21 +0100 | <c_wraith> | EvanR: There *have* been a couple days in previous years where one problem set didn't match its expected answer |
2022-12-04 01:12:32 +0100 | <EvanR> | oof |
2022-12-04 01:12:53 +0100 | <dsal> | Also, there've been days where my solution would get the right answer for everyone's input by mine. Unrelated, but pretty annoying. |
2022-12-04 01:13:05 +0100 | <dsal> | s/by/but/ |
2022-12-04 01:13:27 +0100 | <gqplox> | mniip by single pass does that mean I can't use tail for example? |
2022-12-04 01:13:56 +0100 | <dsal> | single pass just means you don't start at the beginning of the list and walk down it more than once. |
2022-12-04 01:14:19 +0100 | <EvanR> | if a program is a pile of functions, and every function is correct, the program must be correct. QED? |
2022-12-04 01:14:41 +0100 | <c_wraith> | but haskell programs aren't piles of functions! they have those pesky IO bits thrown in |
2022-12-04 01:14:43 +0100 | <dsal> | That's the hard part. Every function does what I want it to do, but not what the problem wants done. |
2022-12-04 01:15:08 +0100 | <c_wraith> | main is notably *not* a function in Haskell. Ruining that one blog's title. |
2022-12-04 01:15:10 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
2022-12-04 01:15:21 +0100 | <EvanR> | which blog |
2022-12-04 01:15:35 +0100 | <mauke> | "main is usually a function" or something like that. C compiler diagnostic |
2022-12-04 01:16:09 +0100 | <mauke> | for when you do: unsigned char main[] = { ... }; // and write your whole program as inline machine code |
2022-12-04 01:16:33 +0100 | <EvanR> | not bad |
2022-12-04 01:17:10 +0100 | <mauke> | https://www.ioccc.org/1984/mullender/mullender.c |
2022-12-04 01:17:15 +0100 | <mauke> | absolute classic |
2022-12-04 01:17:48 +0100 | <dsal> | That's a short main. Is there a longer version? |
2022-12-04 01:18:12 +0100 | <mauke> | m__a__i__n |
2022-12-04 01:18:16 +0100 | geekosaur | wonders what CPU that was for |
2022-12-04 01:18:39 +0100 | <mauke> | CPUs, plural |
2022-12-04 01:18:48 +0100 | <mauke> | it ran on VAX and ... something? |
2022-12-04 01:19:08 +0100 | <mauke> | oh yeah, PDP-11 |
2022-12-04 01:19:18 +0100 | <geekosaur> | VAX and PDP11 would be likely since VAX-11 was a PDP-11 with a real MMU |
2022-12-04 01:19:36 +0100 | <gqplox> | http://sprunge.us/l1WW42 so is this a single pass or not? |
2022-12-04 01:19:46 +0100 | <mauke> | "The first word is a PDP-11 branch instruction that branches to the rest of the PDP code. On the Vax main is called with the calls instruction which uses the first word of the subroutine as a mask of registers to be saved. So on the Vax the first word can be anything. The real Vax code starts with the second word." |
2022-12-04 01:19:57 +0100 | <gqplox> | because of the init and last i think no? |
2022-12-04 01:20:10 +0100 | <c_wraith> | gqplox: also the calls to length |
2022-12-04 01:20:16 +0100 | <dsal> | that's a lot of passes. :) |
2022-12-04 01:20:20 +0100 | <gqplox> | oh yeah |
2022-12-04 01:20:30 +0100 | Guest26 | (~Guest26@2001:999:488:5cc:e5b0:b492:b43a:8f46) |
2022-12-04 01:20:31 +0100 | meooow | (~meooow@165.232.184.169) (Ping timeout: 265 seconds) |
2022-12-04 01:20:33 +0100 | meooow_ | (~meooow@165.232.184.169) |
2022-12-04 01:20:53 +0100 | <c_wraith> | that's O(n^2), in fact. |
2022-12-04 01:21:16 +0100 | <c_wraith> | I didn't bother doing it in a single pass, but I at least made it O(n) |
2022-12-04 01:21:28 +0100 | <EvanR> | half [] = ([],[]); half [a,b] = ([a],[b]); half (x:xs) = _ -- there I started your recursive solution for you |
2022-12-04 01:21:28 +0100 | <mauke> | ... leading straight to the other blog title, "accidentally quadratic" |
2022-12-04 01:21:49 +0100 | <gqplox> | half :: String -> [String] |
2022-12-04 01:21:49 +0100 | <gqplox> | half x = [take l x, drop l x] |
2022-12-04 01:21:49 +0100 | <gqplox> | where |
2022-12-04 01:21:49 +0100 | <gqplox> | l = length x `div` 2 |
2022-12-04 01:21:55 +0100 | <gqplox> | this is o n tho right? |
2022-12-04 01:22:15 +0100 | <c_wraith> | yes, that's O(n). several passes, but a fixed number of them. |
2022-12-04 01:23:28 +0100 | <c_wraith> | in particular, each of length, take, and drop is a separate pass. |
2022-12-04 01:24:10 +0100 | <gqplox> | in haskell is length O(n)? can you not just set a value somewhere with the value of length and update that |
2022-12-04 01:24:20 +0100 | <dsal> | Set it where? |
2022-12-04 01:24:26 +0100 | <c_wraith> | well, length of lists is O(n) |
2022-12-04 01:24:30 +0100 | <EvanR> | you were given a list, not list + length attached |
2022-12-04 01:24:36 +0100 | <c_wraith> | Other data structures do other things. |
2022-12-04 01:24:37 +0100 | <EvanR> | unfortunately |
2022-12-04 01:25:03 +0100 | <EvanR> | so you could measure it or do something else |
2022-12-04 01:25:05 +0100 | <c_wraith> | Data.Sequence.Seq essentially *does* have a length attached. As well as just being a totally different structure. |
2022-12-04 01:25:10 +0100 | <gqplox> | i mean in the implementation of it? |
2022-12-04 01:25:13 +0100 | <mauke> | a Haskell list is literally¹ just: data List a = Nil | Cons a (List a) |
2022-12-04 01:25:15 +0100 | <mauke> | 1) not literally |
2022-12-04 01:25:24 +0100 | <gqplox> | but i guess that doesn't work with the way hsakell is |
2022-12-04 01:25:33 +0100 | <geekosaur> | you want a Vector not a List |
2022-12-04 01:25:34 +0100 | <c_wraith> | gqplox: That would slow down a lot of common use cases |
2022-12-04 01:25:37 +0100 | <gqplox> | it would be kind of a special case |
2022-12-04 01:25:47 +0100 | <mauke> | it's actually data [a] = [] | (:) a [a], but that's a syntax error |
2022-12-04 01:25:48 +0100 | <geekosaur> | lists are loops encoded as data |
2022-12-04 01:25:53 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-04 01:26:01 +0100 | <c_wraith> | gqplox: taking the length of a list is not a common operation. It shouldn't be optimized for. |
2022-12-04 01:26:23 +0100 | <EvanR> | at least, length of a super long list isn't common |
2022-12-04 01:26:33 +0100 | <dsal> | Lists can be *really* long. |
2022-12-04 01:26:41 +0100 | <EvanR> | because the author probably prematurely optimized by not using a list |
2022-12-04 01:27:05 +0100 | <dsal> | :t length |
2022-12-04 01:27:06 +0100 | <lambdabot> | Foldable t => t a -> Int |
2022-12-04 01:27:12 +0100 | <dsal> | It's easy to make a list so large an Int can't hold the length. |
2022-12-04 01:27:21 +0100 | <c_wraith> | If you really want to work with the length of a data structure, there are definitely better options than lists |
2022-12-04 01:27:44 +0100 | <mauke> | > repeat 4 |
2022-12-04 01:27:45 +0100 | <lambdabot> | [4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4... |
2022-12-04 01:27:48 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
2022-12-04 01:27:51 +0100 | <mauke> | what a long list |
2022-12-04 01:27:55 +0100 | <EvanR> | longer than Int, check |
2022-12-04 01:28:15 +0100 | <dsal> | You can make an integer length function to get the size of it, though. |
2022-12-04 01:28:38 +0100 | <EvanR> | unless you're an ultrafinitist, and you're chosen max bound is less than maxBound :: Int |
2022-12-04 01:28:43 +0100 | <EvanR> | your |
2022-12-04 01:29:03 +0100 | <mauke> | struct node loop = { 4, &loop }; |
2022-12-04 01:29:28 +0100 | <EvanR> | > genericLength (repeat 4) :: Integer |
2022-12-04 01:29:35 +0100 | <dsal> | @src repeat |
2022-12-04 01:29:36 +0100 | <lambdabot> | repeat x = xs where xs = x : xs |
2022-12-04 01:29:37 +0100 | <lambdabot> | mueval-core: Time limit exceeded |
2022-12-04 01:29:37 +0100 | <lambdabot> | mueval.real: ExitFailure 1 |
2022-12-04 01:30:00 +0100 | <dsal> | Oh, I didn't know genericLength was a thing. That's neat. |
2022-12-04 01:30:46 +0100 | <EvanR> | > genericLength (replicate 257 'a') :: Word8 |
2022-12-04 01:30:48 +0100 | <lambdabot> | 1 |
2022-12-04 01:31:01 +0100 | <dsal> | genericLength isn't very generic. |
2022-12-04 01:31:08 +0100 | <dsal> | :t genericLength |
2022-12-04 01:31:09 +0100 | <lambdabot> | Num i => [a] -> i |
2022-12-04 01:31:24 +0100 | <monochrom> | Taking the length of a list is not a common operation except for very short lists, it shouldn't encourage safe usage for long lists. >:) |
2022-12-04 01:31:30 +0100 | <EvanR> | should it map to a MetricSpace or something? xD |
2022-12-04 01:31:45 +0100 | <mauke> | > genericLength (replicate 257 'a') :: Float |
2022-12-04 01:31:46 +0100 | <lambdabot> | 257.0 |
2022-12-04 01:31:49 +0100 | <c_wraith> | it should map to an Enum |
2022-12-04 01:32:03 +0100 | <mauke> | > genericLength (replicate 257 'a') :: Complex Float |
2022-12-04 01:32:03 +0100 | <c_wraith> | just be a bunch of calls to succ |
2022-12-04 01:32:05 +0100 | <lambdabot> | 257.0 :+ 0.0 |
2022-12-04 01:32:16 +0100 | <dsal> | > superGenericLength Nothing :: Integer |
2022-12-04 01:32:17 +0100 | <lambdabot> | 0 |
2022-12-04 01:32:26 +0100 | <dsal> | superGenericLength :: (Foldable f, Num i) => f a -> i; superGenericLength = getSum . foldMap (const 1) |
2022-12-04 01:32:42 +0100 | <EvanR> | nothing should operate on lists ever |
2022-12-04 01:32:47 +0100 | <EvanR> | only Foldables |
2022-12-04 01:33:07 +0100 | <monochrom> | Foldable has length too :) |
2022-12-04 01:33:09 +0100 | <EvanR> | nothing should use map, only fmap |
2022-12-04 01:33:22 +0100 | <EvanR> | nothing should use return only pure |
2022-12-04 01:33:30 +0100 | <dsal> | ^ I can't tell if you're mocking me. |
2022-12-04 01:34:05 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 01:34:58 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 01:35:00 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
2022-12-04 01:35:46 +0100 | <mauke> | :t fmap fmap fmap fmap fmap getSum foldMap pure 1 |
2022-12-04 01:35:47 +0100 | <lambdabot> | error: |
2022-12-04 01:35:47 +0100 | <lambdabot> | • Couldn't match type ‘Sum b’ with ‘t0 a0 -> t1’ |
2022-12-04 01:35:48 +0100 | <lambdabot> | Expected type: (((a0 -> t1) -> b) -> (t1 -> a0 -> t1) -> t1 -> b) |
2022-12-04 01:35:51 +0100 | <mauke> | dang |
2022-12-04 01:36:11 +0100 | <dsal> | I'm pretty sure I've written that before. |
2022-12-04 01:36:48 +0100 | <EvanR> | never compose just functions, only semigroupoids! |
2022-12-04 01:36:53 +0100 | <mauke> | oh, I'm dumb |
2022-12-04 01:37:00 +0100 | <dsal> | we need variants of fmap like all the car/cdr variations. |
2022-12-04 01:37:02 +0100 | <iqubic> | What are semigroupoids? |
2022-12-04 01:37:09 +0100 | <dsal> | iqubic: monoids without mempty |
2022-12-04 01:37:18 +0100 | <EvanR> | category without necessarily id |
2022-12-04 01:37:24 +0100 | <iqubic> | Isn't that just a semigroup? |
2022-12-04 01:37:42 +0100 | <dsal> | Yeah, but you get a lot of cool operations you are annoyed are missing from base. |
2022-12-04 01:37:52 +0100 | <gqplox> | btw if I want to make a function half String -> [String] and I used splitAt which gives (String, String) what's the cleanest way to write it? |
2022-12-04 01:37:55 +0100 | <dsal> | https://hackage.haskell.org/package/semigroupoids |
2022-12-04 01:37:58 +0100 | <EvanR> | a semigroup is a semigroupoid with only 1 object |
2022-12-04 01:38:37 +0100 | <iqubic> | gqplox: I literally asked the same thing yesterday. |
2022-12-04 01:38:46 +0100 | <dsal> | @hoogle (a,a) -> [a] |
2022-12-04 01:38:47 +0100 | <lambdabot> | Data.Ix.Enum range :: Enum a => (a, a) -> [a] |
2022-12-04 01:38:47 +0100 | <lambdabot> | Data.Ix range :: Ix a => (a, a) -> [a] |
2022-12-04 01:38:47 +0100 | <lambdabot> | GHC.Arr range :: Ix a => (a, a) -> [a] |
2022-12-04 01:38:54 +0100 | <dsal> | There's a bunch of useless answers. |
2022-12-04 01:39:03 +0100 | <iqubic> | I used biList |
2022-12-04 01:39:09 +0100 | <iqubic> | @hoogle biList |
2022-12-04 01:39:09 +0100 | <lambdabot> | Data.Bifoldable biList :: Bifoldable t => t a a -> [a] |
2022-12-04 01:39:09 +0100 | <lambdabot> | RIO.Prelude biList :: Bifoldable t => t a a -> [a] |
2022-12-04 01:39:09 +0100 | <lambdabot> | Relude.Foldable.Reexport biList :: Bifoldable t => t a a -> [a] |
2022-12-04 01:39:23 +0100 | <EvanR> | half sounds like it returns 1/2 of something |
2022-12-04 01:39:25 +0100 | <iqubic> | I'm not sure if that's the best way to do it. |
2022-12-04 01:39:35 +0100 | <EvanR> | this problem is to bisect a string or list into 2 parts |
2022-12-04 01:39:47 +0100 | <EvanR> | just jargon policing |
2022-12-04 01:40:10 +0100 | <iqubic> | EvanR: This is most likely an Advent Of Code related question. |
2022-12-04 01:40:17 +0100 | <EvanR> | yes |
2022-12-04 01:40:24 +0100 | <dsal> | EvanR just got that Radiohead song stuck in my head. |
2022-12-04 01:41:13 +0100 | <iqubic> | What is this complex diagram on the semigroupoids Hackage page |
2022-12-04 01:41:28 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2022-12-04 01:41:29 +0100 | <EvanR> | it's ed kmett |
2022-12-04 01:41:36 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) |
2022-12-04 01:41:51 +0100 | <iqubic> | What the heck are Divise and Decide and their subclasses! |
2022-12-04 01:42:25 +0100 | <dsal> | The contravariant analogue of Apply; it is Divisible without conquer. |
2022-12-04 01:42:34 +0100 | <gqplox> | oh nice |
2022-12-04 01:42:35 +0100 | <iqubic> | I understand what Contravariant is. |
2022-12-04 01:42:40 +0100 | <gqplox> | thank you cubic |
2022-12-04 01:42:48 +0100 | <iqubic> | dsal: I have no idea what conquer is. |
2022-12-04 01:43:00 +0100 | <dsal> | Conquer acts as an identity for combining Divisible functors. |
2022-12-04 01:43:04 +0100 | <iqubic> | Apply, Bind, and Extend (not shown) give rise the Static, Kleisli and Cokleisli semigroupoids respectively. |
2022-12-04 01:43:08 +0100 | <dsal> | I've not used all of the things. |
2022-12-04 01:43:14 +0100 | <iqubic> | We're just making up words at this point... |
2022-12-04 01:43:29 +0100 | <dsal> | Some of them are just cowords. |
2022-12-04 01:43:29 +0100 | <EvanR> | all words are made up |
2022-12-04 01:43:51 +0100 | <edwardk> | it is? |
2022-12-04 01:44:12 +0100 | edwardk | tunes in. |
2022-12-04 01:44:25 +0100 | <iqubic> | edwardk: What's the point of the semigroupoid package? |
2022-12-04 01:44:44 +0100 | <dsal> | I found the semigroupoid package the other way -- I needed things that I expected from base that it provided. |
2022-12-04 01:45:04 +0100 | <edwardk> | Map k -- can almost be a monad, but can't implement return. Lots of other things can almost be Applicative but lack pure. When working with Comonads in particular. |
2022-12-04 01:45:05 +0100 | <dsal> | e.g., Data.Semigroup.Foldable |
2022-12-04 01:45:21 +0100 | <dsal> | We were discussing Alt yesterday. |
2022-12-04 01:45:34 +0100 | <edwardk> | I needed ways to fold over non-empty containers with a semigroup |
2022-12-04 01:45:36 +0100 | <dsal> | `Either a` can't be `Alternative` |
2022-12-04 01:45:45 +0100 | <iqubic> | I see. |
2022-12-04 01:45:56 +0100 | <gqplox> | @pl half x = biList (splitAt (length x `div` 2) x) |
2022-12-04 01:45:57 +0100 | <lambdabot> | half = biList . (splitAt =<< (`div` 2) . length) |
2022-12-04 01:46:07 +0100 | <gqplox> | lol |
2022-12-04 01:46:25 +0100 | <dsal> | Sometimes @pl is "make my code a lot worse" |
2022-12-04 01:46:42 +0100 | <EvanR> | seems like biList is a bit much just to make \(x,y) -> [x,y] |
2022-12-04 01:47:00 +0100 | <gqplox> | yeah I agree |
2022-12-04 01:47:03 +0100 | <iqubic> | Wait... Why can't you Data.Map.Empty as the identity for a potential Map k Monad? |
2022-12-04 01:47:06 +0100 | <gqplox> | still, cool to know about |
2022-12-04 01:47:09 +0100 | <edwardk> | the Category class is pretty restrictive given that it has to work for every object in its argument kind, so you couldn't implement something where you had restricted categories that used a constraint on the objects, hence the Ob machinery in there and Semigroupoids. |
2022-12-04 01:47:22 +0100 | <edwardk> | Useful when you want to build a category for matrices for instances. |
2022-12-04 01:47:29 +0100 | <iqubic> | I understand. |
2022-12-04 01:47:57 +0100 | <edwardk> | iqubic: Empty >>= k = Empty |
2022-12-04 01:48:09 +0100 | <edwardk> | iqubic: fails to serve as return |
2022-12-04 01:48:17 +0100 | <iqubic> | If we have biapply, why is there no bipure? |
2022-12-04 01:48:44 +0100 | <edwardk> | iqubic: because there's at least 2-3 notions of it. |
2022-12-04 01:48:53 +0100 | <iqubic> | Oh? |
2022-12-04 01:49:02 +0100 | <edwardk> | well, first of all i don't like Pointed-style classes |
2022-12-04 01:49:20 +0100 | <edwardk> | so a version with _just_ bipure has the problem that Pointed as a superclass of Applicative has |
2022-12-04 01:49:35 +0100 | <edwardk> | you get the point but no non-free laws, so its basically useless |
2022-12-04 01:50:22 +0100 | <edwardk> | a version where it comes with the class? Well we have Biapplicative. Given the ability to rewrite the class hierarchy? I'd put Biapply or whatever as a superclass of it, but with all the others borked doing one just creates asymmetries and pain |
2022-12-04 01:50:22 +0100 | <iqubic> | Why are Pointed-style classes not so good? Is it because you get an identity, but not the corresponding operation? |
2022-12-04 01:51:00 +0100 | <edwardk> | iqubic: given a PointedFunctor there's very little you can do with it. you get one law fmap f . pure = pure . f -- but that law is a free theorem |
2022-12-04 01:51:15 +0100 | <iqubic> | Yeah, that makes sense. |
2022-12-04 01:51:18 +0100 | <edwardk> | on the other hand the semi-applicative Apply style classes actually come with a useful law |
2022-12-04 01:51:35 +0100 | <gqplox> | also guys can I ask a general question, how much of this stuff that you're talking about now is used / required in writing good haskell software? im still very much a beginner but i was thinking id get to the point of writing somewhat useful software kind of soon. |
2022-12-04 01:52:14 +0100 | <edwardk> | but if you put _both_ of them together then you fuck your users over again. because now things will infer as only needing Biapply + Bipure or whatever it is called, and you'll silently omit the fact that you need the law that says the applicative-like operation and the pure-like operation need to be compatible! |
2022-12-04 01:52:32 +0100 | <dsal> | gqplox: There are a few things you use *all* the time and there are things you don't often want to use. Not sure which "this stuff" you're referring to, though. |
2022-12-04 01:52:46 +0100 | <edwardk> | so given that when you have a Pointed class _it has no laws_ interoperating with Functor whatsoever, I instead just make Pointed its own class, with no PointedFunctor composite |
2022-12-04 01:52:54 +0100 | <edwardk> | and then actively discourage people using it |
2022-12-04 01:53:17 +0100 | <edwardk> | because otherwise you get abominations like 'foldMap pure' in user code which is completely impossible to reason about |
2022-12-04 01:53:27 +0100 | <iqubic> | Yeah, that makes a lot of sense. |
2022-12-04 01:53:30 +0100 | <edwardk> | because consider its behavior when returning a [a], Maybe a or Set a. |
2022-12-04 01:53:38 +0100 | <edwardk> | each does something completely different and unrelated |
2022-12-04 01:53:59 +0100 | <gqplox> | i don't know really, I'm just seeing a lot of new words haha |
2022-12-04 01:54:06 +0100 | <gqplox> | biapplicatives semigroupoids comonads |
2022-12-04 01:54:41 +0100 | <iqubic> | Much of these words are things you can mostly ignore. |
2022-12-04 01:54:42 +0100 | <edwardk> | if you are going to work or provide a user with a typeclass, it should be possible to reason and work at the level of the class, not just reason instance by instance because you happen to be using it for some lawless syntactic sugar |
2022-12-04 01:54:43 +0100 | Guest26 | (~Guest26@2001:999:488:5cc:e5b0:b492:b43a:8f46) (Ping timeout: 260 seconds) |
2022-12-04 01:54:43 +0100 | <dsal> | Words are neat for distinct concepts because they're easier to search for. edwardk did a talk on that at some point. |
2022-12-04 01:54:49 +0100 | <EvanR> | start with functors |
2022-12-04 01:54:58 +0100 | <EvanR> | I just keep repeating this advice xD |
2022-12-04 01:55:12 +0100 | <gqplox> | ok cool thank you :) |
2022-12-04 01:55:16 +0100 | <iqubic> | Start with functors, then go to applicatives |
2022-12-04 01:55:24 +0100 | <dsal> | Yeah, classes you're going to use every day: Functors, Applicative Functors, Monads. Monoids start getting really useful fast. |
2022-12-04 01:55:34 +0100 | <edwardk> | gqplox: the stuff i'm talking about here isnt necessary at all to get started with haskell. |
2022-12-04 01:56:07 +0100 | <edwardk> | gqplox: eventually you'll start seeing the same kind of operations on lots of different types, and that might get you curious to see if there's a name for the patterns you are seeing. that's when some of these more exotic sounding terms will have more relevance |
2022-12-04 01:56:26 +0100 | <gqplox> | alright, that makes sense |
2022-12-04 01:56:28 +0100 | <gqplox> | thank you |
2022-12-04 01:56:31 +0100 | <dsal> | e.g., you used foldr1 yesterday. What does that do on empty input? |
2022-12-04 01:56:39 +0100 | <dsal> | > foldr1 (+) [] |
2022-12-04 01:56:40 +0100 | <lambdabot> | *Exception: Prelude.foldr1: empty list |
2022-12-04 01:57:28 +0100 | <dsal> | semigroupoids has a variant that won't compile with non-empty input. You'll reach for that when you start thinking "how do I stop having these partial function bugs?" |
2022-12-04 01:57:36 +0100 | <gqplox> | oh yeah i was happy i found that, initially i did something like foldr with the base conditition as ['a'..'z'] ++ ['A'..'Z'] lol |
2022-12-04 01:57:38 +0100 | <edwardk> | gqplox: i believe in trying to actually give things the right name from mathematics. why? because then when i write down a piece of code, later on someone can google for that term, find something from the 1970s or before i was born that tells me more about my code than i knew. if i make up all the words and all the laws for my constructions then users can only reflect back to me bad understandings of my own ideas. |
2022-12-04 01:57:49 +0100 | <dsal> | er, won't compile without guaranteeing non-empty input |
2022-12-04 01:58:04 +0100 | <gqplox> | oh right that sounds useful |
2022-12-04 01:58:38 +0100 | acidjnk | (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-04 01:58:49 +0100 | <mauke> | gqplox: I'd say Functor and Monoid are surprisingly simple and useful classes in Haskell, despite the weird names. the rest ... eh, you might come across them or not |
2022-12-04 01:58:53 +0100 | <EvanR> | the next 700 programming languages tend to rename things, or use existing names for something previously unrelated. So I appreciate that |
2022-12-04 01:59:18 +0100 | <EvanR> | our associative arrays are different ism |
2022-12-04 01:59:30 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
2022-12-04 01:59:32 +0100 | <gqplox> | also does recursion become easy after some time? I get if for basic simple functions but for example i was reading the source for splitAt just now and its not immediately obvious, id have to draw the example on paper to full get it |
2022-12-04 01:59:46 +0100 | <mauke> | @src splitAt |
2022-12-04 01:59:46 +0100 | <lambdabot> | splitAt n xs = (take n xs, drop n xs) |
2022-12-04 01:59:54 +0100 | <mauke> | well, that's cheating |
2022-12-04 02:00:00 +0100 | <dsal> | Another way to look at that is like, in go for example, there's exactly one kind of loop: `for` (ignore recursion since that's not really used). Anything you do more than one time is "a for loop." In haskell, we've got names for the different kinds of things you're doing. Some of them are more… colloquial (fold and unfold for catamorphism and anamorphism), but having distinct names makes a lot of stuff better. |
2022-12-04 02:00:20 +0100 | <gqplox> | http://sprunge.us/4FUbX0 |
2022-12-04 02:00:44 +0100 | <dsal> | gqplox: recursion is pretty natural, but there's a lot of cases that are already solved for you so you don't need explicit recursion most of the time. |
2022-12-04 02:00:50 +0100 | <gqplox> | yeah true, I guess it is beneficial to have specific terminology |
2022-12-04 02:01:15 +0100 | <EvanR> | this game infinite turtles does a pretty good job and getting you into the recursive mood |
2022-12-04 02:01:34 +0100 | <dsal> | But whole lots of recursion you might be writing may just be `foldr`. |
2022-12-04 02:01:37 +0100 | <EvanR> | to solve the puzzle... assume you have a working solution already, it just doesn't work for the base |
2022-12-04 02:01:50 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 02:02:12 +0100 | <dsal> | @src length |
2022-12-04 02:02:12 +0100 | <lambdabot> | Source not found. Maybe if you used more than just two fingers... |
2022-12-04 02:02:38 +0100 | <mauke> | gqplox: yes, simple cases of recursion become much easier to understand with practice |
2022-12-04 02:02:42 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-04 02:03:00 +0100 | <mauke> | gqplox: e.g. for me, most of the complexity of splitAt isn't in the recursive part, but everything else :-) |
2022-12-04 02:03:06 +0100 | brettgilio | (~brettgili@x-irc.gq) |
2022-12-04 02:04:26 +0100 | <gqplox> | also unrelated but its a bit annoying that i lose all the chat history when i log out each time of irc |
2022-12-04 02:04:35 +0100 | <dsal> | A lot of times, though, you just don't need explicit recursion. There are all these morphisms ready for you. |
2022-12-04 02:04:36 +0100 | <EvanR> | what client are you using |
2022-12-04 02:04:38 +0100 | <mauke> | it helps that [ ] is a recursive type, so recursive functions on lists tend to follow a certain pattern |
2022-12-04 02:04:38 +0100 | califax | (~califax@user/califx) |
2022-12-04 02:04:41 +0100 | <gqplox> | i mean sometimes i might miss useful chat |
2022-12-04 02:04:50 +0100 | <dsal> | There's logs in the topic |
2022-12-04 02:04:56 +0100 | <gqplox> | yeah, i think the where clause threw me off |
2022-12-04 02:05:23 +0100 | <gqplox> | i just need to not be lazy and write it down once i think |
2022-12-04 02:05:29 +0100 | <gqplox> | im using Textual |
2022-12-04 02:06:20 +0100 | <EvanR> | it should have a local log keeping function |
2022-12-04 02:06:34 +0100 | <dsal> | It's logging out that's the issue. |
2022-12-04 02:06:38 +0100 | <dsal> | I've not logged out of my irc client in years. |
2022-12-04 02:06:41 +0100 | <iqubic> | So I know things like "newtype Predicate a = Predicate { runPredicate :: a -> Bool }" can only have a contravariant functor instance and not a covariant, becase the type parameter is in a negative position. Do contravariant applicatives and contravariant monads exist? |
2022-12-04 02:06:49 +0100 | <gqplox> | but i lost my registration key and cant find it in my emails and reset my mac so i might not be for very long haha, currently on the free trial |
2022-12-04 02:06:51 +0100 | <EvanR> | oh yeah, that needs other solutions |
2022-12-04 02:07:24 +0100 | <EvanR> | contravariant monads = comonad? |
2022-12-04 02:07:32 +0100 | <gqplox> | i just turn off my pc when im not using it |
2022-12-04 02:07:38 +0100 | <iqubic> | Yeah... I just realize that, EvanR |
2022-12-04 02:07:54 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
2022-12-04 02:08:54 +0100 | <dsal> | gqplox: If you want some light reading: https://maartenfokkinga.github.io/utwente/mmf91m.pdf |
2022-12-04 02:08:58 +0100 | <mauke> | https://what.thedailywtf.com/assets/uploads/files/1670107165928-c7260411-d79f-43c0-bc90-c6173eb1af… |
2022-12-04 02:09:57 +0100 | <iqubic> | I just found Data.Functor.Contravariant.Divisible from edwardk's Contravariant package. |
2022-12-04 02:10:00 +0100 | <edwardk> | EvanR: comonad /= contravariant monad |
2022-12-04 02:10:06 +0100 | <edwardk> | contravariant functors exist |
2022-12-04 02:10:20 +0100 | <edwardk> | both monads and comonads are _co_variant functors |
2022-12-04 02:10:25 +0100 | <EvanR> | doh |
2022-12-04 02:10:34 +0100 | <gqplox> | hmm I shall see how far i can get through that dsal |
2022-12-04 02:10:40 +0100 | <edwardk> | e.g. Comonad has Functor as a superclass |
2022-12-04 02:10:48 +0100 | <EvanR> | of course |
2022-12-04 02:10:48 +0100 | <iqubic> | Is Divisible the contravariant form of Applicative? |
2022-12-04 02:11:01 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 02:11:05 +0100 | <edwardk> | iqubic: effectively, yes |
2022-12-04 02:11:08 +0100 | <gqplox> | anyway bye for now guys |
2022-12-04 02:11:13 +0100 | <dsal> | gqplox: It's not super casual, but it explains a few concepts and why it's cool to have names for things *and* reusable implementations that can be combined and optimized. |
2022-12-04 02:11:17 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 02:11:29 +0100 | <gqplox> | okay |
2022-12-04 02:11:37 +0100 | ksqsf | (~user@134.209.106.31) |
2022-12-04 02:11:49 +0100 | <mauke> | if you know the name of a thing, you have power over it |
2022-12-04 02:11:50 +0100 | <edwardk> | Decidable slots in like contravariant Alternative as well |
2022-12-04 02:12:28 +0100 | <iqubic> | As a wise lady once said: "fear of a name only increases fear of the thing itself" |
2022-12-04 02:12:46 +0100 | <edwardk> | Divisible and Decidable are one of those rare occasion when i was comfortable making up a name. (I did a lot of that for the contravariant and comonad side of the ecosystem, because cofoo and contrafoo generally doesn't give a lot of good intuitions) |
2022-12-04 02:13:33 +0100 | <yushyin> | iqubic: JKR? |
2022-12-04 02:13:34 +0100 | <gqplox> | was the wise lady Dumbledore? haha |
2022-12-04 02:13:37 +0100 | <iqubic> | Where can I go to learn more about how Divisible and Decidable work in Haskell? |
2022-12-04 02:13:48 +0100 | <edwardk> | iqubic: re: "contravariant monads" that can't exist. |
2022-12-04 02:13:54 +0100 | <iqubic> | yushyin: Yes. It's a Hermione quote. |
2022-12-04 02:13:59 +0100 | <edwardk> | but the contravariant applicative/alternatives can |
2022-12-04 02:14:15 +0100 | <iqubic> | edwardk: I guess that makes some sort of sence. |
2022-12-04 02:14:22 +0100 | <iqubic> | s/sence/sense/ |
2022-12-04 02:14:45 +0100 | <edwardk> | iqubic: https://www.youtube.com/watch?v=cB8DapKQz-I is when i introduced them |
2022-12-04 02:14:56 +0100 | <gqplox> | wait really? I swear it was Dumbledore |
2022-12-04 02:15:19 +0100 | <iqubic> | Thank you for that video. I'll watch it after getting dinner. |
2022-12-04 02:15:24 +0100 | <iqubic> | Bye for now folks. |
2022-12-04 02:16:06 +0100 | <edwardk> | later iqubic |
2022-12-04 02:16:50 +0100 | <iqubic> | Thanks for helping a girl understand this stuff better. |
2022-12-04 02:17:01 +0100 | <edwardk> | gqplox: re: losing context every time you log out of irc. options exist: using matrix to connect instead of an irc client is one option. using irccloud so your connection persists is another (but costs $) |
2022-12-04 02:17:26 +0100 | <gqplox> | oh right nice ill look into those, thanks you |
2022-12-04 02:17:35 +0100 | <gqplox> | oh i think i've used matrix before |
2022-12-04 02:18:03 +0100 | <iqubic> | Also, thank you so much for making the lens package. I use it all the time in my haskell code. I love being able to do complex traversals of my data. |
2022-12-04 02:18:05 +0100 | <yushyin> | gqplox: sr.ht can provide you with a free bouncer, afaik |
2022-12-04 02:18:16 +0100 | <edwardk> | if you have some kind of linux server nearby you can also set up some kind of bouncer or find an irc bouncer service |
2022-12-04 02:18:30 +0100 | <iqubic> | Also, I love lenses over state. |
2022-12-04 02:18:39 +0100 | <gqplox> | ah right |
2022-12-04 02:18:39 +0100 | <iqubic> | And now I really must go. |
2022-12-04 02:18:41 +0100 | <edwardk> | i'm rather partial to them as well =) |
2022-12-04 02:19:00 +0100 | king_gs | (~Thunderbi@187.201.204.122) |
2022-12-04 02:19:44 +0100 | <edwardk> | gqplox: in the ancient past i used to use something like screen or mosh or tmux and just keep an ircii session open on a machine somewhere, but i confess i've gotten too lazy and kind of like the conveniences of using a browser-based irc client |
2022-12-04 02:19:51 +0100 | <gqplox> | oh i thinnk its for paid users |
2022-12-04 02:20:34 +0100 | <gqplox> | which client do you use edward? irccloud? |
2022-12-04 02:21:15 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 02:23:13 +0100 | <ephemient> | irccloud works for free users too, you just have some limitations. |
2022-12-04 02:23:34 +0100 | ksqsf | (~user@134.209.106.31) (Ping timeout: 256 seconds) |
2022-12-04 02:25:06 +0100 | causal | (~user@50.35.85.7) (Quit: WeeChat 3.7.1) |
2022-12-04 02:30:01 +0100 | gqplox[m] | (~gqploxmat@2001:470:69fc:105::2:d10d) |
2022-12-04 02:30:20 +0100 | <dsal> | I've been using irccloud for a long time. It's pretty great. |
2022-12-04 02:30:34 +0100 | <gqplox[m]> | hi |
2022-12-04 02:30:37 +0100 | <gqplox> | hello |
2022-12-04 02:30:58 +0100 | <EvanR> | I saw hi then hello |
2022-12-04 02:31:04 +0100 | <edwardk> | i use irccloud just out of convenience |
2022-12-04 02:31:05 +0100 | <EvanR> | radio check passed |
2022-12-04 02:31:21 +0100 | <gqplox[m]> | nice :) |
2022-12-04 02:31:23 +0100 | <edwardk> | mostly so i can flip over to check irc on my phone when i'm out and about |
2022-12-04 02:31:33 +0100 | <dsal> | Yeah, while being the same user. :) |
2022-12-04 02:31:36 +0100 | <gqplox[m]> | well from now on I guess ill use this |
2022-12-04 02:31:44 +0100 | <gqplox[m]> | goodnight guys |
2022-12-04 02:31:48 +0100 | <edwardk> | matrix has a lot of afficionados on here |
2022-12-04 02:31:54 +0100 | gqplox | (~textual@97e650e2.skybroadband.com) (Quit: Textual IRC Client: www.textualapp.com) |
2022-12-04 02:31:54 +0100 | <edwardk> | night, ggplox[m] |
2022-12-04 02:31:57 +0100 | dsal | should try matrix again sometime |
2022-12-04 02:32:20 +0100 | king_gs1 | (~Thunderbi@187.201.204.122) |
2022-12-04 02:32:23 +0100 | king_gs | (~Thunderbi@187.201.204.122) (Quit: king_gs) |
2022-12-04 02:32:24 +0100 | king_gs1 | king_gs |
2022-12-04 02:32:27 +0100 | <geekosaur> | yeh, I use matrix on my phone. but keep irc on the desktop because matrix sucks for admin stuff irc-side |
2022-12-04 02:33:20 +0100 | king_gs | (~Thunderbi@187.201.204.122) (Client Quit) |
2022-12-04 02:34:07 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds) |
2022-12-04 02:34:24 +0100 | <yushyin> | weechat/glowing-bear/weechat-android for me |
2022-12-04 02:36:26 +0100 | <sm> | element matrix client on all machines here. Previously/still, erc in persistent emacs/dtach/mosh on a linode |
2022-12-04 02:38:00 +0100 | <dsal> | I think last time I tried running a matrix service it was… hard. I used to do everything with xmpp but for whatever reason we had to reinvent that a bunch of times. |
2022-12-04 02:38:17 +0100 | <yushyin> | :D |
2022-12-04 02:38:22 +0100 | razetime | (~quassel@49.207.211.219) |
2022-12-04 02:41:41 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Quit: ChaiTRex) |
2022-12-04 02:43:05 +0100 | <yin> | anyone here using hls with neovim? |
2022-12-04 02:43:33 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-04 02:43:49 +0100 | <yin> | all i want is to know the inferred type of a function on hover and i can't seem to do it :'( |
2022-12-04 02:43:53 +0100 | <geekosaur> | luckily you don't have to run a matrix service yourself, you can use an existing one |
2022-12-04 02:45:16 +0100 | <geekosaur> | sorry, never used hls with anything but vscode |
2022-12-04 02:46:13 +0100 | ksqsf | (~user@134.209.106.31) |
2022-12-04 02:47:18 +0100 | <yushyin> | i do. yin, you can use vim.lsp.buf.code_action to insert the inferred type |
2022-12-04 02:50:52 +0100 | <geekosaur> | yin, is that neovim in a terminal or as a gui app? hover actions won't work too well in the terminal version, even if it knows how to use $WINDOWID |
2022-12-04 02:51:32 +0100 | <geekosaur> | (I don't even know if neovim has a gui version…) |
2022-12-04 02:54:26 +0100 | glider_ | (~glider@76.202.115.164) |
2022-12-04 02:55:33 +0100 | glider_ | (~glider@76.202.115.164) (Remote host closed the connection) |
2022-12-04 02:55:46 +0100 | <dsal> | I tried vscode on my iPad, but it doesn't support hls. |
2022-12-04 02:57:28 +0100 | anderson_ | (~ande@76.202.115.164) |
2022-12-04 02:58:08 +0100 | <yushyin> | probably wouldn't have enough ram anyway. needs about 2-3GB for a simple project |
2022-12-04 03:03:53 +0100 | <dsal> | It could theoretically run it elsewhere. It was letting me edit source files on my raspberry pi via ssh. |
2022-12-04 03:07:50 +0100 | eldritch_ | (~eldritch@76.202.115.164) |
2022-12-04 03:10:41 +0100 | Guest20 | (~Guest20@2001:999:488:5cc:e5b0:b492:b43a:8f46) |
2022-12-04 03:12:29 +0100 | tomokojun | (~tomokojun@37.19.221.160) (Quit: じゃあね〜。) |
2022-12-04 03:13:20 +0100 | <Guest20> | @pl (\x y -> intersection (fromList x) (fromList y)) |
2022-12-04 03:13:20 +0100 | <lambdabot> | (. fromList) . intersection . fromList |
2022-12-04 03:15:20 +0100 | <dsal> | Guest20: have x and y already be whatever `fromList` is doing. |
2022-12-04 03:16:19 +0100 | <dsal> | That particular answer is amazingly bad, though. |
2022-12-04 03:17:03 +0100 | <Guest20> | Why is it bad? |
2022-12-04 03:17:05 +0100 | <dsal> | You might as well write `(fromList -> x) -> intersection x . fromList` but don't do that. |
2022-12-04 03:17:19 +0100 | <dsal> | It's not clear at all what's happening in the @pl suggestion. |
2022-12-04 03:17:25 +0100 | <yushyin> | not everything has to be pointfree ... |
2022-12-04 03:17:31 +0100 | <glguy> | :t on |
2022-12-04 03:17:31 +0100 | <lambdabot> | (b -> b -> c) -> (a -> b) -> a -> a -> c |
2022-12-04 03:18:09 +0100 | <dsal> | :t on intersection fromList |
2022-12-04 03:18:10 +0100 | <lambdabot> | error: |
2022-12-04 03:18:10 +0100 | <lambdabot> | • Variable not in scope: intersection :: b0 -> b0 -> c |
2022-12-04 03:18:10 +0100 | <lambdabot> | • Perhaps you meant one of these: |
2022-12-04 03:18:19 +0100 | <dsal> | :t on S.intersection S.fromList |
2022-12-04 03:18:20 +0100 | <lambdabot> | Ord a => [a] -> [a] -> S.Set a |
2022-12-04 03:20:44 +0100 | <dsal> | `on` looks better infix there, I think. |
2022-12-04 03:20:52 +0100 | <dsal> | :t S.intersection `on` S.fromList |
2022-12-04 03:20:53 +0100 | <lambdabot> | Ord a => [a] -> [a] -> S.Set a |
2022-12-04 03:21:45 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 03:22:12 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-04 03:24:45 +0100 | <Guest20> | Thanks, that looks better indeed. Which module has on? |
2022-12-04 03:25:03 +0100 | <dsal> | @hoogle on |
2022-12-04 03:25:03 +0100 | <lambdabot> | Data.Function on :: (b -> b -> c) -> (a -> b) -> a -> a -> c |
2022-12-04 03:25:04 +0100 | <lambdabot> | System.Directory.Internal.Prelude on :: () => (b -> b -> c) -> (a -> b) -> a -> a -> c |
2022-12-04 03:25:04 +0100 | <lambdabot> | Text.Regex.TDFA.Common on :: (t1 -> t1 -> t2) -> (t -> t1) -> t -> t -> t2 |
2022-12-04 03:26:25 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 260 seconds) |
2022-12-04 03:28:00 +0100 | money | (Guest1418@user/polo) () |
2022-12-04 03:29:31 +0100 | money | (~money@user/polo) |
2022-12-04 03:30:06 +0100 | <Guest20> | @hoogle ord |
2022-12-04 03:30:06 +0100 | <lambdabot> | Data.Char ord :: Char -> Int |
2022-12-04 03:30:06 +0100 | <lambdabot> | GHC.Base ord :: Char -> Int |
2022-12-04 03:30:06 +0100 | <lambdabot> | Data.Text.Internal.Unsafe.Char ord :: Char -> Int |
2022-12-04 03:30:25 +0100 | money | (~money@user/polo) (Client Quit) |
2022-12-04 03:31:56 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 03:32:27 +0100 | wroathe | (~wroathe@user/wroathe) (Quit: Reconnecting) |
2022-12-04 03:32:40 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) |
2022-12-04 03:32:40 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
2022-12-04 03:32:40 +0100 | wroathe | (~wroathe@user/wroathe) |
2022-12-04 03:33:21 +0100 | money | (money@user/polo) |
2022-12-04 03:34:24 +0100 | Sciencentistguy4 | (~sciencent@hacksoc/ordinary-member) |
2022-12-04 03:36:05 +0100 | Sciencentistguy | (~sciencent@hacksoc/ordinary-member) (Ping timeout: 246 seconds) |
2022-12-04 03:36:05 +0100 | Sciencentistguy4 | Sciencentistguy |
2022-12-04 03:37:18 +0100 | <mniip> | heya edwardk |
2022-12-04 03:37:22 +0100 | <mniip> | long time |
2022-12-04 03:39:02 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 03:40:24 +0100 | <EvanR> | edwardk, re: the loose ends in the zurihack 2015 talk, was there any progress on the unordered discrimination, or the streaming results using spooky action at a distance? |
2022-12-04 03:40:46 +0100 | <iqubic> | edwardk comes in every now and then, and drops knowledge bombs! |
2022-12-04 03:42:28 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 248 seconds) |
2022-12-04 03:51:55 +0100 | <Guest192> | https://paste.tomsmeding.com/chlrUibO |
2022-12-04 03:52:09 +0100 | <edwardk> | heya mniip |
2022-12-04 03:52:28 +0100 | <Guest192> | this is ihp specific but I'm having some issues rendering links and was wondering if anyone can help point out some mistakes |
2022-12-04 03:52:41 +0100 | <edwardk> | evanr the promises andd discrimination packages implement a version of productive stable unordered discrimination for Grouping |
2022-12-04 03:52:59 +0100 | <Guest192> | I can pass the path to the action through the view, but when i navigate to that link, I'm taken to a 404 page |
2022-12-04 03:58:30 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 260 seconds) |
2022-12-04 03:59:54 +0100 | rekahsoft | (~rekahsoft@bras-base-wdston4533w-grc-02-142-113-160-156.dsl.bell.ca) (Ping timeout: 256 seconds) |
2022-12-04 04:01:56 +0100 | <EvanR> | oh wow this promise package looks fun |
2022-12-04 04:05:30 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
2022-12-04 04:09:08 +0100 | <iqubic> | EvanR: Are your referring to the package that provides a `Lazy s a` data type? |
2022-12-04 04:09:21 +0100 | <EvanR> | yes |
2022-12-04 04:09:49 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-04 04:10:15 +0100 | <iqubic> | I see. I'm not sure what's so interesting about it yet. |
2022-12-04 04:10:44 +0100 | segfaultfizzbuzz | (~segfaultf@23-93-74-212.fiber.dynamic.sonic.net) (Ping timeout: 246 seconds) |
2022-12-04 04:10:57 +0100 | <EvanR> | it's like ST but you can create IVars in it |
2022-12-04 04:11:19 +0100 | <iqubic> | I'm not sure what an IVar is. |
2022-12-04 04:11:48 +0100 | <EvanR> | an IVar is a mutable variable which starts undefined and can only be updated once |
2022-12-04 04:12:10 +0100 | <EvanR> | which allows it to be read in a pure computation |
2022-12-04 04:12:11 +0100 | <iqubic> | I see. That is interesting |
2022-12-04 04:13:42 +0100 | <EvanR> | Lazy s monad lets you write to it (once) also, and you can runLazy in pure code |
2022-12-04 04:13:59 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
2022-12-04 04:14:03 +0100 | <iqubic> | I love how the Discrimination Google Talk starts with 15 minutes of explaining the joke "Monads are monoids in the category of endofunctors" |
2022-12-04 04:15:01 +0100 | <EvanR> | "Welcome to this serious talk. First, Monads are monoids in category of endofunctors what's the problem." |
2022-12-04 04:16:02 +0100 | <iqubic> | I love it so much. |
2022-12-04 04:19:10 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-04 04:19:36 +0100 | <Guest20> | @pl intersect x $ intersect y z |
2022-12-04 04:19:36 +0100 | <lambdabot> | intersect x (intersect y z) |
2022-12-04 04:20:08 +0100 | <EvanR> | that's already pointless |
2022-12-04 04:20:23 +0100 | <EvanR> | maybe put a lambda |
2022-12-04 04:20:27 +0100 | <iqubic> | @pl \x y z -> f x $ f y z |
2022-12-04 04:20:27 +0100 | <lambdabot> | (. f) . (.) . f |
2022-12-04 04:20:32 +0100 | <iqubic> | There we go. |
2022-12-04 04:20:46 +0100 | <iqubic> | (. intersect) . (.) . intersect |
2022-12-04 04:21:17 +0100 | <iqubic> | But please don't use that. Writting everything in a pointless style isn't always the best idea. |
2022-12-04 04:22:01 +0100 | <EvanR> | that's code is not suitable for coders with trypophobia |
2022-12-04 04:22:19 +0100 | <iqubic> | Nope. |
2022-12-04 04:22:26 +0100 | <iqubic> | I don't like that code either. |
2022-12-04 04:22:34 +0100 | <EvanR> | better to use fmap |
2022-12-04 04:22:55 +0100 | <iqubic> | How does that make it better? |
2022-12-04 04:23:16 +0100 | <EvanR> | you can use `fmap` instead of . for functions |
2022-12-04 04:23:32 +0100 | <iqubic> | Right. But the clearest code here is still this: |
2022-12-04 04:23:39 +0100 | <iqubic> | f x $ f y z |
2022-12-04 04:23:57 +0100 | <EvanR> | if we're being serious now, I object to the use of $ there |
2022-12-04 04:24:14 +0100 | <iqubic> | Do you ever find $ good at all? |
2022-12-04 04:24:26 +0100 | <EvanR> | yeah |
2022-12-04 04:25:51 +0100 | <EvanR> | sometimes it naturally fits in section form as a function argument, sometimes it helps open a "block argument" do, if you don't use the extension which makes the $ unnecessary |
2022-12-04 04:26:53 +0100 | mestre | (~mestre@191.177.185.178) |
2022-12-04 04:27:15 +0100 | <EvanR> | $! can be handy instead of seq, rarely |
2022-12-04 04:27:34 +0100 | <EvanR> | instead of bang patterns |
2022-12-04 04:27:40 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds) |
2022-12-04 04:27:46 +0100 | <iqubic> | @src ($!) |
2022-12-04 04:27:46 +0100 | <lambdabot> | f $! x = x `seq` f x |
2022-12-04 04:27:51 +0100 | <iqubic> | Yeah, that's good. |
2022-12-04 04:31:01 +0100 | <EvanR> | "C style function call" |
2022-12-04 04:31:13 +0100 | <EvanR> | (or like, most languages) |
2022-12-04 04:34:02 +0100 | Guest20 | (~Guest20@2001:999:488:5cc:e5b0:b492:b43a:8f46) (Quit: Client closed) |
2022-12-04 04:35:14 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2022-12-04 04:35:14 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-04 04:35:14 +0100 | finn_elija | FinnElija |
2022-12-04 04:42:53 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 04:43:23 +0100 | Guest20 | (~Guest20@2001:999:488:5cc:3116:f149:10de:6194) |
2022-12-04 04:47:41 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds) |
2022-12-04 04:48:27 +0100 | mestre | (~mestre@191.177.185.178) (Quit: Lost terminal) |
2022-12-04 04:48:38 +0100 | ksqsf | (~user@134.209.106.31) (Quit: ERC 5.4.1 (IRC client for GNU Emacs 29.0.60)) |
2022-12-04 04:49:46 +0100 | td_ | (~td@83.135.9.32) (Ping timeout: 256 seconds) |
2022-12-04 04:51:22 +0100 | td_ | (~td@83.135.9.35) |
2022-12-04 04:53:54 +0100 | tomku|two | (~tomku@user/tomku) (Read error: Connection reset by peer) |
2022-12-04 04:58:32 +0100 | tomku | (~tomku@user/tomku) |
2022-12-04 04:59:57 +0100 | dtman34 | (~dtman34@76.156.89.180) (Ping timeout: 265 seconds) |
2022-12-04 05:00:01 +0100 | haasn | (~nand@haasn.dev) (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
2022-12-04 05:01:21 +0100 | haasn | (~nand@haasn.dev) |
2022-12-04 05:01:59 +0100 | dtman34 | (~dtman34@2601:447:d000:93c9:9211:a0f7:7474:e151) |
2022-12-04 05:03:06 +0100 | td_ | (~td@83.135.9.35) (Ping timeout: 268 seconds) |
2022-12-04 05:03:43 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
2022-12-04 05:04:43 +0100 | td_ | (~td@83.135.9.35) |
2022-12-04 05:22:11 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) |
2022-12-04 05:23:33 +0100 | Guest20 | (~Guest20@2001:999:488:5cc:3116:f149:10de:6194) (Ping timeout: 260 seconds) |
2022-12-04 05:25:15 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-12-04 05:29:53 +0100 | jero98772 | (~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection) |
2022-12-04 05:33:56 +0100 | ddellacosta | (~ddellacos@143.244.47.73) (Ping timeout: 248 seconds) |
2022-12-04 05:34:26 +0100 | <edwardk> | i just wish $ and $! had the other fixity |
2022-12-04 05:34:48 +0100 | <edwardk> | they'd be so much better |
2022-12-04 05:35:50 +0100 | <edwardk> | foo $ arg 1 $ arg 2 $! you wanted arg 3 to be strict $ whatever you like |
2022-12-04 05:36:24 +0100 | <edwardk> | want the other behavior? you . can still $ have it |
2022-12-04 05:38:03 +0100 | <edwardk> | evanr: re: it being a serious talk, i went to a german-speaking country and gave a talk in favor of discrimination. the idea that it was serious was already out the window. |
2022-12-04 05:39:43 +0100 | <int-e> | I unironically use `pure $ foo . bar $ x` |
2022-12-04 05:41:02 +0100 | <int-e> | (Of course I wouldn't be doing that if the fixity of $ was different) |
2022-12-04 05:41:05 +0100 | <iqubic> | What does that do? |
2022-12-04 05:41:09 +0100 | Guest192 | (~Guest19@69.181.32.7) (Quit: Client closed) |
2022-12-04 05:41:32 +0100 | <iqubic> | Is that `pure (foo (bar x))` |
2022-12-04 05:42:02 +0100 | <int-e> | iqubic: I just often type "pure $" and then start thinking about the expression. And there's no reason to go back and change the $ at that point. |
2022-12-04 05:42:21 +0100 | <int-e> | I think of it as punctuation. |
2022-12-04 05:42:33 +0100 | <EvanR> | one pass coding |
2022-12-04 05:42:38 +0100 | <iqubic> | I don't even understand how to parse `pure $ foo . bar $ x` |
2022-12-04 05:42:47 +0100 | <EvanR> | too costly to go back and change it |
2022-12-04 05:42:57 +0100 | <int-e> | iqubic: pure $ ((foo . bar) $ x) |
2022-12-04 05:42:58 +0100 | <EvanR> | like a subway system |
2022-12-04 05:43:21 +0100 | <iqubic> | int-e: So it's just `pure (foo (bar x))` |
2022-12-04 05:43:25 +0100 | <int-e> | sure |
2022-12-04 05:43:37 +0100 | <int-e> | after inlining $ and . and a few reduction steps |
2022-12-04 05:44:10 +0100 | <iqubic> | So, `pure $ foo . bar $ x` and `pure $ foo $ bar $ x` evaluate to the same value? |
2022-12-04 05:44:17 +0100 | <int-e> | yes |
2022-12-04 05:44:23 +0100 | <iqubic> | Weird... |
2022-12-04 05:44:39 +0100 | <int-e> | and so do `pure . foo $ bar x` and a few more variations. |
2022-12-04 05:45:53 +0100 | <iqubic> | Thinking of it as punctuation is a good idea, yeah. |
2022-12-04 05:46:26 +0100 | <EvanR> | yall are nuts |
2022-12-04 05:46:46 +0100 | <int-e> | said the squirrel? |
2022-12-04 05:47:13 +0100 | <iqubic> | Hey, at least we aren't mocking a mockingbird here. |
2022-12-04 05:47:38 +0100 | money | (money@user/polo) () |
2022-12-04 05:48:12 +0100 | money | (money@user/polo) |
2022-12-04 05:49:37 +0100 | <iqubic> | https://hackage.haskell.org/package/data-aviary-0.2.3 |
2022-12-04 05:50:38 +0100 | <iqubic> | Please don't use those functions in production code. |
2022-12-04 05:51:00 +0100 | td_ | (~td@83.135.9.35) (Ping timeout: 248 seconds) |
2022-12-04 05:51:11 +0100 | <int-e> | A starling, a kestrel and an idiot bird walk into a bar and order a combination of drinks. |
2022-12-04 05:51:53 +0100 | pieguy128_ | (~pieguy128@bras-base-mtrlpq5031w-grc-50-65-93-192-212.dsl.bell.ca) (Ping timeout: 246 seconds) |
2022-12-04 05:52:03 +0100 | <int-e> | But if you don't like those bird names, you can use `ap`, `const`, and `id`. :) |
2022-12-04 05:52:09 +0100 | <iqubic> | That make me laugh quite a bit. |
2022-12-04 05:52:22 +0100 | <iqubic> | Those are all fine int-e |
2022-12-04 06:01:51 +0100 | pieguy128 | (~pieguy128@bras-base-mtrlpq5031w-grc-43-67-70-144-160.dsl.bell.ca) |
2022-12-04 06:02:31 +0100 | td_ | (~td@2001:9e8:19c5:b000:8490:da8:cd63:68ca) |
2022-12-04 06:03:36 +0100 | Parsnip | (~parsnip@user/parsnip) |
2022-12-04 06:03:57 +0100 | Neuromancer | (~Neuromanc@user/neuromancer) |
2022-12-04 06:03:58 +0100 | <Parsnip> | what is that thing in haskell that swaps, like List<Future<T>> ==> Future<List<T>>? |
2022-12-04 06:04:08 +0100 | <Parsnip> | traverse? |
2022-12-04 06:06:29 +0100 | <c_wraith> | sequence |
2022-12-04 06:06:34 +0100 | <c_wraith> | which is closely related to traverse |
2022-12-04 06:07:25 +0100 | <c_wraith> | well. technically sequenceA. But meh. |
2022-12-04 06:09:49 +0100 | <int-e> | :t traverse id {- which is, of course, sequenceA -} |
2022-12-04 06:09:50 +0100 | <lambdabot> | (Traversable t, Applicative f) => t (f b) -> f (t b) |
2022-12-04 06:15:06 +0100 | <famubu[m]> | Hi. I was trying to do bitwise AND in haskell. So I did `import qualified Data.Bits`. But how can I use the `(.&.)`? Doing `Data.Bits.(.&.) 2 3` gives error. It works if I imported with qualified though. How can we make it work with the `qualified`? |
2022-12-04 06:15:56 +0100 | <iqubic> | @pl \(x, y) -> not $ f x y |
2022-12-04 06:15:56 +0100 | <lambdabot> | uncurry ((not .) . f) |
2022-12-04 06:16:00 +0100 | <iqubic> | Eww... |
2022-12-04 06:17:50 +0100 | Sauvin | (~sauvin@user/Sauvin) (Remote host closed the connection) |
2022-12-04 06:18:08 +0100 | Sauvin | (~sauvin@user/Sauvin) |
2022-12-04 06:18:50 +0100 | <int-e> | iqubic: simplification is hard :) `not . uncurry f` should work |
2022-12-04 06:20:49 +0100 | <iqubic> | (\(x, y) -> not $ f x y) |
2022-12-04 06:20:55 +0100 | <iqubic> | That's what I have |
2022-12-04 06:21:07 +0100 | <int-e> | :t not . uncurry f` should work |
2022-12-04 06:21:07 +0100 | <int-e> | 06:20:49 <iqubic> (\(x, y) -> not $ f x y) |
2022-12-04 06:21:08 +0100 | <lambdabot> | error: parse error on input ‘work’ |
2022-12-04 06:21:12 +0100 | <iqubic> | I think that's cleaner than trying to stick an uncurr in there. |
2022-12-04 06:21:12 +0100 | <int-e> | ugh |
2022-12-04 06:21:22 +0100 | <int-e> | :t not . uncurry ?f |
2022-12-04 06:21:23 +0100 | <lambdabot> | (?f::a -> b -> Bool) => (a, b) -> Bool |
2022-12-04 06:21:40 +0100 | <int-e> | :t uncurry ((not .) . ?f) |
2022-12-04 06:21:40 +0100 | <lambdabot> | (?f::a1 -> a2 -> Bool) => (a1, a2) -> Bool |
2022-12-04 06:22:21 +0100 | <int-e> | iqubic: sure, but *if* you want point-free code, the version that @pl gave is inferior. |
2022-12-04 06:22:26 +0100 | <iqubic> | I'm delibrately not stating what f is, because I don't want to give away what I did for Advent of Code Day 2. |
2022-12-04 06:22:29 +0100 | <iqubic> | Part 2 |
2022-12-04 06:22:43 +0100 | <iqubic> | Day 4, Part 2 used code of that form |
2022-12-04 06:23:20 +0100 | <int-e> | odd. |
2022-12-04 06:25:20 +0100 | <money> | f**k or f*p |
2022-12-04 06:27:41 +0100 | <iqubic> | My part 2 for today includes this: `not . uncurry IS.disjoint` |
2022-12-04 06:29:05 +0100 | <int-e> | ah, the k-IS-s principle. |
2022-12-04 06:29:24 +0100 | <iqubic> | what's the k-IS-s principle? |
2022-12-04 06:30:04 +0100 | <int-e> | KISS is "keep it simple and stupid" (or a comma instead of `and` if you want more emphasis). "IS" is your IntSet. |
2022-12-04 06:30:20 +0100 | <iqubic> | Right, I see. |
2022-12-04 06:30:31 +0100 | <iqubic> | Yeah. IS is IntSet here |
2022-12-04 06:30:51 +0100 | wroathe | (~wroathe@user/wroathe) (Quit: leaving) |
2022-12-04 06:33:45 +0100 | tomku | (~tomku@user/tomku) (Ping timeout: 268 seconds) |
2022-12-04 06:33:54 +0100 | tomku | (~tomku@user/tomku) |
2022-12-04 06:34:07 +0100 | <iqubic> | There's got to be a more efficient data structure for when I know the set contains all the integers between N and M inclusive and nothing more. |
2022-12-04 06:35:03 +0100 | <iqubic> | But I don't know it. |
2022-12-04 06:35:24 +0100 | <EvanR> | a one dimensional quadtree of some sort |
2022-12-04 06:35:34 +0100 | <c_wraith> | Is (m, n) not sufficient? |
2022-12-04 06:35:43 +0100 | <EvanR> | hah |
2022-12-04 06:36:43 +0100 | <c_wraith> | I sort of accidentally nailed part 2. From part 1 to part 2, I changed two &&s to ||s |
2022-12-04 06:36:52 +0100 | <iqubic> | c_wraith: It is, but then I'm not sure how to implement isSubsetOf and intersection. Those are the two set operations I used today. |
2022-12-04 06:38:34 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) |
2022-12-04 06:40:02 +0100 | <EvanR> | > intersect [1..3] [4..6] |
2022-12-04 06:40:04 +0100 | <lambdabot> | [] |
2022-12-04 06:40:08 +0100 | <EvanR> | > intersect [1..5] [4..6] |
2022-12-04 06:40:10 +0100 | <lambdabot> | [4,5] |
2022-12-04 06:41:40 +0100 | <EvanR> | > [3..4] `isSubsequenceOf` [1..8] |
2022-12-04 06:41:41 +0100 | <lambdabot> | True |
2022-12-04 06:42:44 +0100 | <iqubic> | Is that just using standard List operations? |
2022-12-04 06:42:47 +0100 | <EvanR> | yeah |
2022-12-04 06:43:13 +0100 | <iqubic> | So, IntSets are overkill? |
2022-12-04 06:43:22 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 06:44:15 +0100 | <int-e> | Oooh. intersect xs ys `elem` [xs, ys] |
2022-12-04 06:44:25 +0100 | <EvanR> | like c_wraith was saying, sets are probably overkill xD |
2022-12-04 06:44:53 +0100 | <c_wraith> | these are ranges. you can represent them as sets, but it's *way* more information than you need. |
2022-12-04 06:45:03 +0100 | <int-e> | Anyway, interval arithmetic isn't hard either. |
2022-12-04 06:45:04 +0100 | <EvanR> | imagine if they said it was a range of real numbers |
2022-12-04 06:45:12 +0100 | <EvanR> | then you'd need RealSet |
2022-12-04 06:45:18 +0100 | <EvanR> | and countable memory |
2022-12-04 06:45:21 +0100 | <EvanR> | uncountable |
2022-12-04 06:46:17 +0100 | <int-e> | Part 1 was harder than part 2. Change my mind. :-P |
2022-12-04 06:46:23 +0100 | <iqubic> | Yeah, at that point you'd switch to just storing the endpoints. |
2022-12-04 06:46:28 +0100 | <EvanR> | overlaps = not . apart xD |
2022-12-04 06:46:47 +0100 | <iqubic> | int-e: No, that seems right |
2022-12-04 06:46:47 +0100 | <EvanR> | would fail if it was reals, depending on your logic |
2022-12-04 06:46:52 +0100 | <iqubic> | What is apart? |
2022-12-04 06:47:15 +0100 | <int-e> | apart = disjoint |
2022-12-04 06:47:22 +0100 | <EvanR> | apart means there's a gap between them |
2022-12-04 06:47:24 +0100 | <int-e> | miles apart |
2022-12-04 06:49:20 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-04 06:53:58 +0100 | fizbin | (~fizbin@c-76-116-163-70.hsd1.nj.comcast.net) |
2022-12-04 06:56:57 +0100 | Neuromancer | (~Neuromanc@user/neuromancer) (Quit: Going offline, see ya! (www.adiirc.com)) |
2022-12-04 06:59:32 +0100 | fizbin | (~fizbin@c-76-116-163-70.hsd1.nj.comcast.net) (Quit: Leaving...) |
2022-12-04 06:59:56 +0100 | td_ | (~td@2001:9e8:19c5:b000:8490:da8:cd63:68ca) (Ping timeout: 255 seconds) |
2022-12-04 07:00:37 +0100 | td_ | (~td@83.135.9.35) |
2022-12-04 07:01:38 +0100 | anderson_ | (~ande@76.202.115.164) (Quit: bye) |
2022-12-04 07:01:38 +0100 | eldritch_ | (~eldritch@76.202.115.164) (Quit: bye) |
2022-12-04 07:02:51 +0100 | fizbin | (~fizbin@c-76-116-163-70.hsd1.nj.comcast.net) |
2022-12-04 07:06:49 +0100 | monochrom | (trebla@216.138.220.146) (Quit: NO CARRIER) |
2022-12-04 07:08:19 +0100 | anderson_ | (~ande@76.202.115.164) |
2022-12-04 07:08:54 +0100 | tomku | (~tomku@user/tomku) (Ping timeout: 260 seconds) |
2022-12-04 07:09:15 +0100 | fizbin | (~fizbin@c-76-116-163-70.hsd1.nj.comcast.net) (Quit: Leaving...) |
2022-12-04 07:10:21 +0100 | eldritch_ | (~eldritch@76.202.115.164) |
2022-12-04 07:12:15 +0100 | Guest|71 | (~Guest|71@217-121-107-193.cable.dynamic.v4.ziggo.nl) |
2022-12-04 07:13:09 +0100 | monochrom | (trebla@216.138.220.146) |
2022-12-04 07:14:49 +0100 | tomku | (~tomku@user/tomku) |
2022-12-04 07:14:49 +0100 | Guest|71 | (~Guest|71@217-121-107-193.cable.dynamic.v4.ziggo.nl) (Remote host closed the connection) |
2022-12-04 07:15:30 +0100 | anderson_ | (~ande@76.202.115.164) (Quit: bye) |
2022-12-04 07:15:30 +0100 | eldritch_ | (~eldritch@76.202.115.164) (Quit: bye) |
2022-12-04 07:15:36 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-04 07:17:16 +0100 | <fizbin> | glguy, question about advent of code (if you're around). What language are you doing it in for time? (I'm doing it in python for speed, and then in haskell after) |
2022-12-04 07:22:48 +0100 | eldritch_ | (~eldritch@76.202.115.164) |
2022-12-04 07:26:23 +0100 | rburkholder | (~blurb@96.45.2.121) (Remote host closed the connection) |
2022-12-04 07:28:26 +0100 | anderson_ | (~ande@76.202.115.164) |
2022-12-04 07:35:49 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2022-12-04 07:39:56 +0100 | eldritch_ | (~eldritch@76.202.115.164) (Quit: bye) |
2022-12-04 07:40:30 +0100 | anderson_ | (~ande@76.202.115.164) (Quit: bye) |
2022-12-04 07:45:05 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
2022-12-04 07:50:50 +0100 | razetime | (~quassel@49.207.211.219) (Ping timeout: 268 seconds) |
2022-12-04 07:52:48 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 256 seconds) |
2022-12-04 07:53:37 +0100 | <phma> | I'm writing a library which is at version 0.1.0.0. I need to add and export another function and think it would be wise to rename the functions. I've uploaded it to Hackage only as a candidate. Which number should I bump? |
2022-12-04 07:56:11 +0100 | Parsnip | parsnip |
2022-12-04 07:56:57 +0100 | <maerwald[m]> | phma: you're renaming existing functions? |
2022-12-04 07:58:31 +0100 | <phma> | probably |
2022-12-04 07:59:04 +0100 | <maerwald[m]> | I don't understand |
2022-12-04 07:59:05 +0100 | <phma> | I have to add another argument to the function |
2022-12-04 07:59:22 +0100 | <phma> | but I want to keep the version which doesn't have the new argument |
2022-12-04 07:59:33 +0100 | <phma> | so I'm going to rename it |
2022-12-04 07:59:33 +0100 | <maerwald[m]> | Are you keeping the existing functions as they are or not? |
2022-12-04 08:00:02 +0100 | <phma> | the existing function will have a modified name |
2022-12-04 08:00:22 +0100 | <maerwald[m]> | That's a breaking change, so major bump |
2022-12-04 08:00:47 +0100 | <phma> | so 1.0.0.0? |
2022-12-04 08:03:42 +0100 | <maerwald[m]> | https://pvp.haskell.org/ |
2022-12-04 08:05:18 +0100 | <phma> | what's the difference between bumping to 0.2.0.0 and bumping to 1.0.0.0? |
2022-12-04 08:08:56 +0100 | <maerwald[m]> | Those are different versions |
2022-12-04 08:09:12 +0100 | <maerwald[m]> | PVP doesn't assign semantics to the difference |
2022-12-04 08:10:25 +0100 | <jackdk> | both 0.1.0.0 -> 0.2.0.0 and 0.1.0.0 -> 1.0.0.0 are a large major version bump as PVP says versions are major.major.minor.patch |
2022-12-04 08:11:06 +0100 | <phma> | If I add a benchmark or test, which number do I have to bunp? |
2022-12-04 08:14:00 +0100 | <c_wraith> | if they don't affect the API at all, they're patch level |
2022-12-04 08:15:32 +0100 | <phma> | okay, I'll go with 0.2 |
2022-12-04 08:16:25 +0100 | razetime | (~quassel@49.207.211.219) |
2022-12-04 08:17:20 +0100 | <jackdk> | That's not a patch-level version change |
2022-12-04 08:17:52 +0100 | <jackdk> | Going from 0.1 to 0.2 is a major version bump. If you don't change the API at all, you could go from 0.1.0.0 to 0.1.0.1 |
2022-12-04 08:22:23 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-04 08:24:50 +0100 | <phma> | no, I can't, because I added a function. Once I add the benchmark, I can go to 0.2.0.1. |
2022-12-04 08:25:27 +0100 | <phma> | Technical difficulties. I have to restart my IRC client. |
2022-12-04 08:25:41 +0100 | phma | (~phma@host-67-44-208-217.hnremote.net) (Quit: Konversation terminated!) |
2022-12-04 08:26:32 +0100 | phma | (phma@2001:5b0:2172:df88:5a01:89c1:b39c:c87d) |
2022-12-04 08:27:55 +0100 | <phma> | I have to add the function in order to use a library; the benchmark will test my library's use of that other library. |
2022-12-04 08:30:40 +0100 | <maerwald[m]> | phma: adding a function is not a breaking change |
2022-12-04 08:30:58 +0100 | <maerwald[m]> | Did you look at the link? |
2022-12-04 08:33:16 +0100 | <phma> | yes, and as I'm adding an argument to a function, that is a breaking change |
2022-12-04 08:35:35 +0100 | <maerwald[m]> | Yes, but adding a function is not |
2022-12-04 08:36:45 +0100 | <phma> | renaming a function is a breaking change, right? |
2022-12-04 08:37:54 +0100 | <maerwald[m]> | phma: renaming a function as in: removing an existing one and adding a new one yes |
2022-12-04 08:39:13 +0100 | <phma> | so I have to bump it from 0.1.0.0 to 0.2.0.0 when I rename the function and add a new function with an additional argument with the previous name, |
2022-12-04 08:39:24 +0100 | <phma> | then 0.2.0.1 when I add the benchmark |
2022-12-04 08:40:43 +0100 | jakalx | (~jakalx@base.jakalx.net) (Error from remote client) |
2022-12-04 08:43:15 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-04 08:44:29 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) |
2022-12-04 08:44:48 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-04 08:53:48 +0100 | phma | (phma@2001:5b0:2172:df88:5a01:89c1:b39c:c87d) (Read error: Connection reset by peer) |
2022-12-04 08:54:44 +0100 | phma | (phma@2001:5b0:210b:fa28:7bf5:3e57:e59:39a9) |
2022-12-04 09:00:13 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-04 09:00:19 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 260 seconds) |
2022-12-04 09:03:38 +0100 | razetime | (~quassel@49.207.211.219) (Ping timeout: 256 seconds) |
2022-12-04 09:04:10 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 260 seconds) |
2022-12-04 09:07:23 +0100 | yuribarros | (~yuribarro@2804:14c:65e4:865c::1000) (Remote host closed the connection) |
2022-12-04 09:08:52 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
2022-12-04 09:12:34 +0100 | <jackdk> | Or you do it all at once and go to 0.2.0.0 |
2022-12-04 09:19:30 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-04 09:23:48 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 09:28:16 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
2022-12-04 09:34:13 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) |
2022-12-04 09:35:59 +0100 | pagnol | (~user@213-205-209-87.ftth.glasoperator.nl) |
2022-12-04 09:36:16 +0100 | <pagnol> | What's the best setup nowadays for Haskell on Emacs? |
2022-12-04 09:36:59 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 246 seconds) |
2022-12-04 09:38:54 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) |
2022-12-04 09:39:42 +0100 | <jackdk> | I'm still on dante, but I hear lsp is pretty good. eglot's about to get into mainline emacs but I'm not across the latest emacs<->lsp stuff |
2022-12-04 09:40:47 +0100 | nek0 | (~nek0@2a01:4f8:222:2b41::12) (Quit: The Lounge - https://thelounge.chat) |
2022-12-04 10:06:30 +0100 | money | (money@user/polo) () |
2022-12-04 10:06:46 +0100 | tcard | (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) |
2022-12-04 10:07:18 +0100 | money | (money@user/polo) |
2022-12-04 10:08:00 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-12-04 10:08:00 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-04 10:08:00 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Read error: Connection reset by peer) |
2022-12-04 10:08:43 +0100 | Chai-T-Rex | (~ChaiTRex@user/chaitrex) |
2022-12-04 10:08:48 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2022-12-04 10:09:08 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 10:09:47 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-04 10:10:19 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-04 10:14:26 +0100 | acidjnk | (~acidjnk@p200300d6e7137a51c5d563f76206e160.dip0.t-ipconnect.de) |
2022-12-04 10:16:58 +0100 | Guest4143 | (~Guest41@212.164.64.82) |
2022-12-04 10:18:00 +0100 | Guest4143 | (~Guest41@212.164.64.82) (Client Quit) |
2022-12-04 10:32:37 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-04 10:38:31 +0100 | instantaphex | (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
2022-12-04 10:43:07 +0100 | instantaphex | (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 265 seconds) |
2022-12-04 10:46:53 +0100 | talismanick | (~talismani@76.133.152.122) (Remote host closed the connection) |
2022-12-04 10:47:01 +0100 | kenran | (~user@user/kenran) |
2022-12-04 10:47:14 +0100 | <albet70> | is '\e' a character? |
2022-12-04 10:47:15 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) |
2022-12-04 10:47:18 +0100 | <albet70> | or '\3' |
2022-12-04 10:47:35 +0100 | <albet70> | any start with backslash is a character? |
2022-12-04 10:48:40 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-12-04 10:49:13 +0100 | nihonium | (~nihonium@46.148.105.76) |
2022-12-04 10:51:43 +0100 | <mauke> | > '\K' |
2022-12-04 10:51:44 +0100 | <lambdabot> | <hint>:1:3: error: |
2022-12-04 10:51:44 +0100 | <lambdabot> | lexical error in string/character literal at character 'K' |
2022-12-04 10:52:00 +0100 | <mauke> | > ('\e', '\3') |
2022-12-04 10:52:02 +0100 | <lambdabot> | <hint>:1:4: error: |
2022-12-04 10:52:02 +0100 | <lambdabot> | lexical error in string/character literal at character 'e' |
2022-12-04 10:52:06 +0100 | <tomsmeding> | > '\ESC' |
2022-12-04 10:52:08 +0100 | <lambdabot> | '\ESC' |
2022-12-04 10:52:08 +0100 | <albet70> | there're some characters like \xXX or \uXXXX in javascript escape strings, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#escape_seq… but '\x' or '\u' aren't characters in Haskell, how I suppose to capture characters like that '\xXX'? |
2022-12-04 10:52:22 +0100 | <tomsmeding> | > '\x40' |
2022-12-04 10:52:23 +0100 | <lambdabot> | '@' |
2022-12-04 10:52:43 +0100 | <albet70> | tomsmeding, how to capture '\xAny' in haskell? |
2022-12-04 10:52:44 +0100 | <mauke> | > '\o33' |
2022-12-04 10:52:46 +0100 | <lambdabot> | '\ESC' |
2022-12-04 10:52:53 +0100 | <mauke> | "where is the any char"? |
2022-12-04 10:53:09 +0100 | <albet70> | tomsmeding, is there a table have all this special characters? |
2022-12-04 10:53:10 +0100 | <tomsmeding> | albet70: see section 2.6 here https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-140002 |
2022-12-04 10:53:30 +0100 | <tomsmeding> | that's the haskell 2010 report, i.e. as close to a standard as we have |
2022-12-04 10:53:52 +0100 | <mauke> | direct link: https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-200002.6 |
2022-12-04 10:55:05 +0100 | nihonium | (~nihonium@46.148.105.76) (Ping timeout: 256 seconds) |
2022-12-04 10:55:35 +0100 | <mauke> | > '\^[' |
2022-12-04 10:55:36 +0100 | <lambdabot> | '\ESC' |
2022-12-04 10:55:38 +0100 | <mauke> | neat |
2022-12-04 10:55:56 +0100 | <tomsmeding> | nice |
2022-12-04 10:56:32 +0100 | <mauke> | I think the only thing that's missing from Perl is named characters |
2022-12-04 10:56:34 +0100 | <albet70> | escape → \ ( charesc | ascii | decimal | o octal | x hexadecimal ) |
2022-12-04 10:56:44 +0100 | <albet70> | those number has a range? |
2022-12-04 10:56:55 +0100 | <mauke> | it has to be valid unicode |
2022-12-04 10:56:56 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2022-12-04 10:57:03 +0100 | <mauke> | > maxBound :: Char |
2022-12-04 10:57:05 +0100 | <lambdabot> | '\1114111' |
2022-12-04 10:57:36 +0100 | <mauke> | > '\1114112' |
2022-12-04 10:57:37 +0100 | <lambdabot> | <hint>:1:9: error: |
2022-12-04 10:57:38 +0100 | <lambdabot> | numeric escape sequence out of range at character '2' |
2022-12-04 10:57:56 +0100 | <tomsmeding> | > 0x10FFFF |
2022-12-04 10:57:57 +0100 | <lambdabot> | 1114111 |
2022-12-04 10:58:06 +0100 | <albet70> | if the whole unicode is a range, how I suppose to filter that haskell string to javascript string... that's huge |
2022-12-04 10:58:16 +0100 | <mauke> | huh? |
2022-12-04 10:58:29 +0100 | <tomsmeding> | JS has \u <hexdigits> |
2022-12-04 10:58:40 +0100 | <tomsmeding> | also, watch what you're doing |
2022-12-04 10:58:50 +0100 | <tomsmeding> | if you have a string in a haskell program, you don't have \ x 1 2 3 4 |
2022-12-04 10:58:53 +0100 | <albet70> | I'm reading haskell strings and turn it to javascript string |
2022-12-04 10:58:57 +0100 | <tomsmeding> | you have one character with value 1234 |
2022-12-04 10:59:19 +0100 | <tomsmeding> | though if you want to parse haskell strings _yourself_, then yes you'll have to deal with this |
2022-12-04 10:59:53 +0100 | <albet70> | current so far https://paste.tomsmeding.com/ifYQB2k5 |
2022-12-04 11:00:40 +0100 | <tomsmeding> | do you care about getting natural and readable js out? |
2022-12-04 11:00:46 +0100 | <tomsmeding> | otherwise you can make your life easy |
2022-12-04 11:01:00 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-04 11:01:24 +0100 | <albet70> | how so? |
2022-12-04 11:02:20 +0100 | <albet70> | elaboration? |
2022-12-04 11:02:49 +0100 | <c_wraith> | escape every character. |
2022-12-04 11:02:59 +0100 | <c_wraith> | if it doesn't need to be readable, that's easy to get it right |
2022-12-04 11:03:12 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
2022-12-04 11:03:23 +0100 | <albet70> | examples, please |
2022-12-04 11:03:25 +0100 | <mauke> | > concatMap (printf "\\u{%x}" . ord) "yo\n\"☺️\"" |
2022-12-04 11:03:26 +0100 | <lambdabot> | error: |
2022-12-04 11:03:26 +0100 | <lambdabot> | • Ambiguous type variable ‘b0’ arising from a use of ‘show_M510490830068... |
2022-12-04 11:03:26 +0100 | <lambdabot> | prevents the constraint ‘(Show b0)’ from being solved. |
2022-12-04 11:03:30 +0100 | <mauke> | oh? |
2022-12-04 11:03:35 +0100 | <mauke> | > concatMap (printf "\\u{%x}" . ord) "yo\n\"☺️\"" :: String |
2022-12-04 11:03:36 +0100 | <lambdabot> | "\\u{79}\\u{6f}\\u{a}\\u{22}\\u{263a}\\u{fe0f}\\u{22}" |
2022-12-04 11:03:41 +0100 | <tomsmeding> | \c -> if ' ' <= c && c < '\DEL' && c /= '"' then [c] else "\\u{" ++ Numeric.showHex (fromEnum c) "}" |
2022-12-04 11:03:54 +0100 | <tomsmeding> | or use printf lol |
2022-12-04 11:03:56 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) (Quit: Client closed) |
2022-12-04 11:04:05 +0100 | nek0 | (~nek0@2a01:4f8:222:2b41::12) |
2022-12-04 11:04:08 +0100 | <mauke> | look at this guy, trying to leave ASCII all readable and stuff |
2022-12-04 11:04:23 +0100 | <mauke> | but that's tricky because you must escape \ |
2022-12-04 11:04:27 +0100 | <tomsmeding> | ooooo |
2022-12-04 11:04:30 +0100 | <mauke> | and if you're embedding in HTML, you better escape < too |
2022-12-04 11:04:42 +0100 | <tomsmeding> | \c -> if ' ' <= c && c < '\DEL' && c `notElem` '"\\<' then [c] else "\\u{" ++ Numeric.showHex (fromEnum c) "}" |
2022-12-04 11:04:45 +0100 | <tomsmeding> | gotcha |
2022-12-04 11:05:38 +0100 | <albet70> | what about that \xXX? |
2022-12-04 11:06:10 +0100 | <albet70> | \xXX …where XX is exactly 2 hex digits in the range 00–FF |
2022-12-04 11:06:11 +0100 | <tomsmeding> | albet70: but I want to reiterate again: you are converting a string value in haskell to javascript code. And you come here asking "how do I deal with the various kinds of escape characters that haskell strings have, like \x, \u, \^, etc" |
2022-12-04 11:06:15 +0100 | <tomsmeding> | _that's the wrong question_ |
2022-12-04 11:06:22 +0100 | <tomsmeding> | your input is not haskell code |
2022-12-04 11:06:32 +0100 | <tomsmeding> | hence you do not care about how haskell _code_ is written |
2022-12-04 11:07:06 +0100 | <tomsmeding> | you care about the API of haskell strings in Haskell -- which is easy, it's [Char], and Char is Enum from 0 to 0x10FFFF -- and you care about how JS code is written |
2022-12-04 11:08:17 +0100 | <tomsmeding> | whether the user passed you "\x40" or "@" or "\64" is all the same to you -- it's [c] where fromEnum c == 64 |
2022-12-04 11:08:54 +0100 | <tomsmeding> | difference between syntax (= code) and values (= data) |
2022-12-04 11:11:13 +0100 | <mauke> | > "String.fromCodepoint(" ++ intercalate ", " (map (show . ord) "yo\n\"☺️\"") ++ ")" |
2022-12-04 11:11:14 +0100 | <lambdabot> | "String.fromCodepoint(121, 111, 10, 34, 9786, 65039, 34)" |
2022-12-04 11:11:30 +0100 | <mauke> | oops, should be fromCodePoint |
2022-12-04 11:11:34 +0100 | <tomsmeding> | TIL that takes multiple arguments |
2022-12-04 11:11:58 +0100 | <mauke> | it even takes 0 arguments, contrary to what MDN says |
2022-12-04 11:12:05 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2022-12-04 11:12:08 +0100 | <mauke> | (a good chunk of MDN is written by baboons) |
2022-12-04 11:12:26 +0100 | <tomsmeding> | maybe the standard doesn't require it to take 0 arguments but your particular JS implementation does? |
2022-12-04 11:12:39 +0100 | <tomsmeding> | wouldn't be the first time implementation diverged from standard |
2022-12-04 11:12:44 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds) |
2022-12-04 11:13:09 +0100 | <mauke> | nah: https://tc39.es/ecma262/multipage/text-processing.html#sec-string.fromcodepoint |
2022-12-04 11:13:39 +0100 | <mauke> | (step 3) |
2022-12-04 11:14:12 +0100 | acidjnk_new | (~acidjnk@p200300d6e7137a5181fc87d2e5daef70.dip0.t-ipconnect.de) |
2022-12-04 11:14:53 +0100 | Lord_of_Life_ | Lord_of_Life |
2022-12-04 11:15:57 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-04 11:16:17 +0100 | <tomsmeding> | I mean, mdn doesn't explicitly say that 0 arguments is _disallowed_ :p |
2022-12-04 11:16:28 +0100 | <tomsmeding> | but it sure suggests it indeed |
2022-12-04 11:16:43 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
2022-12-04 11:17:47 +0100 | acidjnk | (~acidjnk@p200300d6e7137a51c5d563f76206e160.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
2022-12-04 11:18:27 +0100 | <tomsmeding> | mdn doesn't give the full spec anyway, it doesn't specify that it throws RangeError for <0 or >0x10ffff |
2022-12-04 11:18:30 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::a58f) (Ping timeout: 256 seconds) |
2022-12-04 11:19:38 +0100 | <mauke> | MDN used to say that the syntax of new was 'object = new Class(arguments)' |
2022-12-04 11:19:47 +0100 | <mauke> | as if the 'object =' part was required |
2022-12-04 11:20:18 +0100 | <money> | Psh whatever |
2022-12-04 11:20:37 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2022-12-04 11:21:17 +0100 | zeenk | (~zeenk@2a02:2f04:a30d:4300::7fe) |
2022-12-04 11:21:50 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-04 11:22:52 +0100 | nihonium | (~nihonium@46.148.105.76) |
2022-12-04 11:23:35 +0100 | kenran | (~user@user/kenran) |
2022-12-04 11:23:42 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-12-04 11:23:50 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-04 11:25:12 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 11:26:09 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-12-04 11:27:19 +0100 | nihonium | (~nihonium@46.148.105.76) (Ping timeout: 260 seconds) |
2022-12-04 11:28:04 +0100 | nihonium | (~nihonium@46.148.105.76) |
2022-12-04 11:29:38 +0100 | Inst_ | (~Inst@2601:6c4:4081:54f0:e862:ffc4:e60e:d92f) |
2022-12-04 11:33:23 +0100 | Inst | (~Inst@2601:6c4:4081:54f0:c5ff:1cee:beb9:d04b) (Ping timeout: 260 seconds) |
2022-12-04 11:35:31 +0100 | zer0bitz | (~zer0bitz@196.244.192.58) (Read error: Connection reset by peer) |
2022-12-04 11:36:29 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
2022-12-04 11:44:03 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-04 11:44:58 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-04 11:46:11 +0100 | <tomsmeding> | some of the pkg-config files on my machine are apparently borked, and this completely and utterly breaks pkg-config support in cabal |
2022-12-04 11:46:23 +0100 | <tomsmeding> | is there work in cabal to improve this situation |
2022-12-04 11:46:55 +0100 | <tomsmeding> | like, getting pkg-config module versions on-demand instead of "everything on the system" |
2022-12-04 11:48:28 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-04 11:48:35 +0100 | zeenk | (~zeenk@2a02:2f04:a30d:4300::7fe) (Quit: Konversation terminated!) |
2022-12-04 11:49:06 +0100 | <[Leary]> | tomsmeding: I remember reading a cabal issue about that: <https://github.com/haskell/cabal/issues/8494>. Supposed to be fixed by: <https://github.com/haskell/cabal/pull/8496>. |
2022-12-04 11:49:42 +0100 | <tomsmeding> | [Leary]: thanks, that's precisely my issue! |
2022-12-04 11:50:52 +0100 | img | (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 11:51:27 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2022-12-04 11:51:36 +0100 | <tomsmeding> | not sure why they insist on getting the entire bloody database before starting the solver :p |
2022-12-04 11:51:51 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
2022-12-04 11:52:00 +0100 | <tomsmeding> | I know, purity in the solver, but if I really modify the pkgconfig database halfway through cabal solving, I _expect_ cabal solving to break |
2022-12-04 11:52:16 +0100 | <maerwald[m]> | tomsmeding: the db is part of the solver |
2022-12-04 11:52:45 +0100 | <tomsmeding> | maerwald[m]: I expect the solver to query the pkg-config db every time it needs info about a package that it hasn't queried yet, and cache the result |
2022-12-04 11:52:46 +0100 | <tomsmeding> | s |
2022-12-04 11:52:59 +0100 | <tomsmeding> | it's impure, yes |
2022-12-04 11:53:25 +0100 | <tomsmeding> | but anyway getting packages one-by-one before starting build _works_, just quite a lot slower than it needs to be :) |
2022-12-04 11:53:37 +0100 | <tomsmeding> | and significantly better to have as a fallback than to have no fallback at all |
2022-12-04 11:54:48 +0100 | <maerwald[m]> | I think it might just be an implementation difficulty |
2022-12-04 11:55:17 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 11:55:36 +0100 | kuribas | (~user@ptr-17d51emajr6v18pa5yl.18120a2.ip6.access.telenet.be) |
2022-12-04 11:55:48 +0100 | <maerwald[m]> | Needing lazy IO or so |
2022-12-04 11:56:02 +0100 | <tomsmeding> | ... lazy IO? |
2022-12-04 11:56:17 +0100 | <tomsmeding> | I get that making the solver monadic is a change that people won't make lightly |
2022-12-04 11:56:52 +0100 | <tomsmeding> | honestly personally I would unsafePerformIO my way out of this, caching results as I go, but I understand if people don't want that in cabal :) |
2022-12-04 11:59:47 +0100 | <tomsmeding> | maaan I'm running the XDG test cabal which is just 10 days too old to have this PR >.< |
2022-12-04 12:00:04 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 248 seconds) |
2022-12-04 12:00:59 +0100 | econo | (uid147250@user/econo) (Quit: Connection closed for inactivity) |
2022-12-04 12:04:57 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) |
2022-12-04 12:05:03 +0100 | img | (~img@user/img) |
2022-12-04 12:09:30 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2022-12-04 12:10:06 +0100 | img | (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 12:11:00 +0100 | mc47 | (~mc47@xmonad/TheMC47) |
2022-12-04 12:16:58 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 12:21:41 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 255 seconds) |
2022-12-04 12:22:35 +0100 | kenaryn | (~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr) |
2022-12-04 12:23:31 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-04 12:25:41 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 12:25:53 +0100 | dextaa | (~DV@user/dextaa) (Quit: Ping timeout (120 seconds)) |
2022-12-04 12:26:14 +0100 | dextaa | (~DV@user/dextaa) |
2022-12-04 12:29:21 +0100 | img | (~img@user/img) |
2022-12-04 12:30:15 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 255 seconds) |
2022-12-04 12:30:37 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-04 12:31:50 +0100 | anpad | (~pandeyan@user/anpad) (Read error: Connection reset by peer) |
2022-12-04 12:34:12 +0100 | anpad | (~pandeyan@user/anpad) |
2022-12-04 12:35:30 +0100 | pyrex_ | (~pyrex@2601:645:8781:1c90:a460:e23d:4864:da00) |
2022-12-04 12:37:41 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 12:39:39 +0100 | pyrex | (~pyrex@user/pyrex) (Ping timeout: 260 seconds) |
2022-12-04 12:47:22 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-12-04 12:48:04 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) (Ping timeout: 268 seconds) |
2022-12-04 12:51:13 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 12:51:47 +0100 | anpad | (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 12:52:16 +0100 | kenran | (~user@user/kenran) |
2022-12-04 12:52:34 +0100 | anpad | (~pandeyan@user/anpad) |
2022-12-04 12:53:46 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-04 12:54:43 +0100 | califax | (~califax@user/califx) |
2022-12-04 12:55:44 +0100 | money | (money@user/polo) () |
2022-12-04 12:56:16 +0100 | money | (money@user/polo) |
2022-12-04 12:58:01 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 13:00:14 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-12-04 13:00:29 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds) |
2022-12-04 13:00:38 +0100 | <darkling> | Noob question: I've found (via Hoogle) a function in GHC.Utils.Misc that I want to use, but cabal says it's not in scope. If I try to import GHC.Utils.Misc, it says the module's not found. What am I missing? |
2022-12-04 13:01:24 +0100 | <darkling> | (ghc --version says 8.8.4; cabal --version is 3.0.0.0; build-depends says base >= 4.13 && <4.14) |
2022-12-04 13:01:28 +0100 | <c_wraith> | what package is hoogle telling you that function is in? |
2022-12-04 13:01:55 +0100 | img | (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 13:01:57 +0100 | <darkling> | https://hackage.haskell.org/package/ghc-9.4.2/docs/GHC-Utils-Misc.html |
2022-12-04 13:02:05 +0100 | <c_wraith> | what *package* is that? |
2022-12-04 13:02:06 +0100 | <darkling> | (I want "count") |
2022-12-04 13:02:17 +0100 | <darkling> | I don't know. It took me to that page. |
2022-12-04 13:02:32 +0100 | <c_wraith> | look in the top left corner of the page |
2022-12-04 13:02:51 +0100 | <darkling> | "ghc-9.4.2: The GHC API" |
2022-12-04 13:03:17 +0100 | <c_wraith> | So... that'd be version 9.4.2 of the ghc library |
2022-12-04 13:03:29 +0100 | <c_wraith> | which is in the package "ghc" |
2022-12-04 13:03:36 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) |
2022-12-04 13:03:50 +0100 | <c_wraith> | you could add "ghc" to your build-depends, but... I wouldn't |
2022-12-04 13:03:58 +0100 | <darkling> | Oh. I see. It feel like those functions are sufficiently basic and useful that they'd be a part of a standard library. |
2022-12-04 13:04:34 +0100 | <mauke> | eh. isn't count just length (filter ...)? |
2022-12-04 13:04:51 +0100 | <kjlid[m]> | What does the error "(case ... of ...)-syntax in pattern" even mean? |
2022-12-04 13:05:07 +0100 | sayola | (~sayola@dslb-088-064-186-217.088.064.pools.vodafone-ip.de) (Quit: Leaving.) |
2022-12-04 13:05:18 +0100 | <mauke> | > let f (case () of () -> ()) in () |
2022-12-04 13:05:19 +0100 | <lambdabot> | <hint>:1:29: error: parse error on input ‘in’ |
2022-12-04 13:05:37 +0100 | <mauke> | > let f (case () of () -> ()) = () in () |
2022-12-04 13:05:38 +0100 | <lambdabot> | <hint>:1:8: error: (case ... of ...)-syntax in pattern |
2022-12-04 13:05:43 +0100 | sayola | (~sayola@dslb-088-064-186-217.088.064.pools.vodafone-ip.de) |
2022-12-04 13:05:52 +0100 | <darkling> | mauke: Yes, it is, but I've found enough useful functions already that shaved off a word or two of implementation, I went looking for one here, and apparently found it but I shouldn't use it. :( |
2022-12-04 13:06:36 +0100 | <mauke> | kjlid[m]: apparently it means you put a case/of expression inside a pattern |
2022-12-04 13:07:26 +0100 | <kjlid[m]> | hmm |
2022-12-04 13:08:23 +0100 | <mauke> | > case () of case () of () -> () -> () |
2022-12-04 13:08:25 +0100 | <lambdabot> | <hint>:1:12: error: (case ... of ...)-syntax in pattern |
2022-12-04 13:08:34 +0100 | CiaoSen | (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2022-12-04 13:09:29 +0100 | <kjlid[m]> | https://paste.tomsmeding.com/j2RmKuD0 |
2022-12-04 13:09:59 +0100 | <kjlid[m]> | Is this inside a pattern? |
2022-12-04 13:10:13 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
2022-12-04 13:10:24 +0100 | <mauke> | what's the error message? |
2022-12-04 13:10:36 +0100 | <kjlid[m]> | What I just told you |
2022-12-04 13:10:45 +0100 | <kjlid[m]> | (case ... of ...)-syntax in pattern |
2022-12-04 13:11:03 +0100 | <kjlid[m]> | On that case |
2022-12-04 13:11:04 +0100 | razetime | (~quassel@49.207.211.219) |
2022-12-04 13:11:06 +0100 | <mauke> | no, the actual error message |
2022-12-04 13:11:41 +0100 | <kjlid[m]> | https://paste.tomsmeding.com/rWJ7N4ly |
2022-12-04 13:12:52 +0100 | <mauke> | what's in lines 1 .. 28? |
2022-12-04 13:13:00 +0100 | <mauke> | also, is that the first error? |
2022-12-04 13:13:17 +0100 | <kjlid[m]> | That's the only error |
2022-12-04 13:14:17 +0100 | <kjlid[m]> | https://paste.tomsmeding.com/IPnFuenn <- That's the whole file |
2022-12-04 13:15:30 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
2022-12-04 13:16:47 +0100 | CiaoSen | (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
2022-12-04 13:16:57 +0100 | <mauke> | missing 'do' after 'Just k ->' |
2022-12-04 13:17:21 +0100 | <kjlid[m]> | ooooh, ofcourse |
2022-12-04 13:17:28 +0100 | <mauke> | I get a different error, though |
2022-12-04 13:17:49 +0100 | <mauke> | "Parse error in pattern: ... Possibly caused by a missing 'do'?" |
2022-12-04 13:18:01 +0100 | <kjlid[m]> | Weird |
2022-12-04 13:18:17 +0100 | <mauke> | ooh, I think I see what's going on |
2022-12-04 13:18:35 +0100 | <kjlid[m]> | Alright |
2022-12-04 13:18:53 +0100 | <mauke> | you can't have <- in the middle of an expression |
2022-12-04 13:19:13 +0100 | <mauke> | it's special syntax in do blocks and list comprehensions (and pattern guards) |
2022-12-04 13:19:27 +0100 | <kjlid[m]> | I do? |
2022-12-04 13:19:47 +0100 | <kjlid[m]> | Oh yeah |
2022-12-04 13:19:50 +0100 | <kjlid[m]> | You mean without the 'do'? |
2022-12-04 13:20:18 +0100 | <mauke> | so: case (getKey ...) of Nothing -> ...; Just k -> userIds <- ... can't be parsed as a single expression |
2022-12-04 13:20:58 +0100 | <mauke> | so I think it just turns into: case (getKey ...) of { Nothing -> ...; Just k -> userIds } <- ... |
2022-12-04 13:20:58 +0100 | <kjlid[m]> | Makes sense |
2022-12-04 13:21:24 +0100 | <mauke> | and then you have a case expression as a pattern on the left hand side of <- in the outer do block |
2022-12-04 13:21:42 +0100 | <kjlid[m]> | Ah yeah, suddenly the error makes some sense |
2022-12-04 13:23:44 +0100 | <mauke> | it is of course rather misleading that the error location points at "case" (line 28) instead of "<-" (line 31) |
2022-12-04 13:23:50 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 268 seconds) |
2022-12-04 13:25:28 +0100 | <mauke> | kjlid[m]: my error message: https://paste.tomsmeding.com/pxEgrt9y |
2022-12-04 13:26:06 +0100 | <kjlid[m]> | Interesting. I'm using ghc 9.4.2 |
2022-12-04 13:26:49 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::37af) |
2022-12-04 13:27:50 +0100 | <pagnol> | is there something more idomatic for (\a b -> f b) ? |
2022-12-04 13:28:23 +0100 | <pagnol> | and more idiomatic than (\_ a -> f a) |
2022-12-04 13:30:31 +0100 | kenaryn | (~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr) (Quit: leaving) |
2022-12-04 13:31:20 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
2022-12-04 13:31:39 +0100 | <mauke> | const f? |
2022-12-04 13:31:41 +0100 | <jackdk> | `const f`? |
2022-12-04 13:31:53 +0100 | <jackdk> | yeah |
2022-12-04 13:33:19 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-04 13:34:21 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-04 13:34:37 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 13:35:07 +0100 | <kjlid[m]> | Is there something like mapM that only ignores some values? Or should I just run a filter on the result? |
2022-12-04 13:35:20 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) |
2022-12-04 13:36:50 +0100 | <freeside> | in the same module where mapM is defined, I see filterM |
2022-12-04 13:37:22 +0100 | <kjlid[m]> | You do? |
2022-12-04 13:37:23 +0100 | califax | (~califax@user/califx) (Ping timeout: 255 seconds) |
2022-12-04 13:37:26 +0100 | <freeside> | ahem. Let me rephrase in Gen Z speak. From the people who brought you mapM, just dropped filterM, YASS QUEEN |
2022-12-04 13:37:36 +0100 | <freeside> | https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Monad.html |
2022-12-04 13:38:12 +0100 | werneta | (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds) |
2022-12-04 13:38:25 +0100 | <freeside> | also mfilter |
2022-12-04 13:38:28 +0100 | <kjlid[m]> | "If you want more functions like this then hit like and subcribe?" |
2022-12-04 13:38:54 +0100 | <kjlid[m]> | I was actually looking in https://hackage.haskell.org/package/base-4.17.0.0/docs/Prelude.html |
2022-12-04 13:38:57 +0100 | <freeside> | "you asked and WE DELIVERED! bonus content for first 1000 followers, mfilter!!!" |
2022-12-04 13:39:53 +0100 | <freeside> | Prelude = free substack. Control.Monad = paid substack, extra content, NSFW, subscribers only! |
2022-12-04 13:40:30 +0100 | <freeside> | literally defines mapAndUnzipM |
2022-12-04 13:40:56 +0100 | <darkling> | unzip? That's the NSFW bit, right? :) |
2022-12-04 13:41:36 +0100 | <freeside> | the really NSFW bits are `join` and (>=>) |
2022-12-04 13:41:39 +0100 | <mauke> | touch && unzip && finger && mount && yes |
2022-12-04 13:42:01 +0100 | <mauke> | that's why I don't use shell scripts. it's dirty. |
2022-12-04 13:42:21 +0100 | <freeside> | remember to use protection! (touch && unzip && finger && mount && yes) > /dev/null 2>&1 |
2022-12-04 13:43:52 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
2022-12-04 13:44:24 +0100 | <kjlid[m]> | Speaking of NSFW, is import Package () the same as import Package or does it import nothing at all from Package? |
2022-12-04 13:44:25 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-04 13:44:39 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-04 13:44:54 +0100 | <geekosaur> | it imports only instances |
2022-12-04 13:45:10 +0100 | <kjlid[m]> | Alright |
2022-12-04 13:45:11 +0100 | crazazy`` | (~user@130.89.171.62) |
2022-12-04 13:47:13 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2022-12-04 13:47:19 +0100 | crazazy` | (~user@130.89.173.127) (Ping timeout: 260 seconds) |
2022-12-04 13:48:50 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Write error: Connection reset by peer) |
2022-12-04 13:49:48 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-04 13:50:36 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
2022-12-04 13:54:03 +0100 | <mauke> | huh. I never questioned it because that's basically how perl works, too |
2022-12-04 13:55:53 +0100 | <freeside> | orly |
2022-12-04 13:56:13 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 13:56:22 +0100 | <freeside> | So I've spent the last few days on a university discord watching some of the CS undergrads work on AdventOfCode in various languages including Rust, C++, and Haskell |
2022-12-04 13:57:11 +0100 | <freeside> | it was interesting to watch them present Haskell solutions because, TBH, the code didn't look that different from the more imperative languages |
2022-12-04 13:57:20 +0100 | <freeside> | and I was reminded of the quip "you can write FORTRAN in any language". |
2022-12-04 13:58:26 +0100 | <freeside> | It occurs to me that Haskell feels like it has a much larger working vocabulary because there are so many more "words" to learn, from mapM_ to runParser to <- ask, and that doesn't even get into the Lens stuff |
2022-12-04 13:59:16 +0100 | <freeside> | whereas most other OOPy languages would involve some amount of setup after importing a library -- you'd need to instantiate some kind of swiss-army-interface, and then you'd need to find ways to wire up your existing problem to the solution API |
2022-12-04 13:59:54 +0100 | <freeside> | in Haskell, thanks to typeclasses, you can just do the import and be about your business, adding a fair amount of functionality in just another line or two of code. This takes some getting used to. |
2022-12-04 14:00:07 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 14:01:28 +0100 | <[exa]> | not sure that the lack of a framework setup is a typeclass-induced feature |
2022-12-04 14:01:35 +0100 | <[exa]> | freeside: did you see servant import lists? :D |
2022-12-04 14:01:44 +0100 | <freeside> | something i haven't touched yet |
2022-12-04 14:02:06 +0100 | <mauke> | .oO( agda sunt servanda ) |
2022-12-04 14:02:20 +0100 | califax | (~califax@user/califx) |
2022-12-04 14:02:27 +0100 | <[exa]> | as with fortran, you can write the brutal framework setup boilerplate in any language. :D |
2022-12-04 14:02:43 +0100 | <freeside> | I was quite happy with being able to leverage Megaparsec to say ( (int `separatedBy` char '-') `separatedBy` char ',' ) |
2022-12-04 14:03:46 +0100 | <mauke> | http://sprunge.us/e5GE8P base only |
2022-12-04 14:03:52 +0100 | <mauke> | no items. final destination. |
2022-12-04 14:03:54 +0100 | <freeside> | I have no objection to the way Rust does it: scan_fmt!(l, "{d}-{d},{d}-{d}", i32, i32, i32, i32).ok() ... but I kind of prefer how Haskell lets me phrase the semantics of the solution in a more declarative way |
2022-12-04 14:03:56 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-04 14:03:57 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-12-04 14:05:13 +0100 | <mauke> | oh yeah, you could do it in C with repeated calls to scanf("%u-%u,%u-%u", ...) |
2022-12-04 14:05:18 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-12-04 14:05:35 +0100 | parsnip | (~parsnip@user/parsnip) (i shall miss thee) |
2022-12-04 14:06:38 +0100 | <[exa]> | freeside: oh how nice they finally got rid of the scanf scourge with this new cool completely different syntax, right |
2022-12-04 14:07:26 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-04 14:09:16 +0100 | <freeside> | heh |
2022-12-04 14:10:06 +0100 | <mauke> | while (scanf("%u-%u,%u-%u", &a, &b, &c, &d) == sizeof "OK\n") { |
2022-12-04 14:10:33 +0100 | <mauke> | self-mockumenting code |
2022-12-04 14:11:34 +0100 | <yin> | yushyin: unfortunately i'm getting `No code actions available` |
2022-12-04 14:12:27 +0100 | <yin> | maybe this hls version doesn't support it... |
2022-12-04 14:17:42 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
2022-12-04 14:18:18 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-04 14:20:16 +0100 | <freeside> | yin: what version of hls are you running, against what version of ghc? |
2022-12-04 14:21:06 +0100 | <yin> | hls 1.8.0.0 on ghc 9.4.2 |
2022-12-04 14:21:47 +0100 | <freeside> | any better luck with other editors? |
2022-12-04 14:22:15 +0100 | <freeside> | that reminds me, i should boot up vs code. i just got HLS working with 9.2.5 with emacs yesterday |
2022-12-04 14:22:49 +0100 | <fizbin> | I can get vs code to do everything with haskell except actually run it. |
2022-12-04 14:22:55 +0100 | <yin> | i'm now getting inferred type sigratures with vim.lsp.buf.hover. i don't think i was earlier, maybe it takes time to load (?) |
2022-12-04 14:23:26 +0100 | <fizbin> | Which is fine because I have a terminal and I can run "stack runhaskell myfile.hs", but a bit weird and annoying. |
2022-12-04 14:23:59 +0100 | <mauke> | I just remembered Text.ParserCombinators.ReadP |
2022-12-04 14:24:57 +0100 | <fizbin> | Yeah, remembering ReadP last night with aoc would have been better. My hand-rolled parsing was... well, I guess it worked. |
2022-12-04 14:25:44 +0100 | <fizbin> | read and weep: https://github.com/fizbin/aoc2022/blob/main/aoc4.hs |
2022-12-04 14:26:30 +0100 | <mauke> | handrolled: http://sprunge.us/e5GE8P |
2022-12-04 14:26:35 +0100 | <mauke> | with ReadP: http://sprunge.us/M0TVci |
2022-12-04 14:26:54 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 265 seconds) |
2022-12-04 14:27:14 +0100 | <freeside> | mmm. I did a version using List.Data.Split, and a version using Megaparsec. https://github.com/mengwong/adventofcode/blob/2022/apps/aoc2022-day04-megaparsec.hs |
2022-12-04 14:28:39 +0100 | <yin> | -- parse numbers from a string |
2022-12-04 14:28:39 +0100 | <yin> | parseNums :: (Read a,Num a) => String -> [a] |
2022-12-04 14:28:39 +0100 | <yin> | parseNums xs | null n = [] | otherwise = read n : parseNums r where (n,r) = span isDigit $ dropWhile (not . isDigit) xs |
2022-12-04 14:29:26 +0100 | <fizbin> | Oooh. I have a similar utility function for python that is quite useful during aoc. |
2022-12-04 14:29:30 +0100 | <freeside> | splitOn was as low-level as I wanted to get ... https://github.com/mengwong/adventofcode/blob/2022/apps/aoc2022-day04.hs |
2022-12-04 14:29:57 +0100 | <mauke> | fizbin: I think do notation and better names would clean that up a lot |
2022-12-04 14:30:46 +0100 | nihonium | (~nihonium@46.148.105.76) (Quit: leaving) |
2022-12-04 14:31:29 +0100 | <mauke> | yin: that looks like it should be split into two parts, extracting substrings and mapping read over them |
2022-12-04 14:32:12 +0100 | <yin> | mauke: what do you mean? |
2022-12-04 14:32:35 +0100 | img | (~img@user/img) |
2022-12-04 14:33:24 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-04 14:33:47 +0100 | <mauke> | parseNums = map read . extractRuns isDigit |
2022-12-04 14:33:55 +0100 | <mauke> | with extractRuns to be written separately |
2022-12-04 14:34:20 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 260 seconds) |
2022-12-04 14:34:23 +0100 | <yin> | would that get fused or otherwise optimized? |
2022-12-04 14:34:26 +0100 | <mauke> | I think that would make it simpler |
2022-12-04 14:35:18 +0100 | <mauke> | > groupBy ((==) `on` isDigit) "1-2,69-420" |
2022-12-04 14:35:20 +0100 | <lambdabot> | ["1","-","2",",","69","-","420"] |
2022-12-04 14:36:41 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-12-04 14:37:12 +0100 | <mauke> | > [n | w <- groupBy ((==) `on` isDigit) "1-2,69-420", [(n, "")] <- reads w] |
2022-12-04 14:37:13 +0100 | <lambdabot> | error: |
2022-12-04 14:37:13 +0100 | <lambdabot> | • Couldn't match expected type ‘(a0, String)’ |
2022-12-04 14:37:13 +0100 | <lambdabot> | with actual type ‘[(a, [Char])]’ |
2022-12-04 14:37:24 +0100 | <mauke> | > [n | w <- groupBy ((==) `on` isDigit) "1-2,69-420", (n, "") <- reads w] |
2022-12-04 14:37:25 +0100 | <lambdabot> | [] |
2022-12-04 14:37:56 +0100 | <mauke> | > [n | w <- groupBy ((==) `on` isDigit) "1-2,69-420", (n, "") <- reads w] :: [Int] |
2022-12-04 14:37:58 +0100 | <lambdabot> | [1,2,69,420] |
2022-12-04 14:38:13 +0100 | <mauke> | ew |
2022-12-04 14:38:14 +0100 | <yin> | i'm prioritizing time efficiency over readability in my utility functions. you can convince me your way is better if you show me the perf :) |
2022-12-04 14:38:37 +0100 | __monty__ | (~toonn@user/toonn) |
2022-12-04 14:38:40 +0100 | <mauke> | yin: dude, you're operating on a singly-linked list of unicode codepoints |
2022-12-04 14:38:41 +0100 | <freeside> | performance of the $1000 CPU, or performance of the $100,000/year engineer? |
2022-12-04 14:38:55 +0100 | <mauke> | this is very much the opposite of efficiency |
2022-12-04 14:39:55 +0100 | <yin> | performance the dinner my leaderboard is betting |
2022-12-04 14:41:08 +0100 | <freeside> | what other languages are in the running? |
2022-12-04 14:42:25 +0100 | <yin> | mauke: yeah but on a 32bit 512MB eeePC :) |
2022-12-04 14:44:40 +0100 | <yin> | freeside: off the top of my head python ruby scala java APL J and i suspect processing maybe |
2022-12-04 14:45:58 +0100 | <yin> | oh! and excel :D |
2022-12-04 14:51:23 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Ping timeout: 256 seconds) |
2022-12-04 14:51:29 +0100 | <yin> | we have some rules and each one of us has a limitation (the excel guy's being the fact that he's doing it in excel) and our metric is (t part2 - t part1) |
2022-12-04 14:56:20 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 268 seconds) |
2022-12-04 14:59:39 +0100 | <yin> | excel guy started strong championing day 1 with just a few seconds from part1 to part2 |
2022-12-04 15:03:17 +0100 | <yin> | i'm on a beaten up slow machine with a broken s key and *very* fragile charger cable and just a couple of minutes of battery |
2022-12-04 15:05:14 +0100 | <yin> | on day 13 we have to switch to an unfamiliar language |
2022-12-04 15:05:44 +0100 | <yin> | etc |
2022-12-04 15:09:23 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2022-12-04 15:10:35 +0100 | <freeside> | wait, how do you measure t part2 - t part1? specifically what is t |
2022-12-04 15:11:04 +0100 | <freeside> | like, wall clock time for the human to extend the code? |
2022-12-04 15:11:04 +0100 | <yin> | just the timestamp, you can fetch it from the API |
2022-12-04 15:11:47 +0100 | <freeside> | time part1 is released to the human, to the time part2 is released? |
2022-12-04 15:12:13 +0100 | <freeside> | then wouldn't it make sense to optimize for programmer efficiency rather than cpu time? |
2022-12-04 15:13:40 +0100 | acidjnk_new | (~acidjnk@p200300d6e7137a5181fc87d2e5daef70.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-04 15:14:03 +0100 | <yin> | it's the time we take to do part2, so much of that optimization can be prepared in part1 as we try to predict what part2 can be |
2022-12-04 15:14:12 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-04 15:14:38 +0100 | <yin> | if that makes sense |
2022-12-04 15:15:25 +0100 | <freeside> | definitely makes sense ... it's the reason i started optimizing for generality and optionality |
2022-12-04 15:16:03 +0100 | <freeside> | i was expecting today's part2 to have multiple ranges per elf, but it turned out to be a different extension |
2022-12-04 15:16:39 +0100 | <yin> | just to clarify, we measure the delta between stars, so if i finish part1 now and part2 10 minutes later, my score is 10m |
2022-12-04 15:17:03 +0100 | <yin> | i can take my time with part1 |
2022-12-04 15:17:10 +0100 | <yin> | doesn't count |
2022-12-04 15:18:01 +0100 | <freeside> | gotcha. yeah, i like that about aoc, it's a clever way to get people used to the idea that requirements evolve |
2022-12-04 15:19:20 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-04 15:21:14 +0100 | <yin> | yes. around day 15 spending time outdoors starts being a serious requirement :D |
2022-12-04 15:24:19 +0100 | <freeside> | hm. now i'm tempted to back and do previous years |
2022-12-04 15:27:48 +0100 | shailangsa | (~shailangs@host86-185-98-123.range86-185.btcentralplus.com) (Ping timeout: 265 seconds) |
2022-12-04 15:28:56 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 15:38:58 +0100 | <freeside> | Part 2: Surprise! Elon Musk has bought your company. His new instructions are: ... |
2022-12-04 15:39:26 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2022-12-04 15:40:44 +0100 | <yin> | that's why we're spending a few days here x |
2022-12-04 15:41:02 +0100 | <yin> | https://i.pinimg.com/474x/d2/dc/46/d2dc4643b891b3b6b4b86e35e0c19af2--serra.jpg |
2022-12-04 15:42:07 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2022-12-04 15:42:14 +0100 | sammelweis | (~quassel@c-68-48-18-140.hsd1.mi.comcast.net) (Ping timeout: 260 seconds) |
2022-12-04 15:42:29 +0100 | <yin> | up in the mountains, no people in sight |
2022-12-04 15:42:39 +0100 | <yin> | just fresh air and aoc |
2022-12-04 15:43:21 +0100 | <freeside> | Y'all are two Netflix showrunners away from a horror murder mystery |
2022-12-04 15:43:44 +0100 | <freeside> | Every night, the slowest programmer is mysteriously murdered |
2022-12-04 15:44:04 +0100 | <yin> | :D |
2022-12-04 15:44:05 +0100 | <freeside> | "an a.out thriller" |
2022-12-04 15:46:03 +0100 | <yin> | gladly the cell phone reception there is not nearly enough for netflix |
2022-12-04 15:46:19 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 15:46:30 +0100 | <freeside> | (Spoiler: the killer turned out to be the Excel accountant) |
2022-12-04 15:49:35 +0100 | acidjnk_new | (~acidjnk@p200300d6e7137a41a959b7c74413fccb.dip0.t-ipconnect.de) |
2022-12-04 15:51:00 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
2022-12-04 15:52:15 +0100 | <yin> | fun fact. do you know what the people from this schist village are called? |
2022-12-04 15:52:49 +0100 | <yin> | Paul. no kidding. Popupation = 1 |
2022-12-04 15:59:44 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds) |
2022-12-04 16:01:20 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 16:03:27 +0100 | <tomsmeding> | yin: just clarifying, you aren't trying to run HLS on said eeePC right? |
2022-12-04 16:04:21 +0100 | <geekosaur> | heh |
2022-12-04 16:04:46 +0100 | geekosaur | has such an eeepc just over a meter from him, in fact |
2022-12-04 16:04:48 +0100 | <tomsmeding> | because if so, I know the source of your issues with HLS |
2022-12-04 16:05:14 +0100 | <tomsmeding> | and no, it's not the 32-bit or the slow cpu |
2022-12-04 16:05:14 +0100 | <geekosaur> | battery's shot though, but unlike modern machines it will run without a battery if connected to AC |
2022-12-04 16:05:24 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 248 seconds) |
2022-12-04 16:06:30 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-04 16:09:46 +0100 | shriekingnoise | (~shrieking@186.137.167.202) (Quit: Quit) |
2022-12-04 16:10:54 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-04 16:20:09 +0100 | shailangsa | (~shailangs@host86-186-136-124.range86-186.btcentralplus.com) |
2022-12-04 16:22:09 +0100 | rembo10 | (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 16:23:22 +0100 | img | (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 16:24:18 +0100 | rembo10 | (~rembo10@main.remulis.com) |
2022-12-04 16:26:34 +0100 | seydar | (~seydar@154-27-113-252.starry-inc.net) |
2022-12-04 16:27:54 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) (Ping timeout: 256 seconds) |
2022-12-04 16:28:15 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) |
2022-12-04 16:28:27 +0100 | <seydar> | I'm trying to make my do-notation a one-liner so that the perl gods of old will smile upon me: https://paste.tomsmeding.com/UyDtPcq0 |
2022-12-04 16:29:03 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 16:29:12 +0100 | <seydar> | but the commented out line doesn't work, because "Couldn't match type ‘IO’ with ‘[]’ Expected: [String] Actual: IO String" |
2022-12-04 16:29:40 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 16:30:20 +0100 | <tomsmeding> | seydar: do A <- B ; C === B >>= \A -> C |
2022-12-04 16:30:36 +0100 | <geekosaur> | `getContents >>= return . lines`, or `fmap lines getContents` |
2022-12-04 16:30:42 +0100 | <tomsmeding> | so: str <- getContents ; return (lines str) === getContents >>= \str -> return (lines str) |
2022-12-04 16:33:07 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-04 16:33:29 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 246 seconds) |
2022-12-04 16:33:43 +0100 | <seydar> | tomsmeding: I think that's what I'm doing, which is why I'm confused that it's not working |
2022-12-04 16:34:19 +0100 | <geekosaur> | you have the return in the wrong placre |
2022-12-04 16:34:21 +0100 | <seydar> | geekosaur: ah, it looks like I needed to put return before line, as opposed to before everything (as you have it vs. return . getContents >>= lines) |
2022-12-04 16:34:25 +0100 | <seydar> | yep |
2022-12-04 16:34:27 +0100 | <tomsmeding> | seydar: you wrote: return $ getContents >>= lines |
2022-12-04 16:34:27 +0100 | <tomsmeding> | whereas I wrote: getContents >>= return . lines |
2022-12-04 16:34:38 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 16:35:12 +0100 | <tomsmeding> | in essence you put the whole do-block inside 'return' |
2022-12-04 16:35:37 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) (Ping timeout: 268 seconds) |
2022-12-04 16:35:54 +0100 | shailangsa | (~shailangs@host86-186-136-124.range86-186.btcentralplus.com) (Ping timeout: 260 seconds) |
2022-12-04 16:36:03 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 16:37:02 +0100 | <seydar> | tomsmeding: ah gotcha gotcha |
2022-12-04 16:37:06 +0100 | <seydar> | thank you |
2022-12-04 16:37:31 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-04 16:38:02 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 16:40:53 +0100 | acidjnk_new | (~acidjnk@p200300d6e7137a41a959b7c74413fccb.dip0.t-ipconnect.de) (Remote host closed the connection) |
2022-12-04 16:41:09 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-12-04 16:41:15 +0100 | acidjnk_new | (~acidjnk@p200300d6e7137a416972f28bfc035f03.dip0.t-ipconnect.de) |
2022-12-04 16:42:29 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 16:43:26 +0100 | califax | (~califax@user/califx) |
2022-12-04 16:53:17 +0100 | zer0bitz | (~zer0bitz@196.244.192.57) |
2022-12-04 16:55:06 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-04 16:55:42 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 16:57:57 +0100 | <chymera> | how do I do `make clean` for a haskell project? do I need cabal? |
2022-12-04 16:58:26 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-04 16:59:01 +0100 | <tomsmeding> | chymera: rm *.hi *.o and any executables? |
2022-12-04 16:59:31 +0100 | <tomsmeding> | (assuming you're compiling with ghc directly) |
2022-12-04 16:59:59 +0100 | <tomsmeding> | chymera: you may also be interested in the -odir and -hidir options of ghc in that case |
2022-12-04 17:02:16 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 17:04:26 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2022-12-04 17:05:44 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds) |
2022-12-04 17:06:01 +0100 | seydar | (~seydar@154-27-113-252.starry-inc.net) (Quit: leaving) |
2022-12-04 17:07:10 +0100 | <ksu> | if compilation time is not an issue, you could use -no-keep-hi-files -no-keep-o-files |
2022-12-04 17:07:58 +0100 | segfaultfizzbuzz | (~segfaultf@23-93-74-212.fiber.dynamic.sonic.net) |
2022-12-04 17:08:00 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-04 17:08:00 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 17:08:02 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 17:08:26 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 17:09:59 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-04 17:13:10 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 265 seconds) |
2022-12-04 17:13:23 +0100 | jinsl | (~jinsl@2408:8207:2559:28e0:211:32ff:fec8:6aea) (Ping timeout: 264 seconds) |
2022-12-04 17:13:34 +0100 | jinsl- | (~jinsl@2408:8207:2554:1a50:211:32ff:fec8:6aea) |
2022-12-04 17:15:45 +0100 | zeenk | (~zeenk@2a02:2f04:a30d:4300::7fe) |
2022-12-04 17:17:35 +0100 | califax | (~califax@user/califx) |
2022-12-04 17:19:00 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-04 17:22:52 +0100 | ddellacosta | (~ddellacos@143.244.47.100) |
2022-12-04 17:24:32 +0100 | Guest11 | (~Guest11@2001:1c02:2b2e:5600:81ea:2a62:9134:c75e) |
2022-12-04 17:25:09 +0100 | Guest11 | (~Guest11@2001:1c02:2b2e:5600:81ea:2a62:9134:c75e) (Client Quit) |
2022-12-04 17:25:32 +0100 | CiaoSen | (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
2022-12-04 17:29:05 +0100 | pagnol | (~user@213-205-209-87.ftth.glasoperator.nl) (Remote host closed the connection) |
2022-12-04 17:31:40 +0100 | <yin> | tomsmeding: ha! not a chance |
2022-12-04 17:33:58 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-04 17:34:00 +0100 | <tomsmeding> | phew |
2022-12-04 17:34:05 +0100 | yin | zzz |
2022-12-04 17:34:09 +0100 | chexum_ | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 17:34:51 +0100 | <chymera> | tomsmeding: thanks, -odir and -hdir sound nice in principle, but the man page says e.g. odir is the “object” directory? |
2022-12-04 17:35:04 +0100 | <chymera> | I actually thought it would be an object dir |
2022-12-04 17:35:10 +0100 | <tomsmeding> | chymera: -odir is the place where the .o files are put, -hidir is the place where the .hi files are put ;) |
2022-12-04 17:35:15 +0100 | <chymera> | so I can keep my source and compiler output separate |
2022-12-04 17:35:17 +0100 | <chymera> | ah |
2022-12-04 17:35:19 +0100 | <chymera> | cool |
2022-12-04 17:35:27 +0100 | <chymera> | do I need any of them to execute the applicaion? |
2022-12-04 17:35:31 +0100 | <tomsmeding> | no |
2022-12-04 17:35:39 +0100 | Guest5 | (~Guest5@250.79-105-213.static.virginmediabusiness.co.uk) |
2022-12-04 17:35:42 +0100 | <chymera> | cool |
2022-12-04 17:35:43 +0100 | <tomsmeding> | treat them as .o files in the C world |
2022-12-04 17:35:48 +0100 | <tomsmeding> | if that means anything to you |
2022-12-04 17:35:50 +0100 | <Guest5> | Hello Haskell folks |
2022-12-04 17:36:33 +0100 | <Guest5> | I have done the unthinkable, and replaced my windows build with Ubuntu. It has not internet now! |
2022-12-04 17:36:41 +0100 | <Guest5> | I'm on my phone... |
2022-12-04 17:36:59 +0100 | <Guest5> | I can download GHC, but I also want cabal |
2022-12-04 17:37:07 +0100 | <Guest5> | What should I do!? |
2022-12-04 17:37:14 +0100 | <chymera> | yep, makes sense, I'm really new to haskell life and thus far it's been pretty rough so I treat everything like it's going to blow up in my face :D |
2022-12-04 17:37:26 +0100 | <sclv> | ghcup installs both |
2022-12-04 17:37:33 +0100 | <Guest5> | No internet |
2022-12-04 17:37:46 +0100 | <tomsmeding> | Guest5: https://downloads.haskell.org/~cabal/cabal-install-3.8.1.0/cabal-install-3.8.1.0-x86_64-linux-deb1… ? |
2022-12-04 17:37:58 +0100 | <Guest5> | Have to download things on my phone and copy them over by USB |
2022-12-04 17:38:25 +0100 | <Guest5> | Tom, do you think it will work with the debian binary on Ubuntu? |
2022-12-04 17:38:34 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-04 17:38:41 +0100 | <tomsmeding> | ubuntu is practically debian, wich a bunch of surface-level changes |
2022-12-04 17:38:43 +0100 | <Guest5> | That would save trying to build it at least... |
2022-12-04 17:38:44 +0100 | <tomsmeding> | so yes |
2022-12-04 17:38:55 +0100 | <tomsmeding> | s/wich/with/ |
2022-12-04 17:38:57 +0100 | <Guest5> | Ok awesome I'll try that and get back to you |
2022-12-04 17:39:16 +0100 | <Guest5> | Chimera, don't worry, Haskell is friendly |
2022-12-04 17:39:40 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 17:40:45 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 17:40:46 +0100 | <Guest5> | Also, how can I get things off of hackage? |
2022-12-04 17:41:12 +0100 | <Guest5> | Do I just find the repo in "contents" somehow? |
2022-12-04 17:41:42 +0100 | <tomsmeding> | Guest5: there's a .tar.gz link under the Downloads heading, above the readme |
2022-12-04 17:42:05 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-04 17:42:14 +0100 | <tomsmeding> | but you'll have to compile the thing yourself (should just be 'cabal build'), and get and compile dependencies yourself :p |
2022-12-04 17:42:15 +0100 | <Guest5> | Obviously this is only going to work for things without too many dependencies, but I at least want to use things like System.Random |
2022-12-04 17:42:59 +0100 | <Guest5> | Nothing with like a million layers of semigroups and profunctor lenses... |
2022-12-04 17:43:04 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-04 17:43:27 +0100 | <Guest5> | (arguably these should be in base?) |
2022-12-04 17:43:38 +0100 | <tomsmeding> | Guest5: for 'random' you'll only need 'splitmix', the rest are ghc boot libs (i.e. installed with ghc) |
2022-12-04 17:44:07 +0100 | <tomsmeding> | (also, for a *significant* quality of life improvement, try to get internet working...) |
2022-12-04 17:44:52 +0100 | <Guest5> | I'm making differentiable random sequences for a Cartesian product dictionary frame for machine learning |
2022-12-04 17:45:14 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 17:45:37 +0100 | <Guest5> | Does anyone know of an effecient 'divmod' implementation? |
2022-12-04 17:45:50 +0100 | <tomsmeding> | :t divMod |
2022-12-04 17:45:51 +0100 | <lambdabot> | Integral a => a -> a -> (a, a) |
2022-12-04 17:45:58 +0100 | <tomsmeding> | see also |
2022-12-04 17:46:00 +0100 | <tomsmeding> | :t quotRem |
2022-12-04 17:46:01 +0100 | <lambdabot> | Integral a => a -> a -> (a, a) |
2022-12-04 17:46:25 +0100 | <tomsmeding> | which is slightly more efficient than divMod, but divMod ensures that the remainder is always positive, even for negative inputs |
2022-12-04 17:46:40 +0100 | <Guest5> | Yeah, I have no idea why installing the most up to date Ubuntu on a shop bought machine would destroy the wifi drivers |
2022-12-04 17:46:57 +0100 | <Guest5> | Very disappointed in the gnu Cru for this |
2022-12-04 17:46:58 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-04 17:47:11 +0100 | <kjlid[m]> | How do I specify a bitfield in a C foreign type? If I set the fields to CUInt it tried to get the address of it and that is invalid |
2022-12-04 17:47:50 +0100 | <kjlid[m]> | I have a #starttype struct foo with a bunch of #field bar , CUint right now |
2022-12-04 17:47:52 +0100 | Guest5 | (~Guest5@250.79-105-213.static.virginmediabusiness.co.uk) (Quit: Client closed) |
2022-12-04 17:50:14 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-12-04 17:52:23 +0100 | jonathanx | (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
2022-12-04 17:53:28 +0100 | Scraeling | (~Scraeling@user/scraeling) |
2022-12-04 17:53:47 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 17:55:38 +0100 | kuribas | (~user@ptr-17d51emajr6v18pa5yl.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 27.1)) |
2022-12-04 17:59:47 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 18:00:13 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-04 18:04:20 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 248 seconds) |
2022-12-04 18:05:13 +0100 | <mauke> | generally, you don't |
2022-12-04 18:05:50 +0100 | <kjlid[m]> | Alright. What are my options then? |
2022-12-04 18:06:10 +0100 | <mauke> | cry |
2022-12-04 18:06:31 +0100 | <kjlid[m]> | Already tried that |
2022-12-04 18:08:19 +0100 | <glguy> | fizbin: I'm doing them in Haskell on the day and then sometimes I add them to my C++ repo later |
2022-12-04 18:11:58 +0100 | <kjlid[m]> | Would it work if i created a couple of C functions that takes the struct and returns the values within them and then us me those whenever i want to get those values? |
2022-12-04 18:12:17 +0100 | <mauke> | kjlid[m]: yes, accessor functions seem to be the only workaround |
2022-12-04 18:12:20 +0100 | <kjlid[m]> | And then use those* |
2022-12-04 18:12:23 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-04 18:12:43 +0100 | <mauke> | I don't see any GHC extension that would cover bitfields |
2022-12-04 18:13:02 +0100 | <mauke> | (which is why bitfields rarely appear in interfaces) |
2022-12-04 18:13:20 +0100 | <kjlid[m]> | Yeah I just found a six year old ghc ticket about it that referenced a mailing list discussion from 2008 |
2022-12-04 18:13:38 +0100 | <tomsmeding> | sounds legit |
2022-12-04 18:16:28 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 18:19:04 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
2022-12-04 18:21:14 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-12-04 18:21:48 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-04 18:23:49 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 18:23:53 +0100 | <fizbin> | glguy: huh. I was trying to figure out how you were doing things like today's star 1 in 2:20 in haskell as your solution on the day, but maybe with enough of a library ready to go ahead of time, it's doable. |
2022-12-04 18:24:21 +0100 | <glguy> | fizbin: did you look at the solution I posted? |
2022-12-04 18:27:58 +0100 | akegalj | (~akegalj@188.252.198.134) |
2022-12-04 18:28:53 +0100 | <glguy> | for a quick-and-dirty parse without any library helpers, you can go with something like |
2022-12-04 18:28:54 +0100 | <glguy> | > let { parse :: String -> [Int]; parse = map read . words . map (\x -> if isDigit x then x else ' ') } in parse "0-1,2-3" |
2022-12-04 18:28:55 +0100 | <lambdabot> | [0,1,2,3] |
2022-12-04 18:29:03 +0100 | <glguy> | and then all that's left is using <= |
2022-12-04 18:32:03 +0100 | <mauke> | is there a way to do part 1 without doing two sets of comparisons? |
2022-12-04 18:32:55 +0100 | <fizbin> | Yeah, that makes sense. I've got a similar utility function in python (finds all numbers with \b\d+\b and converts them to ints) |
2022-12-04 18:33:30 +0100 | razetime | (~quassel@49.207.211.219) (Ping timeout: 260 seconds) |
2022-12-04 18:34:24 +0100 | <mauke> | my @n = $str =~ /\d+/ag; |
2022-12-04 18:34:52 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 18:36:57 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2022-12-04 18:37:25 +0100 | dolio | (~dolio@130.44.134.54) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 18:39:44 +0100 | <fizbin> | > let { p1judge :: Int->Int->Int->Int->Bool; p1judge a b c d = (\x y -> (x `Data.Set.isSubsetOf` y) || (y `Data.Set.isSubsetOf` x)) (Data.Set.fromList [a..b]) (Data.Set.fromList [c..d]) } in [p1judge 0 1 2 3, p1judge 0 4 2 4] |
2022-12-04 18:39:46 +0100 | <lambdabot> | [False,True] |
2022-12-04 18:39:52 +0100 | <fizbin> | mauke: ^^^ |
2022-12-04 18:41:04 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 18:41:12 +0100 | <fizbin> | Depends on what you consider "doing two sets of comparisons" means, I suppose. |
2022-12-04 18:41:13 +0100 | <mauke> | yeah, that's two sets of comparisons with || |
2022-12-04 18:42:48 +0100 | <glguy> | mauke: you could do something like: case compare a c of LT -> d <= b; EQ -> True; GT -> b <= d |
2022-12-04 18:44:19 +0100 | <fizbin> | > let { p1judge :: Int->Int->Int->Int->Bool; p1judge a b c d = ((a-c)*(b-d)) <= 0 } in [p1judge 0 1 2 3, p1judge 0 4 2 4, p1judge 0 5 2 3, p1judge 0 3 2 5] |
2022-12-04 18:44:20 +0100 | <mauke> | hmm |
2022-12-04 18:44:20 +0100 | <lambdabot> | [False,True,True,False] |
2022-12-04 18:44:40 +0100 | [itchyjunk] | (~itchyjunk@user/itchyjunk/x-7353470) |
2022-12-04 18:45:47 +0100 | <fizbin> | How about that ^^^ ? |
2022-12-04 18:46:45 +0100 | causal | (~user@50.35.85.7) |
2022-12-04 18:46:46 +0100 | trev | (~trev@user/trev) |
2022-12-04 18:46:48 +0100 | <mauke> | nice |
2022-12-04 18:48:06 +0100 | Scraeling | (~Scraeling@user/scraeling) (Quit: Scraeling) |
2022-12-04 18:48:27 +0100 | Scraeling | (~Scraeling@user/scraeling) |
2022-12-04 18:48:36 +0100 | <trev> | sorry for the drive-by question, but can someone just tell me what the sweet version combo of ghc + hls + a formatter [fourmolu?]. i can't seem to get everything working together |
2022-12-04 18:50:08 +0100 | acidjnk_new | (~acidjnk@p200300d6e7137a416972f28bfc035f03.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-04 18:51:07 +0100 | <Scraeling> | ghcup shows 9.2.2 as the latest version available with hls |
2022-12-04 18:51:19 +0100 | <Scraeling> | 8.10.7 if you need 8.x |
2022-12-04 18:51:38 +0100 | <Scraeling> | Or you can build latest with hls yourself |
2022-12-04 18:52:44 +0100 | <trev> | Scraeling mine shows 9.4.2 as latest with hls |
2022-12-04 18:52:47 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2022-12-04 18:53:23 +0100 | <trev> | but when i use that then the formatter doesn't work, so i hunted down the supported version and it doesn't support ghc 9.4 lol |
2022-12-04 18:54:18 +0100 | <trev> | then i tried ghc 9.2.4 and HLS had some bug telling me i didn't add a config for MinGQ but i'm on linux and that's some windows crap! |
2022-12-04 18:55:23 +0100 | <fizbin> | I'm using stack with LTS 19.33 so that I get ghc 9.0.2 which is supported by hls and everything else I want. But I don't need the latest features for this. |
2022-12-04 18:56:12 +0100 | <trev> | let me jump to that version and see. i don't need any new features either, just want to do AoC and tinker with Haskell a bit |
2022-12-04 18:56:16 +0100 | dolio | (~dolio@130.44.134.54) |
2022-12-04 19:01:15 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds) |
2022-12-04 19:01:28 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2022-12-04 19:04:37 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 19:05:33 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 19:05:45 +0100 | <trev> | nope, i still get some missing setInitialDynFlags in my ghc settings errors when the HLS starts up |
2022-12-04 19:06:30 +0100 | <trev> | oh well..i will just live without formatting on save for now...like a peasant |
2022-12-04 19:12:18 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-12-04 19:13:36 +0100 | acidjnk | (~acidjnk@p200300d6e7137a4188c21b5678eecc17.dip0.t-ipconnect.de) |
2022-12-04 19:15:12 +0100 | ddellacosta | (~ddellacos@143.244.47.100) (Quit: WeeChat 3.7.1) |
2022-12-04 19:17:06 +0100 | rburkholder | (~blurb@96.45.2.121) |
2022-12-04 19:18:27 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-04 19:19:20 +0100 | ddellacosta | (~ddellacos@143.244.47.100) |
2022-12-04 19:20:20 +0100 | <tomsmeding> | trev: ghcup upgrade / ghcup update? |
2022-12-04 19:20:30 +0100 | <tomsmeding> | which hls version are you getting |
2022-12-04 19:21:34 +0100 | <trev> | tomsmeding i was trying to get 9.2.4 cause that seems to have HLS with formatter support |
2022-12-04 19:21:40 +0100 | <tomsmeding> | trev: which _HLS_ version |
2022-12-04 19:21:43 +0100 | <tomsmeding> | 1.8.0.0? |
2022-12-04 19:21:47 +0100 | <trev> | yes |
2022-12-04 19:22:01 +0100 | <tomsmeding> | ah, okay I was thinking you might be getting an old hls version |
2022-12-04 19:22:08 +0100 | <tomsmeding> | 9.2.4 should work with hls though??? |
2022-12-04 19:22:15 +0100 | <tomsmeding> | works perfectly over here |
2022-12-04 19:22:27 +0100 | <trev> | yes, i had some other issues so i did ghcup nuke and now i'm starting over |
2022-12-04 19:22:32 +0100 | <tomsmeding> | :') |
2022-12-04 19:22:55 +0100 | <trev> | is there a reason why the default ghc is 9.2.5 with no HLS support? |
2022-12-04 19:23:12 +0100 | <glguy> | time |
2022-12-04 19:23:37 +0100 | <trev> | fair enough |
2022-12-04 19:24:55 +0100 | <trev> | now i get this error: ghcide compiled against GHC 9.4.2 but currently using 9.0.2 |
2022-12-04 19:25:28 +0100 | <tomsmeding> | trev: restart your editor |
2022-12-04 19:25:49 +0100 | <tomsmeding> | every ghc version needs a separately compiled hls executable, so you have a couple executables on your machine |
2022-12-04 19:26:04 +0100 | <tomsmeding> | changing the ghc version in a project probably doesn't automatically restart hls, so you end up with the wrong executable running |
2022-12-04 19:26:16 +0100 | <trev> | makes sense. |
2022-12-04 19:26:48 +0100 | <trev> | lol restarted and it doesn't seem to be running at all now |
2022-12-04 19:27:46 +0100 | <trev> | oh wait, now it jumped a version |
2022-12-04 19:27:47 +0100 | <trev> | ghcide compiled against GHC 9.4.2 but currently using 9.2.5 |
2022-12-04 19:28:11 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-04 19:28:18 +0100 | <trev> | maybe i need to get rid of ghcide compiled with 9.4.2 |
2022-12-04 19:29:05 +0100 | <gurkenglas> | Is stack solver not a thing anymore? |
2022-12-04 19:29:36 +0100 | <tomsmeding> | trev: try running 'haskell-language-server-wrapper' in a terminal in your project directory |
2022-12-04 19:29:43 +0100 | <glguy> | gurkenglas: I thought that died years ago |
2022-12-04 19:29:43 +0100 | <tomsmeding> | does that detect the used ghc version correctly? |
2022-12-04 19:30:47 +0100 | <gurkenglas> | so the thing to do now is... run stack build, get dozens of lines to "try adding to extra-deps", repeat until convergence? |
2022-12-04 19:31:32 +0100 | akegalj | (~akegalj@188.252.198.134) (Quit: leaving) |
2022-12-04 19:31:37 +0100 | <glguy> | gurkenglas: I think for people who use stack they just try to stay mostly in a resolver |
2022-12-04 19:32:13 +0100 | <gurkenglas> | makes sense, maybe i can find the place where i left that trodden path |
2022-12-04 19:33:46 +0100 | Scraeling | (~Scraeling@user/scraeling) (Quit: Scraeling) |
2022-12-04 19:35:42 +0100 | <gurkenglas> | Given a folder with hundreds of "could not find module" errors upon stack build and no stack.yaml except the fresh one i just put there, how should I approach those errors? |
2022-12-04 19:36:46 +0100 | <gurkenglas> | There's apparently a lot of places you can talk about what other packages to look up those modules in |
2022-12-04 19:39:06 +0100 | jakalx | (~jakalx@base.jakalx.net) (Error from remote client) |
2022-12-04 19:39:25 +0100 | <tomsmeding> | gurkenglas: there's no .cabal file that lists dependencies? |
2022-12-04 19:39:30 +0100 | <gurkenglas> | nope |
2022-12-04 19:39:37 +0100 | <tomsmeding> | hackage has a whole bunch of packages with overlapping modules, so good luck :p |
2022-12-04 19:39:45 +0100 | <geekosaur> | package.yaml? |
2022-12-04 19:39:59 +0100 | <gurkenglas> | nope |
2022-12-04 19:40:14 +0100 | <tomsmeding> | not sure if there are overlapping modules in stackage, but I would be surprised if there aren't |
2022-12-04 19:40:25 +0100 | <tomsmeding> | but hoogle may help |
2022-12-04 19:40:34 +0100 | <tomsmeding> | @hoogle Control.Monad.Reader.Trans |
2022-12-04 19:40:35 +0100 | <lambdabot> | Control.Monad.Reader.Has class MonadTrans (t :: Type -> Type -> Type -> Type) |
2022-12-04 19:40:40 +0100 | <tomsmeding> | oh that's not very helpful |
2022-12-04 19:41:08 +0100 | <gurkenglas> | tomsmeding: that seems like a premature worry, first we can see whether telling it "just get those modules whereever they're defined" reduces the errors from 211 to 30 |
2022-12-04 19:41:28 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 252 seconds) |
2022-12-04 19:41:32 +0100 | <tomsmeding> | hm, I thought hoogle could search for module names, apparently not |
2022-12-04 19:41:41 +0100 | bobbingbob | (~dfadsva@2604:3d09:207f:f650::7b3a) |
2022-12-04 19:42:32 +0100 | <tomsmeding> | https://docs.haskellstack.org/en/latest/script_command/ |
2022-12-04 19:42:46 +0100 | <tomsmeding> | 'stack script' is apparently able to look up packages exposing the imported modules |
2022-12-04 19:42:54 +0100 | <geekosaur> | @hoogle module Control.Monad.Reader.Trans |
2022-12-04 19:42:54 +0100 | <lambdabot> | No results found |
2022-12-04 19:43:13 +0100 | <gurkenglas> | Neat. Can I tell vscode to treat these .hs files as scripts? |
2022-12-04 19:43:38 +0100 | <tomsmeding> | I guess you'd hope that 'stack script something.hs' would somehow print the packages being resolv.ed |
2022-12-04 19:43:42 +0100 | <tomsmeding> | s/\.// |
2022-12-04 19:49:11 +0100 | chexum_ | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-04 19:50:29 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-04 19:50:43 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-04 19:51:55 +0100 | <iqubic> | Is there a point to Divisble and Decidable beyond just "This lets me do linear time discrimination?" |
2022-12-04 19:52:27 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 19:55:49 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 19:55:56 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 19:56:00 +0100 | Chai-T-Rex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2022-12-04 19:56:40 +0100 | Chai-T-Rex | (~ChaiTRex@user/chaitrex) |
2022-12-04 19:57:09 +0100 | ddellacosta | (~ddellacos@143.244.47.100) (Ping timeout: 260 seconds) |
2022-12-04 19:57:23 +0100 | michalz | (~michalz@185.246.204.90) |
2022-12-04 19:57:25 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 19:58:06 +0100 | califax | (~califax@user/califx) |
2022-12-04 19:59:18 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-04 20:00:41 +0100 | <EvanR> | Divisible represents the contravariant version of applicative, so it completes a categorical puzzle |
2022-12-04 20:00:52 +0100 | <EvanR> | that it has at least 1 use makes it cool |
2022-12-04 20:01:01 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-04 20:01:37 +0100 | <sm> | gurkenglas: I think you can't make HLS handle stack/cabal scripts yet |
2022-12-04 20:03:02 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-04 20:05:14 +0100 | <kjlid[m]> | Where do I put `packages` in my cabal file? No matter where I put it I get `Unknown field: "packages"` |
2022-12-04 20:05:34 +0100 | <glguy> | packages: is from cabal.project - the configuration for your build workspace |
2022-12-04 20:05:48 +0100 | <glguy> | build-depends: is for your .cabal file, the packages that package depends on |
2022-12-04 20:06:22 +0100 | <kjlid[m]> | Oh. Duuh |
2022-12-04 20:09:48 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-04 20:09:58 +0100 | chomwitt | (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) |
2022-12-04 20:11:53 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) |
2022-12-04 20:14:01 +0100 | bontaq | (~user@ool-45779fe5.dyn.optonline.net) |
2022-12-04 20:18:18 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 20:26:05 +0100 | <iqubic> | EvanR: are there any real world situations where Divisible and/or Decidable are useful? |
2022-12-04 20:26:25 +0100 | <EvanR> | on this subject you probably know as much as me |
2022-12-04 20:30:44 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
2022-12-04 20:32:46 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
2022-12-04 20:33:16 +0100 | jonathanx | (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection) |
2022-12-04 20:33:40 +0100 | jonathanx | (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
2022-12-04 20:34:59 +0100 | Kaipei | (~Kaiepi@108.175.84.104) |
2022-12-04 20:37:19 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-12-04 20:37:59 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
2022-12-04 20:37:59 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 264 seconds) |
2022-12-04 20:38:55 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds) |
2022-12-04 20:41:04 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-04 20:42:05 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-04 20:42:05 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 20:44:05 +0100 | werneta | (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
2022-12-04 20:46:52 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-12-04 20:48:48 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-04 20:51:58 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-04 20:54:21 +0100 | <tomsmeding> | gurkenglas: sqlite3 ~/.stack/pantry/pantry.sqlite3 "select distinct package_name.name from hackage_cabal join package_name on hackage_cabal.name = package_name.id where (select contents from blob where id = hackage_cabal.cabal) like '%Control.Monad.Reader' || char(10) || '%';" |
2022-12-04 20:54:54 +0100 | <tomsmeding> | replace module name with the thing you're looking for |
2022-12-04 20:55:57 +0100 | <tomsmeding> | I believe this searches all packages on hackage, not just stackage, so there will be duplicates, but at least it's something |
2022-12-04 20:56:53 +0100 | <tomsmeding> | the char(10) is to ensure there's nothing after the module name, i.e. don't match Control.Monad.Reader.Trans |
2022-12-04 20:58:10 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) (Quit: Client closed) |
2022-12-04 21:01:25 +0100 | trev | (~trev@user/trev) (Quit: trev) |
2022-12-04 21:02:37 +0100 | <gurkenglas> | tomsmeding: not bad, though small misunderstanding. i was already able to extract the module names from the errors and feed them through a language model to get guesses at package names. i was not able to use that to get rid of the errors. stack install pandoc did not make vscode see Text.Pandoc. |
2022-12-04 21:03:18 +0100 | acidjnk | (~acidjnk@p200300d6e7137a4188c21b5678eecc17.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-04 21:03:28 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
2022-12-04 21:04:55 +0100 | <gurkenglas> | i tried a number of things involving stack.yaml and package.yaml and .cabal files. i'd like something that uses tools instead of having me interact with files |
2022-12-04 21:05:32 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) |
2022-12-04 21:06:09 +0100 | perrierjouet | (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
2022-12-04 21:06:44 +0100 | Xeroine | (~Xeroine@user/xeroine) (Excess Flood) |
2022-12-04 21:07:03 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-04 21:09:08 +0100 | <gurkenglas> | (because that tends to result in more comprehensible errors) |
2022-12-04 21:10:47 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
2022-12-04 21:14:02 +0100 | acidjnk | (~acidjnk@p200300d6e7137a4188c21b5678eecc17.dip0.t-ipconnect.de) |
2022-12-04 21:14:44 +0100 | <tomsmeding> | gurkenglas: ah :) |
2022-12-04 21:14:58 +0100 | <tomsmeding> | the whole design of haskell packaging tools is that you must list your dependencies in a file |
2022-12-04 21:15:04 +0100 | <tomsmeding> | so you aren't going to get around that :) |
2022-12-04 21:15:13 +0100 | <tomsmeding> | be it a *.cabal file or package.yaml |
2022-12-04 21:15:57 +0100 | <tomsmeding> | gurkenglas: 'stack install <libraryname>' and 'cabal install <libraryname>' are usually ineffective and sometimes actively harmful, please avoid running those commands at all costs |
2022-12-04 21:15:58 +0100 | <gurkenglas> | or a .hs file |
2022-12-04 21:16:10 +0100 | <tomsmeding> | not to be confused with 'cabal install <executablename>', which is totally fine, by the way |
2022-12-04 21:17:09 +0100 | <tomsmeding> | gurkenglas: the major build tools in haskell-land, stack and cabal, both take package dependencies from a *.cabal file, not from a .hs file. 'hpack' is a tool that automatically generates a *.cabal file from a package.yaml file, and hpack is automatically invoked by stack |
2022-12-04 21:17:29 +0100 | <tomsmeding> | so, what you want is impossible, I think |
2022-12-04 21:17:44 +0100 | <tomsmeding> | aside from using 'stack script', which is useful only for single-file programs |
2022-12-04 21:19:42 +0100 | <tomsmeding> | <gurkenglas> i tried a number of things involving stack.yaml and package.yaml and .cabal files. |
2022-12-04 21:19:44 +0100 | <tomsmeding> | wait, that didn't work? |
2022-12-04 21:19:53 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
2022-12-04 21:20:07 +0100 | <tomsmeding> | stack.yaml is not the right place, though if you insist on using stack, you'll need to add extra-deps entries there for non-stackage packages |
2022-12-04 21:21:19 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds) |
2022-12-04 21:21:27 +0100 | <gurkenglas> | you just wait what's impossible with next year's tech ^^ if i can mechanically look through a *.hs file to assemble the corresponding *.cabal/package.yaml, so can a tool |
2022-12-04 21:25:43 +0100 | <sm> | nifty sqlite querying of pantry tomsmeding, I haven't seen that before |
2022-12-04 21:26:02 +0100 | <sm> | pantry is a cache of hackage metadata, roughly ? |
2022-12-04 21:26:15 +0100 | pavonia | (~user@user/siracusa) |
2022-12-04 21:29:24 +0100 | fizbin | (~fizbin@user/fizbin) (Remote host closed the connection) |
2022-12-04 21:29:43 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-04 21:32:15 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 21:32:35 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds) |
2022-12-04 21:33:36 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
2022-12-04 21:38:14 +0100 | Bocaneri | (~sauvin@user/Sauvin) |
2022-12-04 21:38:38 +0100 | Bocaneri | Guest3282 |
2022-12-04 21:39:49 +0100 | Sauvin | (~sauvin@user/Sauvin) (Killed (NickServ (GHOST command used by Guest3282))) |
2022-12-04 21:39:53 +0100 | Guest3282 | Sauvin |
2022-12-04 21:42:23 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2022-12-04 21:42:56 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds) |
2022-12-04 21:43:37 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-04 21:44:15 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds) |
2022-12-04 21:45:03 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 21:50:31 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 21:52:40 +0100 | <gurkenglas> | Oh, idea. Probably I can ask the originator of this folder of *.hs files to run a command that will return what packages he has at what versions, then I can put that in the package.yaml. What command does he need to run? |
2022-12-04 21:53:18 +0100 | <geekosaur> | if he's not using stack.yaml or *.cabal then ghc-pkg list --user |
2022-12-04 21:53:58 +0100 | coot | (~coot@213.134.171.3) |
2022-12-04 21:53:59 +0100 | <geekosaur> | (here's hoping he isn't using nix) |
2022-12-04 21:54:06 +0100 | <gurkenglas> | hmm when i run that it returns nothing |
2022-12-04 21:54:17 +0100 | <geekosaur> | it won't if you have a cabal or stack based setup |
2022-12-04 21:54:18 +0100 | <gurkenglas> | (unless i leave out the --user) |
2022-12-04 21:54:28 +0100 | <geekosaur> | they both replace the user db |
2022-12-04 21:54:35 +0100 | zeenk | (~zeenk@2a02:2f04:a30d:4300::7fe) (Quit: Konversation terminated!) |
2022-12-04 21:54:55 +0100 | <gurkenglas> | i see, thanks. |
2022-12-04 21:55:08 +0100 | <geekosaur> | and the global db should only be occupied by the packages that ship with ghc, although I suppose he might have installed some packages there too so maybe leave off the --user |
2022-12-04 21:56:56 +0100 | <gurkenglas> | geekosaur: does that mean he'd need to run both, or is one a subset of the other? |
2022-12-04 21:57:22 +0100 | <geekosaur> | without any option it lists both global and user dbs |
2022-12-04 21:57:33 +0100 | <geekosaur> | or you can specify --global or --user |
2022-12-04 21:58:38 +0100 | Guest11 | (~Guest11@2001:1c02:2b2e:5600:cbae:a56e:e19b:fcee) |
2022-12-04 21:59:34 +0100 | <geekosaur> | I don't know if or how stack would do this, but cabal does keep a package db of its own. I just did: ghc-pkg list -f ~/.local/state/cabal/store/ghc-9.2.5/package.db |
2022-12-04 22:00:00 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-12-04 22:00:18 +0100 | <geekosaur> | note that that's with cabal 3.10-pre in XDG mode; it'll be ~/.cabal/store instead of ~/.local/state/cabal/store for released versions |
2022-12-04 22:00:34 +0100 | <geekosaur> | and of course whatever compiler version you have/use |
2022-12-04 22:02:10 +0100 | oldsk00l | (~znc@ec2-3-125-42-182.eu-central-1.compute.amazonaws.com) |
2022-12-04 22:03:58 +0100 | <geekosaur> | it copies entries from that into a project's private package db, iirc, so the project sees only the packages compatible with it and not other versions |
2022-12-04 22:04:25 +0100 | Guest11 | (~Guest11@2001:1c02:2b2e:5600:cbae:a56e:e19b:fcee) (Quit: Client closed) |
2022-12-04 22:05:50 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds) |
2022-12-04 22:05:54 +0100 | kenran | (~user@user/kenran) |
2022-12-04 22:07:02 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Remote host closed the connection) |
2022-12-04 22:09:47 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 264 seconds) |
2022-12-04 22:09:51 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2022-12-04 22:10:35 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 22:17:40 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-04 22:19:10 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-04 22:20:36 +0100 | tomokojun | (~tomokojun@37.19.210.31) |
2022-12-04 22:26:27 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
2022-12-04 22:28:11 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-04 22:31:18 +0100 | biberu | (~biberu@user/biberu) (Read error: Connection reset by peer) |
2022-12-04 22:35:18 +0100 | biberu | (~biberu@user/biberu) |
2022-12-04 22:36:05 +0100 | Sciencentistguy | (~sciencent@hacksoc/ordinary-member) (Quit: o/) |
2022-12-04 22:37:16 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) |
2022-12-04 22:39:11 +0100 | CiaoSen | (~Jura@p200300c95747e0002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
2022-12-04 22:39:23 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 22:40:09 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) (Client Quit) |
2022-12-04 22:42:45 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) |
2022-12-04 22:46:23 +0100 | <ballast> | How do you avoid cyclic dependencies in this case? https://paste.tomsmeding.com/N5f7opAT |
2022-12-04 22:47:01 +0100 | <ballast> | I could just throw BResource into A.hs but it morally belongs in B.hs |
2022-12-04 22:47:26 +0100 | <geekosaur> | there are .hs-boot files. I would strenuously avoid using them |
2022-12-04 22:47:39 +0100 | mikoto-chan | (~mikoto-ch@2001:999:680:9f4:6a82:d55c:feff:5f4) |
2022-12-04 22:48:01 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 22:48:29 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-04 22:48:33 +0100 | <EvanR> | since the data types are not mutually recursive you can put them in separate files, and the functions in a third file |
2022-12-04 22:49:01 +0100 | <ballast> | Yeah I was thinking of like making a B.Types module. I saw some comments that it was an antipattern and I kind of agree. |
2022-12-04 22:49:09 +0100 | <EvanR> | worst case scenario* |
2022-12-04 22:49:14 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) (Ping timeout: 260 seconds) |
2022-12-04 22:49:50 +0100 | <EvanR> | it's kind of hard to tell what's going on since BResource seems pointless where it is |
2022-12-04 22:50:07 +0100 | <ballast> | Was wondering what the best practices would be in this case. I could for example just make Resource parameterized and just have an alias for Resource BResource |
2022-12-04 22:50:27 +0100 | <EvanR> | why are the operations for Resource not in the file for Resource |
2022-12-04 22:51:32 +0100 | <ballast> | In this case it's because I want to separate B.hs into its own package eventually. i guess if I were to do that I would need to parameterize in B.hs instead of importing Resource. So I guess that solves my question lol |
2022-12-04 22:51:48 +0100 | opticblast | (~Thunderbi@secure-165.caltech.edu) |
2022-12-04 22:51:58 +0100 | <EvanR> | XY problem complete xD |
2022-12-04 22:53:53 +0100 | <EvanR> | yeah if func won't actually use details of Resource better to be parametric |
2022-12-04 22:54:56 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-04 22:55:41 +0100 | kenran | (~user@user/kenran) (Remote host closed the connection) |
2022-12-04 22:56:43 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-04 22:59:18 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 23:01:00 +0100 | Sciencentistguy | (~sciencent@hacksoc/ordinary-member) |
2022-12-04 23:02:15 +0100 | waleee | (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
2022-12-04 23:02:35 +0100 | califax | (~califax@user/califx) |
2022-12-04 23:04:36 +0100 | fizbin | (~fizbin@user/fizbin) (Ping timeout: 248 seconds) |
2022-12-04 23:05:23 +0100 | shriekingnoise | (~shrieking@186.137.167.202) |
2022-12-04 23:08:40 +0100 | bilegeek | (~bilegeek@2600:1008:b020:f89e:4697:1f09:bb25:aea6) |
2022-12-04 23:14:45 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) |
2022-12-04 23:15:52 +0100 | <gqplox[m]> | hi guys |
2022-12-04 23:15:56 +0100 | <gqplox[m]> | how's it going? |
2022-12-04 23:17:27 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-04 23:19:22 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2022-12-04 23:19:30 +0100 | califax | (~califax@user/califx) |
2022-12-04 23:20:57 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) |
2022-12-04 23:21:57 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 252 seconds) |
2022-12-04 23:22:55 +0100 | <dsal> | Not bad. Went efoiling yesterday and found out that what seemed to be the laziest thing was actually exhausting. This is slightly on topic. |
2022-12-04 23:23:32 +0100 | <ballast> | is there a way to make an alias so I can stop writing (Ord a, Show a) => a -> ... |
2022-12-04 23:23:43 +0100 | <dsal> | ballast: yeah, there's ConstraintKinds |
2022-12-04 23:23:47 +0100 | caryhartline | (~caryhartl@2600:1700:2d0:8d30:b403:2f20:d663:1bea) |
2022-12-04 23:24:20 +0100 | <ballast> | Thanks |
2022-12-04 23:24:38 +0100 | <dsal> | I wouldn't use it for that, though. I've used it where I had a lot of constraints in a lot of places |
2022-12-04 23:24:57 +0100 | <gqplox[m]> | oh wow that looks fun |
2022-12-04 23:25:04 +0100 | bjourne2 | (~bjorn@94.191.136.212.mobile.tre.se) |
2022-12-04 23:25:13 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2022-12-04 23:25:55 +0100 | <gqplox[m]> | i didn't have much time for advent of code today so my solution is a bit hacky with the parsing, i said i was gonna do it properly but didn't :( |
2022-12-04 23:25:57 +0100 | <gqplox[m]> | http://sprunge.us/1EsWOa |
2022-12-04 23:26:01 +0100 | <gqplox[m]> | can I see yours? |
2022-12-04 23:26:43 +0100 | TonyStone | (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) (Remote host closed the connection) |
2022-12-04 23:27:02 +0100 | <ballast> | dsal: if i have to use a bazooka to swat a fly until i get lsp working then so it shall be |
2022-12-04 23:27:24 +0100 | <dsal> | heh |
2022-12-04 23:27:41 +0100 | <ballast> | a little surprised there isn't a simple syntactic extension along those lines though |
2022-12-04 23:27:51 +0100 | <dsal> | gqplox[m]: this was mine from yesterday https://www.irccloud.com/pastebin/ijCxTrwy/day4.hs |
2022-12-04 23:27:53 +0100 | <ballast> | suppose ghc's extensions are bloated enough as-is |
2022-12-04 23:28:01 +0100 | <darkling> | gqplox[m]: Mine's here: https://github.com/darkling/AoC2022/blob/main/day04/Main.hs |
2022-12-04 23:28:12 +0100 | <dsal> | I tend to use megaparsec for everything, though. |
2022-12-04 23:28:17 +0100 | <EvanR> | ballast, seems like an odd combination of constraints to be using over and over |
2022-12-04 23:28:31 +0100 | <ballast> | i just used an example |
2022-12-04 23:28:49 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-04 23:29:10 +0100 | TonyStone | (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
2022-12-04 23:29:13 +0100 | <EvanR> | you can also define a class with all those classes as prereqs |
2022-12-04 23:29:28 +0100 | <dsal> | The one time I used ConstraintKinds, it was for a specific part of an application that I had to plumb through about 13 times: type PublishConstraint m = (MonadLogger m, MonadFail m, MonadMask m, MonadUnliftIO m, MonadIO m) |
2022-12-04 23:29:49 +0100 | <mauke> | gqplox[m]: http://sprunge.us/M0TVci |
2022-12-04 23:29:58 +0100 | <dsal> | Having MonadUnliftIO and MonadIO looks pretty dumb. |
2022-12-04 23:30:10 +0100 | chomwitt | (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 265 seconds) |
2022-12-04 23:30:37 +0100 | <mauke> | gqplox[m]: and http://sprunge.us/jUHW9Q for part 2 |
2022-12-04 23:31:30 +0100 | <EvanR> | just use the constraint EveryClassEver m => |
2022-12-04 23:31:46 +0100 | michalz | (~michalz@185.246.204.90) (Remote host closed the connection) |
2022-12-04 23:31:48 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-04 23:32:06 +0100 | <ballast> | is there a monad other than Identity satisfying (Monad* m) => m a -> ... |
2022-12-04 23:32:16 +0100 | <gqplox[m]> | ah nice thanks for sharing guys |
2022-12-04 23:33:06 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 268 seconds) |
2022-12-04 23:34:12 +0100 | <mauke> | gqplox[m]: length . filter id . map f is a weird way to write length . filter f |
2022-12-04 23:36:04 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-04 23:36:12 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-04 23:36:50 +0100 | Kaipei | (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds) |
2022-12-04 23:36:50 +0100 | <dsal> | (`countIf f` is `length . filter f` -- I just gave it a name because I used it a lot) |
2022-12-04 23:37:20 +0100 | fizbin | (~fizbin@user/fizbin) (Remote host closed the connection) |
2022-12-04 23:37:38 +0100 | fizbin | (~fizbin@user/fizbin) |
2022-12-04 23:37:52 +0100 | <dsal> | @pl solve f x = (length . filter id) $ map (uncurry f . parse) x |
2022-12-04 23:37:52 +0100 | <lambdabot> | solve = ((length . filter id) .) . map . (. parse) . uncurry |
2022-12-04 23:37:58 +0100 | <dsal> | grosss |
2022-12-04 23:38:13 +0100 | <dsal> | Oh, a single eta reduction is fine there |
2022-12-04 23:38:25 +0100 | zant | (~zant@62.214.20.26) |
2022-12-04 23:38:32 +0100 | <EvanR> | a soup of ), (, and . |
2022-12-04 23:38:54 +0100 | <EvanR> | with combinators thrown in for taste |
2022-12-04 23:40:50 +0100 | mikoto-chan | (~mikoto-ch@2001:999:680:9f4:6a82:d55c:feff:5f4) (Ping timeout: 246 seconds) |
2022-12-04 23:42:45 +0100 | shriekingnoise | (~shrieking@186.137.167.202) (Quit: Quit) |
2022-12-04 23:44:34 +0100 | money_ | (~money@user/polo) |
2022-12-04 23:45:09 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2022-12-04 23:45:30 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
2022-12-04 23:47:04 +0100 | bobbingbob | (~dfadsva@2604:3d09:207f:f650::7b3a) (Ping timeout: 256 seconds) |
2022-12-04 23:47:16 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2022-12-04 23:48:01 +0100 | mc47 | (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
2022-12-04 23:48:18 +0100 | shriekingnoise | (~shrieking@186.137.167.202) |
2022-12-04 23:50:51 +0100 | money_ | (~money@user/polo) (Ping timeout: 256 seconds) |
2022-12-04 23:51:09 +0100 | shriekingnoise | (~shrieking@186.137.167.202) (Client Quit) |
2022-12-04 23:51:16 +0100 | fizbin | (~fizbin@user/fizbin) (Read error: Connection reset by peer) |
2022-12-04 23:51:52 +0100 | <gqplox[m]> | oh |
2022-12-04 23:51:56 +0100 | <gqplox[m]> | res f x = length $ filter (uncurry f) (map parse x) |
2022-12-04 23:52:03 +0100 | <gqplox[m]> | this right? |
2022-12-04 23:52:47 +0100 | <dsal> | it'll fuse, but you don't need to explicitly run three passes. |
2022-12-04 23:53:01 +0100 | <dsal> | something like: res f = length . filter (uncurry f . parse) |
2022-12-04 23:54:26 +0100 | <gqplox[m]> | ohhhh |
2022-12-04 23:54:32 +0100 | <gqplox[m]> | i get it |
2022-12-04 23:54:32 +0100 | <gqplox[m]> | thank you |
2022-12-04 23:55:30 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-04 23:55:49 +0100 | <dsal> | I like that `length . filter f` abstraction, but you could also do it with a single foldMap if you construct a `String -> Sum Int` |
2022-12-04 23:56:50 +0100 | <gqplox[m]> | hmm ill look into that |
2022-12-04 23:57:36 +0100 | <dsal> | > foldMap (bool 0 1 . even) [1..11] :: Sum Int |
2022-12-04 23:57:37 +0100 | <lambdabot> | Sum {getSum = 5} |
2022-12-04 23:57:57 +0100 | <dsal> | Not exactly a recommendation, but I like monoids. |
2022-12-04 23:58:18 +0100 | <dsal> | I think people pretty universally hate `bool` as a function. Not enough people hate Bool as a concept. |
2022-12-04 23:58:19 +0100 | <gqplox[m]> | ok seems like this might require some reading |
2022-12-04 23:58:42 +0100 | <dsal> | > Sum 1 <> Sum 2 |
2022-12-04 23:58:43 +0100 | <lambdabot> | Sum {getSum = 3} |
2022-12-04 23:58:57 +0100 | <dsal> | > fold [1, 2, 3] :: Sum Int |
2022-12-04 23:58:59 +0100 | <lambdabot> | Sum {getSum = 6} |
2022-12-04 23:59:02 +0100 | <dsal> | > fold [1, 2, 3] :: Product Int |
2022-12-04 23:59:03 +0100 | <lambdabot> | Product {getProduct = 6} |
2022-12-04 23:59:06 +0100 | <dsal> | haha |
2022-12-04 23:59:30 +0100 | <dsal> | > (fold [1..10], fold [1..10]) :: (Sum Int, Product Int) |
2022-12-04 23:59:32 +0100 | <lambdabot> | error: |
2022-12-04 23:59:32 +0100 | <lambdabot> | • No instance for (Enum (Sum Int)) |
2022-12-04 23:59:32 +0100 | <lambdabot> | arising from the arithmetic sequence ‘1 .. 10’ |
2022-12-04 23:59:53 +0100 | <dsal> | Interesting |