Logs: freenode/#haskell
| 2020-09-23 14:10:55 | <AWizzArd> | merijn: omg, vi? |
| 2020-09-23 14:11:21 | <merijn> | vim and some crazy version of ghcide which works so I refuse to touch it :p |
| 2020-09-23 14:11:55 | <pjb> | wise programmer! |
| 2020-09-23 14:12:22 | × | chaosmasttter quits (~chaosmast@p200300c4a714f1015045819720a2acdb.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 2020-09-23 14:12:41 | → | mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com) |
| 2020-09-23 14:14:24 | <shad0w_> | AWizzArd: lmao not that you asked but, yes and yes ; ) |
| 2020-09-23 14:15:02 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds) |
| 2020-09-23 14:15:32 | <AWizzArd> | shad0w_: excellent, just one question: how do I know that my installation is working correctly? How can I trigger something special that shows me "yup, this thing IS working"? |
| 2020-09-23 14:15:32 | <shad0w_> | merijn: DONT TOUCH THAT. i was on version that worked. worked goood for months. then i updated without looking like a moron. |
| 2020-09-23 14:15:57 | <shad0w_> | AWizzArd: you open a haskell file. look at the mode-line bellow |
| 2020-09-23 14:16:07 | → | frdg joins (47b88ff9@pool-71-184-143-249.bstnma.fios.verizon.net) |
| 2020-09-23 14:16:23 | <shad0w_> | if lsp-mode and lsp-haskell are installed and lsp-mode is hooked to haskell-mode |
| 2020-09-23 14:16:24 | <sshine> | AWizzArd, I experienced that Haskell's LSP + Emacs LSP = really ugly. |
| 2020-09-23 14:16:31 | <merijn> | shad0w_: I've been working on this codebase for like 4 years without ghcide, so I'll be fine. But the fact that after opening it suddenly worked after updating is nice :) |
| 2020-09-23 14:16:53 | <sshine> | AWizzArd, maybe I'm an Emacs retard, but the "popups" would basically just flood the buffer in unwanted ways. it was not nice to look at yet. and it seemed somewhat easy to fix, but I couldn't bother. |
| 2020-09-23 14:17:15 | <sshine> | AWizzArd, this was a year ago. maybe something great happened here. the LSP part has surely matured. :) |
| 2020-09-23 14:17:26 | <AWizzArd> | sshine: so far I am used to Intero, which seems to offer the best Haskell experience yet. |
| 2020-09-23 14:17:35 | → | plutoniix joins (~q@node-ujv.pool-125-24.dynamic.totinternet.net) |
| 2020-09-23 14:17:41 | <sshine> | AWizzArd, ah ok. did you try VSCode yet? |
| 2020-09-23 14:17:51 | <shad0w_> | AWizzArd: first you'd see LSP[lsp-haskell:123456] in the modline |
| 2020-09-23 14:18:14 | <sshine> | AWizzArd, I did try Intero. it was good. |
| 2020-09-23 14:18:19 | <shad0w_> | second there'd be all kinds of popups as you start typing. autocomplete. type informations. really hard to miss |
| 2020-09-23 14:18:36 | <sshine> | yeah, it really kinda floods your screen. e.g. if your cursor rests on an identifier, it provides a type hint. |
| 2020-09-23 14:18:51 | → | thir joins (~thir@p200300f27f0fc60094e773283d7bf825.dip0.t-ipconnect.de) |
| 2020-09-23 14:19:03 | <frdg> | hololeap , pjb: sorry for late response. Here is a better explanation of what I would like to do. I have a predicate `p :: a -> b -> Bool`. I would like to apply `p` to with each comparison of the head of List1 with the elements of List2. If the predicate holds I would like to perform `IO ()` and run the function again with the tail of List1. |
| 2020-09-23 14:19:28 | sshine | will move back to Emacs once he has a day to pull out of his calendar. ;-) |
| 2020-09-23 14:19:31 | <AWizzArd> | shad0w_: okay, I’ll be looking for those popups and autocompletions. |
| 2020-09-23 14:19:51 | <AWizzArd> | sshine: very good. Emacs is the one and only (: |
| 2020-09-23 14:19:51 | <frdg> | the function should terminate if and only if List1 is empty |
| 2020-09-23 14:20:08 | <sshine> | AWizzArd, VSCode is pretty neat. but I miss my shortcuts. |
| 2020-09-23 14:20:35 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-23 14:20:42 | <AWizzArd> | sshine: I gave vscode a few tries. Not bad at all. |
| 2020-09-23 14:21:16 | <shad0w_> | make sure you turn on interactive-haskell-mode too |
| 2020-09-23 14:21:22 | <shad0w_> | AWizzArd: ^ |
| 2020-09-23 14:21:32 | <sshine> | frdg, so... for_ xs (\x -> for_ ys (\y -> when (p x y) m)) |
| 2020-09-23 14:21:35 | <shad0w_> | i found mine doesn't really work if i dont do that |
| 2020-09-23 14:22:02 | <Guest58863> | vs code is really good |
| 2020-09-23 14:22:15 | <sshine> | frdg, where those are Data.Foldable.for_ and Control.Monad.when |
| 2020-09-23 14:22:24 | <shad0w_> | i installed vs code today to see what all the buzz is about |
| 2020-09-23 14:22:32 | <shad0w_> | nope'd in 15 minutes : / |
| 2020-09-23 14:22:37 | <frdg> | sshine: I did not think of using when. What is `m` in the expression? |
| 2020-09-23 14:22:50 | <AWizzArd> | frdg: in your type signature you promise that you will deliver a pure value, a Bool. So you won’t be able to run IO action, as you didn’t promise it in the sig. |
| 2020-09-23 14:23:21 | × | jonathanx quits (~jonathan@dyn-8-sc.cdg.chalmers.se) (Remote host closed the connection) |
| 2020-09-23 14:23:35 | <sshine> | shad0w_, sure, I get it. but what I'm amazed about is: did you notice that it just downloaded and compiled the necessary LSP stuff? the user experience, beyond your unfortunate opinions about what a good editor is, is really great. :) (unfortunately I have too many opinions, too, which is why I have to run a combination of nvim, emacs and vscode.) |
| 2020-09-23 14:23:50 | → | alexm_ joins (~AlexM87@161.8.233.138) |
| 2020-09-23 14:24:27 | × | thir quits (~thir@p200300f27f0fc60094e773283d7bf825.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-09-23 14:24:40 | <shad0w_> | sshine: i already had all the lsp-stuff installed on my system so it didn't do anything |
| 2020-09-23 14:24:41 | <pjb> | frdg: the problem is that with list :: [a] head list :: a and tail list :: [a] therefore you cannot use the sane p to compare head list and tail list with the elements of list2. |
| 2020-09-23 14:24:42 | <AWizzArd> | shad0w_: is there a way to get the signature of a part of an expression? |
| 2020-09-23 14:24:46 | → | adamwespiser joins (~adam_wesp@209.6.42.110) |
| 2020-09-23 14:24:59 | <shad0w_> | AWizzArd: the wut? |
| 2020-09-23 14:25:17 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds) |
| 2020-09-23 14:25:17 | → | Saukk joins (~Saukk@2001:998:dc:4a36:4958:23a2:c14c:3a2f) |
| 2020-09-23 14:25:18 | <shad0w_> | sshine: but what it did was work right away. |
| 2020-09-23 14:25:20 | <AWizzArd> | shad0w_: I have: foo a b c And I want to know what type `foo a b` has. |
| 2020-09-23 14:25:43 | <shad0w_> | in emacs? sure |
| 2020-09-23 14:25:48 | <AWizzArd> | In Intero I can simply mark `foo a b` and will see its signature. The sig of the marked expression. |
| 2020-09-23 14:26:21 | <justsomeguy> | What's a good rule of thumb for when to use tuples rather than record types or a data structure like Map? |
| 2020-09-23 14:27:37 | <shad0w_> | AWizzArd: the way i do it is turn on the interactive-haskell-mode |
| 2020-09-23 14:27:49 | <shad0w_> | go C-c C-l |
| 2020-09-23 14:27:51 | <justsomeguy> | (Tuples seem strange to me, so I'd like to only use them when appropriate. “length (1,2)” or ``fmap (+3) (1,2)” don't do what I'd expect, for example.) |
| 2020-09-23 14:28:01 | <shad0w_> | i'll load the entire file in a ghci buffer for you |
| 2020-09-23 14:28:08 | <shad0w_> | you could just do |
| 2020-09-23 14:28:12 | <shad0w_> | :t foo a b |
| 2020-09-23 14:28:14 | <lambdabot> | error: |
| 2020-09-23 14:28:14 | <lambdabot> | • Variable not in scope: foo :: Expr -> Expr -> t |
| 2020-09-23 14:28:14 | <lambdabot> | • Perhaps you meant ‘for’ (imported from Data.Traversable) |
| 2020-09-23 14:28:16 | <shad0w_> | like you do in ghc |
| 2020-09-23 14:28:29 | × | alexm_ quits (~AlexM87@161.8.233.138) (Ping timeout: 258 seconds) |
| 2020-09-23 14:28:46 | <pjb> | frdg: what does the "predicate holds" mean when comparing head list1 to each element of list2 gives a list of booleans? (also you have to check for the end of the list1). |
| 2020-09-23 14:29:05 | × | adamwespiser quits (~adam_wesp@209.6.42.110) (Ping timeout: 240 seconds) |
| 2020-09-23 14:29:05 | <shad0w_> | it might seem like an overkill, but what i like about it is consistency : ) |
| 2020-09-23 14:29:07 | <pjb> | frdg: do you want to do a OR or an AND or some other reduction of the results? (majority vote? something?) |
| 2020-09-23 14:29:12 | <Cale> | justsomeguy: With respect to the Functor/Traversable/Foldable instances, you should think of pairs as being containers that hold a single element (the last component) with an additional "label" (the first component) |
| 2020-09-23 14:29:38 | <frdg> | pjb: predicate holds just means it returns true. This should be an OR reduction I believe |
| 2020-09-23 14:30:31 | <Cale> | justsomeguy: They're good as abstract things, but often you will want to transition to defining a proper data type once you have good names for the fields and especially if there are more than two of them |
| 2020-09-23 14:30:44 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-23 14:30:47 | × | xff0x quits (~fox@2001:1a81:525e:3100:a532:31e:75e4:cc8b) (Ping timeout: 246 seconds) |
| 2020-09-23 14:31:33 | × | Cathy quits (~Cathy@unaffiliated/cathy) (Ping timeout: 258 seconds) |
| 2020-09-23 14:31:57 | → | xff0x joins (~fox@2001:1a81:525e:3100:586c:a336:dadc:73a7) |
| 2020-09-23 14:32:17 | <frdg> | Though I know that there exists exactly one element in List2 such that `p (Head List1) ` will hold. |
| 2020-09-23 14:32:59 | <frdg> | for all elements in List1. |
| 2020-09-23 14:33:08 | <AWizzArd> | any :: Foldable t => (a -> Bool) -> t a -> Bool |
| 2020-09-23 14:33:46 | <AWizzArd> | shad0w_: ah okay, so it comes with a repl |
| 2020-09-23 14:34:16 | <justsomeguy> | Cale: Would you say it's a good idea to use tuples mostly to facilitate passing around small collections of short-lived things using pattern matching? |
| 2020-09-23 14:34:20 | <shad0w_> | AWizzArd: how cool is that? |
| 2020-09-23 14:34:28 | <shad0w_> | you can do all kinds of stuff |
| 2020-09-23 14:34:40 | <AWizzArd> | shad0w_: yet still, I can’t see the signature easily. Even a repl won’t help me, because I won’t be "inside" the right context. |
| 2020-09-23 14:34:44 | <shad0w_> | it's a haskell-mode thing. nothing to do with lsp though |
| 2020-09-23 14:35:02 | <AWizzArd> | shad0w_: yes cool, but it is also required. repl is a must. |
| 2020-09-23 14:35:09 | <shad0w_> | lsp would show you the type of the entire thing. |
| 2020-09-23 14:35:23 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds) |
| 2020-09-23 14:35:32 | <AWizzArd> | shad0w_: okay, I will then have to see how to get it showing the sig of marked expressions |
| 2020-09-23 14:35:35 | <shad0w_> | there would probably some way to see partial types, but i am not aware of the lsp way to do it yet. |
| 2020-09-23 14:35:47 | <AWizzArd> | Yeah, maybe they don’t have it yet. |
| 2020-09-23 14:35:47 | <Cale> | justsomeguy: I guess, though the same thing could be said of almost any user defined data type as well, so I don't know |
| 2020-09-23 14:36:02 | <shad0w_> | AWizzArd: dante and intero were good with this simple stuff |
| 2020-09-23 14:36:32 | <AWizzArd> | shad0w_: totally! |
| 2020-09-23 14:36:37 | × | stree quits (~stree@50-108-115-67.adr01.mskg.mi.frontiernet.net) (Quit: Caught exception) |
| 2020-09-23 14:36:39 | → | Cathy joins (~Cathy@unaffiliated/cathy) |
All times are in UTC.