Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-27 16:01:49 <gaff> yeah
2021-04-27 16:02:15 <ulidtko> monochrom, you could also set EDITOR and use alt-e in fish/zsh, ^Xe in bash, and so edit the multi-line command "on the fly" without touching a file
2021-04-27 16:02:22 <c_wraith> I tend to write a lot of code specifically to test my answers for questions. A lot of the time I can get away with long single lines in ghci to verify the parts I want to double-check
2021-04-27 16:03:08 <monochrom> I do that too.
2021-04-27 16:03:16 <ulidtko> occasionally useful, isn't it
2021-04-27 16:03:44 <c_wraith> anything I want to *use* I keep in a file. But sometimes that's not what I'm doing. :)
2021-04-27 16:03:51 proofofkeags joins (~proofofke@205.209.28.54)
2021-04-27 16:05:19 <ulidtko> joel135, getting back to your record syntax inquiry. u{b=Baz{c=44}} -- this works, you've missed an '='
2021-04-27 16:05:36 <joel135> oh i'll try that, thanks
2021-04-27 16:06:34 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
2021-04-27 16:06:44 <ulidtko> there's lens-tutorial package with plenty examples, also many recorded talks, I don't know any better materials for lens. Too dumb yet for that profunctor stuff :(
2021-04-27 16:07:09 <joel135> `w = u {b = {c = 44}}' has a parse error
2021-04-27 16:07:21 <joel135> oh i got it
2021-04-27 16:08:47 <joel135> now i get this https://paste.tomsmeding.com/rXWA9fs4
2021-04-27 16:09:02 <joel135> maybe haskell doesn't support it after all?
2021-04-27 16:09:28 <nicholasbulka> I'm closer now, with the following function:
2021-04-27 16:09:37 <geekosaur> it doesn't support the shorthand there
2021-04-27 16:09:56 <nicholasbulka> spiral [] = [] ; spiral (x:xs) = x ++ spiral(reverse $ transpose (chunks (length (xs !! 0) ) $ concat xs))
2021-04-27 16:10:06 <nicholasbulka> but now I am getting this error
2021-04-27 16:10:08 × zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving)
2021-04-27 16:10:21 <nicholasbulka> spiral [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]
2021-04-27 16:10:21 <nicholasbulka> [1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10*** Exception: Prelude.!!: index too large
2021-04-27 16:10:50 <joel135> i think i'll look into lens-tutorial
2021-04-27 16:11:02 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 260 seconds)
2021-04-27 16:11:02 <ulidtko> joel135, I'll refer to SO, the accepted answer covers pretty well https://stackoverflow.com/questions/7365425/is-there-a-haskell-idiom-for-updating-a-nested-data-structure
2021-04-27 16:11:09 zaquest joins (~notzaques@5.128.210.178)
2021-04-27 16:11:23 <nicholasbulka> it is seemingly doing the right thing but fails when indexing that xs !! 0 I believe ... I can't seem to get the pattern matching right for the degenerate case
2021-04-27 16:11:24 <ulidtko> though I'm worried if GADTs play well with lens
2021-04-27 16:11:51 <c_wraith> in general they don't
2021-04-27 16:12:10 <c_wraith> in the same way record accessors don't play well with GADTs
2021-04-27 16:13:13 <nicholasbulka> trying to add ; spiral (x:[]) = [] gives me a pattern redundancy error
2021-04-27 16:13:41 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.1)
2021-04-27 16:13:50 <geekosaur> move that before the spiral x:xs case
2021-04-27 16:14:01 <joel135> i see
2021-04-27 16:14:01 <nicholasbulka> ah yes
2021-04-27 16:14:11 <nicholasbulka> perfect! thanks a lot
2021-04-27 16:17:04 × gaff quits (~user@49.207.195.160) (Ping timeout: 245 seconds)
2021-04-27 16:19:06 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
2021-04-27 16:19:06 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-04-27 16:19:06 dibblego joins (~dibblego@haskell/developer/dibblego)
2021-04-27 16:19:15 jgt joins (~jgt@78.162.43.217)
2021-04-27 16:21:03 paravida joins (~mychateau@71.215.110.96)
2021-04-27 16:21:58 hiroaki joins (~hiroaki@2a02:8108:8c40:2bb8:b8c4:49ae:2ce4:1808)
2021-04-27 16:22:00 × MidAutumnHotaru quits (~MidAutumn@unaffiliated/midautumnhotaru) (Quit: Quit 啾)
2021-04-27 16:22:34 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-04-27 16:22:40 MidAutumnHotaru joins (~MidAutumn@unaffiliated/midautumnhotaru)
2021-04-27 16:25:11 × jgt quits (~jgt@78.162.43.217) (Ping timeout: 240 seconds)
2021-04-27 16:25:41 nineonine joins (~nineonine@2604:3d08:7785:9600:18c3:826f:bcf6:7789)
2021-04-27 16:28:48 × andreas303 quits (~andreas@gateway/tor-sasl/andreas303) (Remote host closed the connection)
2021-04-27 16:29:28 andreas303 joins (~andreas@gateway/tor-sasl/andreas303)
2021-04-27 16:32:15 × nineonine quits (~nineonine@2604:3d08:7785:9600:18c3:826f:bcf6:7789) (Ping timeout: 250 seconds)
2021-04-27 16:33:08 Guest_22 joins (4bb93e3c@cpe-75-185-62-60.columbus.res.rr.com)
2021-04-27 16:33:24 gitgood joins (~gitgood@80-44-9-246.dynamic.dsl.as9105.com)
2021-04-27 16:34:34 Major_Biscuit joins (~Major_Bis@82-169-100-198.biz.kpn.net)
2021-04-27 16:38:25 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-04-27 16:40:28 howdoi joins (uid224@gateway/web/irccloud.com/x-yrhcwqdqfhhzcxcx)
2021-04-27 16:45:01 nineonine joins (~nineonine@2604:3d08:7785:9600:18c3:826f:bcf6:7789)
2021-04-27 16:47:46 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-27 16:47:55 letmein joins (~letmein@2601:1c1:4200:938f:f8bf:6a67:4eed:b2c1)
2021-04-27 16:48:12 × guest7682358928 quits (c9dbea7b@gateway/web/cgi-irc/kiwiirc.com/ip.201.219.234.123) (Quit: Ping timeout (120 seconds))
2021-04-27 16:48:43 <jonathanx> is it possible to use mixins in stack? I want to use Relude, and would prefer not to switch to cabal
2021-04-27 16:49:23 <carbolymer> What's mixin?
2021-04-27 16:50:06 <yushyin> jonathanx: mixins are the reason I switched back to cabal
2021-04-27 16:51:04 <yushyin> carbolymer: https://cabal.readthedocs.io/en/3.4/cabal-package.html?#pkg-field-mixins
2021-04-27 16:51:34 <monochrom> aka backpack
2021-04-27 16:52:27 × stree quits (~stree@68.36.8.116) (Ping timeout: 260 seconds)
2021-04-27 16:54:31 <monochrom> I learned backpack from the backpack thesis: https://github.com/ezyang/thesis/releases
2021-04-27 16:54:49 <monochrom> Wait I helped him fix typoes?!
2021-04-27 16:55:15 × geekosaur quits (930099da@rrcs-147-0-153-218.central.biz.rr.com) (Quit: Connection closed)
2021-04-27 16:55:29 jgt joins (~jgt@78.162.43.217)
2021-04-27 16:57:46 <lechner> Hi, I realize Purescript isn't Haskell but I use both and have a question about Applicative fuctors. Why please can the code in the link not be written as port <- parseInt $ fromMaybe "8080" $ lookupEnv "PORT" ? Is it only because I am already in the Effect monad? Sorry about the newbie question, and thanks!
2021-04-27 16:57:48 <lechner> https://github.com/purescript-express/purescript-express/blob/master/examples/src/ToDoServer.purs#L179
2021-04-27 16:57:57 <lechner> functors
2021-04-27 16:58:57 <Uniaika> lechner: yes, <$> is fmap
2021-04-27 16:59:16 <Uniaika> and the value you want to operate on (with fromMaybe, parseInt), is wrapped in a functor
2021-04-27 16:59:29 <monochrom> <<< is function composition, "."
2021-04-27 16:59:35 <Uniaika> and do you apply functions to values that are in Functors… ? with fmap :)
2021-04-27 17:00:22 × bennofs_ quits (~quassel@x4dbffbc2.dyn.telefonica.de) (Ping timeout: 252 seconds)
2021-04-27 17:00:22 × jgt quits (~jgt@78.162.43.217) (Ping timeout: 268 seconds)
2021-04-27 17:00:45 <monochrom> Generally you have to respect types as a minimum requirement.
2021-04-27 17:01:30 <monochrom> If you have f::X->Y and m :: Effect X, then "f m" makes no sense, no matter how intuitive it is to you.
2021-04-27 17:01:35 <int-e> . o O ( "That is *Sir* Type to you, scumbag!" )
2021-04-27 17:01:43 × finn_elija quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Remote host closed the connection)
2021-04-27 17:02:04 finn_elija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716)
2021-04-27 17:02:25 × Guest_22 quits (4bb93e3c@cpe-75-185-62-60.columbus.res.rr.com) (Quit: Connection closed)
2021-04-27 17:02:27 <monochrom> "fmap f m" is legal. Still, I would encourage you to ask yourself do you really know that it does what you want.
2021-04-27 17:03:35 bennofs_ joins (~quassel@x4dbffbc2.dyn.telefonica.de)
2021-04-27 17:03:57 <monochrom> In this particular example, I can be talked into not using fmap aka <$>.
2021-04-27 17:04:13 <monochrom> portString <- lookupEnv "PORT"
2021-04-27 17:04:37 <monochrom> let port = parseInt (fromMaybe "8080" portString)
2021-04-27 17:04:44 <monochrom> I can be talked into that.
2021-04-27 17:05:02 <monochrom> But I will not be talked into $ $ $ $ $
2021-04-27 17:05:27 stree joins (~stree@68.36.8.116)
2021-04-27 17:05:30 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Quit: Lost terminal)
2021-04-27 17:05:43 <lechner> <- lifts the Effect, so we can use the more basic operators, right?
2021-04-27 17:06:00 jgt joins (~jgt@78.162.43.217)
2021-04-27 17:06:07 <monochrom> I don't know what "lift" means for this. Especially for this.
2021-04-27 17:06:12 kiweun joins (~kiweun@2607:fea8:2a62:9600:d8d7:245f:2a72:5f1b)
2021-04-27 17:06:23 × kuribas quits (~user@ptr-25vy0i7u5k5fyxhyy6l.18120a2.ip6.access.telenet.be) (Remote host closed the connection)
2021-04-27 17:06:45 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)

All times are in UTC.