Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-02 15:13:37 × TheScoop quits (~TheScoop@unaffiliated/tryte) (Quit: _)
2020-11-02 15:13:39 <dminuoso> merijn: makes you wonder how we get anything done, if we cant even solve beginner problems
2020-11-02 15:13:49 <merijn> I'd just use bindings :p
2020-11-02 15:14:02 <dminuoso> and probably not structure your code to end up in that place
2020-11-02 15:14:14 × texasmynsted quits (~texasmyns@212.102.45.115) (Ping timeout: 256 seconds)
2020-11-02 15:14:16 <dminuoso> I've never written sequence anywhere
2020-11-02 15:14:44 × alp quits (~alp@2a01:e0a:58b:4920:34a0:e5bb:3231:c2c3) (Ping timeout: 268 seconds)
2020-11-02 15:14:45 <dminuoso> Indeed, none of my haskell projects have a single occurence of i
2020-11-02 15:16:21 <dminuoso> % :t sequence_ $ [putStr, putStr] <*> ["foo","bar"] -- merijn
2020-11-02 15:16:22 <yahb> dminuoso: IO ()
2020-11-02 15:16:23 <dminuoso> Did you mean that?
2020-11-02 15:16:36 <merijn> no
2020-11-02 15:16:50 <merijn> The problem is that I meant a double sequence or something weird
2020-11-02 15:16:54 <dminuoso> Then I really dont understand what you're trying to write
2020-11-02 15:17:02 <merijn> :t sequence_ . sequence [print, print]
2020-11-02 15:17:04 <lambdabot> Show a => a -> IO ()
2020-11-02 15:17:08 <merijn> That
2020-11-02 15:17:09 <dminuoso> huh
2020-11-02 15:17:11 <dminuoso> % :t sequence_ [print, print]
2020-11-02 15:17:11 <yahb> dminuoso: Show a => a -> ()
2020-11-02 15:17:19 <dminuoso> % :t sequence_
2020-11-02 15:17:19 <yahb> dminuoso: (Foldable t, Monad m) => t (m a) -> m ()
2020-11-02 15:17:30 <dminuoso> oh
2020-11-02 15:17:36 × hpc quits (~juzz@ip98-169-35-13.dc.dc.cox.net) (Ping timeout: 258 seconds)
2020-11-02 15:17:50 <merijn> First one for the "a ->", second for the internal IO
2020-11-02 15:17:51 <dminuoso> % :t sequence [print, print]
2020-11-02 15:17:52 <yahb> dminuoso: Show a => a -> [IO ()]
2020-11-02 15:17:53 <dminuoso> Right
2020-11-02 15:18:33 <dminuoso> but how exactly is that different from
2020-11-02 15:18:36 <dminuoso> % :t sequence_ $ [putStr, putStr] <*> ["foo","bar"]
2020-11-02 15:18:37 <yahb> dminuoso: IO ()
2020-11-02 15:18:52 <dminuoso> In both cases you generate the cartesian product
2020-11-02 15:19:00 <dminuoso> apply, and then sequence
2020-11-02 15:19:15 <dminuoso> yours is just a bit more hidden
2020-11-02 15:19:54 daydaynatation joins (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2020-11-02 15:20:29 × jokester quits (~mono@unaffiliated/jokester) (Quit: WeeChat 2.8)
2020-11-02 15:21:11 × twk- quits (~thewormki@unaffiliated/twk-) (Ping timeout: 272 seconds)
2020-11-02 15:21:49 × Tario quits (~Tario@200.119.184.48) (Ping timeout: 246 seconds)
2020-11-02 15:23:27 ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net)
2020-11-02 15:24:23 Varis joins (~Tadas@unaffiliated/varis)
2020-11-02 15:24:38 khaladrogo_786 joins (~khaladrog@2405:204:5217:6256:258b:d489:f19c:6ea7)
2020-11-02 15:24:42 jakob_ joins (~textual@p200300f49f162200f40f209088e2d2f9.dip0.t-ipconnect.de)
2020-11-02 15:25:00 <daydaynatation> Are there any sort function on Data.Array?
2020-11-02 15:25:10 <bqv> But its pointfree
2020-11-02 15:25:39 <PacoV> Okay, I'll use dminuoso's version as the "m ()" has the right type in the end.
2020-11-02 15:27:43 × DataComputist quits (~lumeng@static-50-43-26-251.bvtn.or.frontiernet.net) (Quit: Leaving...)
2020-11-02 15:27:59 × ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 260 seconds)
2020-11-02 15:28:06 × PacoV quits (2d535a95@gateway/web/cgi-irc/kiwiirc.com/ip.45.83.90.149) (Quit: thanks!)
2020-11-02 15:28:25 <daydaynatation> Just found out that there is no sort function for Vector neither...
2020-11-02 15:28:32 christo joins (~chris@81.96.113.213)
2020-11-02 15:28:50 <merijn> daydaynatation: You want vector-algorithms :)
2020-11-02 15:28:56 <merijn> @hackage vector-algorithms
2020-11-02 15:28:57 <lambdabot> https://hackage.haskell.org/package/vector-algorithms
2020-11-02 15:29:04 <daydaynatation> ah ha
2020-11-02 15:29:09 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
2020-11-02 15:29:23 <daydaynatation> merijn: how about array-algorithms? does it exist?
2020-11-02 15:29:29 <merijn> No clue
2020-11-02 15:29:58 <merijn> Unless you need generalised indexing via Ix vector is generally better
2020-11-02 15:30:20 × jespada quits (~jespada@90.254.245.49) (Ping timeout: 265 seconds)
2020-11-02 15:30:33 <daydaynatation> I'm just doing some comparison between Haskell and C++, for learning's sake
2020-11-02 15:31:01 <daydaynatation> I guess Haskell's array is way too different from C++ array
2020-11-02 15:31:06 <merijn> daydaynatation: right, if you just want 1D arrays/vector like C/C++ then you probably want vector
2020-11-02 15:31:28 cohn parts (~noone@unaffiliated/cohn) ()
2020-11-02 15:31:46 LeanderK joins (~textual@46.183.103.17)
2020-11-02 15:32:04 × LeanderK quits (~textual@46.183.103.17) (Client Quit)
2020-11-02 15:32:34 jespada joins (~jespada@90.254.245.49)
2020-11-02 15:33:36 <daydaynatation> btw, does cabal hell still exits? I use ghcup to install ghc and cabal and then cabal install everything in the global scope. Is this the usual way of installing packagings with cabal? or do people cabal install some kind of sandbox
2020-11-02 15:34:07 × khaladrogo_786 quits (~khaladrog@2405:204:5217:6256:258b:d489:f19c:6ea7) (Quit: Leaving)
2020-11-02 15:34:17 twk- joins (~thewormki@unaffiliated/twk-)
2020-11-02 15:35:00 Amras joins (~Amras@unaffiliated/amras0000)
2020-11-02 15:35:01 <merijn> daydaynatation: Actual cabal hell has been gone for close to a decade. What people *now* call cabal hell is simply "I'm depending on ancient unmaintained packages and the dependency solver can't find a solution", which doesn't really have a solution
2020-11-02 15:35:23 <bqv> With nix, you can jailbreak...
2020-11-02 15:35:24 × xff0x quits (~fox@2001:1a81:537c:3e00:725d:2adb:f456:fdfe) (Ping timeout: 240 seconds)
2020-11-02 15:35:38 <merijn> daydaynatation: As for sandboxing individual projects, as of cabal-install 3.0 that is unncecessary
2020-11-02 15:35:40 ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net)
2020-11-02 15:35:48 × andreas303 quits (~andreas@gateway/tor-sasl/andreas303) (Remote host closed the connection)
2020-11-02 15:36:21 <maerwald> you can use stack2cabal too
2020-11-02 15:36:23 <merijn> daydaynatation: Basically, every installed package is tagged with a hash of its source, exact version and compile flags, and the hashes of it's transitive dependencies
2020-11-02 15:36:23 <daydaynatation> Wow, great to know! So I just cabal install globally and it just works? Nix is too complicated
2020-11-02 15:36:30 xff0x joins (~fox@2001:1a81:537c:3e00:d3d4:b70f:c4f2:86e2)
2020-11-02 15:36:32 <maerwald> @hackage stack2cabal
2020-11-02 15:36:32 <lambdabot> https://hackage.haskell.org/package/stack2cabal
2020-11-02 15:36:44 <merijn> daydaynatation: So you can have infinitely many different configurations/versions of the same package installed
2020-11-02 15:36:47 <maerwald> in case you can't build with cabal
2020-11-02 15:37:43 × cantstanya quits (~chatting@gateway/tor-sasl/cantstanya) (Ping timeout: 240 seconds)
2020-11-02 15:37:56 andreas31 joins (~andreas@gateway/tor-sasl/andreas303)
2020-11-02 15:40:05 × ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 240 seconds)
2020-11-02 15:40:10 <merijn> daydaynatation: cabal-install will select the right/matching versions from the global store when building a project. So you end up with builds happening "as if" they're in a sandbox, except you don't need to manage sandboxes/virtualenvs, as they all share a single global store
2020-11-02 15:40:46 <merijn> daydaynatation: See also https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html (despite the nix url, doesn't actually have anything to with nix other than "the general idea")
2020-11-02 15:41:16 <merijn> (note that the v2- prefix is optional in cabal 3.0 and later, as all the commands default to v2-)
2020-11-02 15:41:29 <yushyin> yes, it's misleading
2020-11-02 15:41:33 <daydaynatation> Thanks!
2020-11-02 15:41:42 × borne quits (~fritjof@200116b864ec3c00c8b76624f4b75a13.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-11-02 15:42:04 <merijn> yushyin: Patches welcome ;)
2020-11-02 15:42:12 cantstanya joins (~chatting@gateway/tor-sasl/cantstanya)
2020-11-02 15:42:12 <dolio> What's misleading?
2020-11-02 15:42:15 alp joins (~alp@2a01:e0a:58b:4920:60be:9d51:3099:266d)
2020-11-02 15:42:16 <yushyin> the name
2020-11-02 15:42:39 <merijn> dolio: "nix local builds" tends to mislead people into thinking it's about Nix
2020-11-02 15:42:48 × khaladrogo quits (~khaladrog@2405:204:5217:6256:258b:d489:f19c:6ea7) (Remote host closed the connection)

All times are in UTC.