Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,988 events total
2021-08-03 19:31:07 <davean> right so there seems to only be a single version there
2021-08-03 19:31:16 <davean> when thats not consistent with what I need, what do I do?
2021-08-03 19:31:22 × futty quits (~futty@c83-252-75-55.bredband.tele2.se) (Ping timeout: 245 seconds)
2021-08-03 19:31:55 <drakonis> you have the ability to create a copy of it with inherit and then redefine the metadata where needed
2021-08-03 19:32:14 <drakonis> ie: which ghc version you want to use for the build or the package version alongside the hash
2021-08-03 19:32:22 <davean> oh, but I have to write the entire build plan by hand?
2021-08-03 19:32:26 <drakonis> god no
2021-08-03 19:32:31 <drakonis> there's importers for that
2021-08-03 19:32:40 lavaman joins (~lavaman@98.38.249.169)
2021-08-03 19:33:07 <drakonis> you can also point to a specific version you want to generate a definition for
2021-08-03 19:33:19 <davean> ... everything in my build plan?
2021-08-03 19:33:27 <davean> Whatever that is
2021-08-03 19:33:36 <davean> which there isn't just one of - it'll at the very least vary by GHC
2021-08-03 19:34:36 <drakonis> the output of guix import hackage patience https://paste.debian.net/1206476/
2021-08-03 19:34:36 × azeem quits (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) (Read error: Connection reset by peer)
2021-08-03 19:34:56 × f-a quits (~f-a@151.34.27.3) (Quit: leaving)
2021-08-03 19:35:05 <drakonis> also relevant
2021-08-03 19:35:08 azeem joins (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it)
2021-08-03 19:35:20 <drakonis> you can invoke some silly metaprogramming to do package generation
2021-08-03 19:35:44 <drakonis> like generating definitions for packages that use different ghc releases
2021-08-03 19:35:47 <davean> Hum, this doesn't say what it depends on though, which is part of my question
2021-08-03 19:36:27 <drakonis> that's because it doesnt have any dependencies i guess
2021-08-03 19:36:31 <drakonis> its a leaf package
2021-08-03 19:36:44 <drakonis> it is however a dependency for other things
2021-08-03 19:36:46 <davean> but it does
2021-08-03 19:36:54 <davean> base and containers
2021-08-03 19:37:53 <drakonis> isnt those two already included with ghc?
2021-08-03 19:38:07 <davean> I mean sure, but not the ones I want usually
2021-08-03 19:38:10 <davean> Base sure
2021-08-03 19:38:12 <davean> but not containers
2021-08-03 19:38:33 <davean> These are the critical parts of getting a consistent build
2021-08-03 19:38:48 <drakonis> you can declare dependencies mind you
2021-08-03 19:38:51 <davean> and some GHCs have different base requirements
2021-08-03 19:38:59 <davean> so this doesn't tell me if that package will work
2021-08-03 19:39:14 <drakonis> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/haskell-xyz.scm#n15663
2021-08-03 19:39:16 <drakonis> here
2021-08-03 19:39:24 <davean> So base is fixed, and may or may not work - this can't decide which "patience" to use, and containers is nto at all fixed
2021-08-03 19:39:36 <davean> do it fails for both base *and* containers
2021-08-03 19:39:43 <davean> in different ways
2021-08-03 19:39:59 futty joins (~futty@c83-252-75-55.bredband.tele2.se)
2021-08-03 19:40:53 jackhill is now known as KM4MBG
2021-08-03 19:41:56 <davean> drakonis: that lists which ones it has, not which versions?
2021-08-03 19:42:02 <davean> So how can it get it right?
2021-08-03 19:42:17 <drakonis> okay i think you're missing a fundamental part of how both nix and guix work
2021-08-03 19:42:51 <drakonis> if you look at the definitions, you'll see the version it is pinned to
2021-08-03 19:43:09 <davean> I see the version that specific instance is pinned to
2021-08-03 19:43:11 × hexeme quits (~hexeme@user/hexeme) (Quit: co'o ro do)
2021-08-03 19:43:24 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 272 seconds)
2021-08-03 19:43:29 <davean> which is great and all
2021-08-03 19:43:39 <drakonis> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/haskell-xyz.scm#n15619
2021-08-03 19:44:07 <drakonis> ghc-zlib is pinned to 0.6.2.1
2021-08-03 19:44:21 hexeme joins (~hexeme@user/hexeme)
2021-08-03 19:44:36 <davean> Sure, but sometimes I need another ghc-zlib, I know how to have two ghc-zlibs and pick between them in nix, how do you do it in guix?
2021-08-03 19:45:14 <davean> and when I pull in something that depends on ghc-zlib in a further up package, how do I get all the right decisions?
2021-08-03 19:45:25 <davean> do I need a combinatorical number of packages that specify all possible versions?
2021-08-03 19:46:13 <drakonis> okay so you just do something like (define-public ghc90-zlib (inherit ghc-zlib) (build-system haskell-build-system #:haskell ghc90))
2021-08-03 19:46:15 <drakonis> cool
2021-08-03 19:46:29 <mastarija> Need some advice for a library.
2021-08-03 19:46:32 <davean> but it has nothing to do with ghc90
2021-08-03 19:46:38 <drakonis> its a example code snipper
2021-08-03 19:46:40 <drakonis> snippet
2021-08-03 19:46:45 <mastarija> Say that I have a type for which I already have Semigroup, Monoid, Functor, Applicative and Monad. It could benefit from the "Alternative", but I can't make the "empty" value (without complications).
2021-08-03 19:46:48 <drakonis> alternatively
2021-08-03 19:46:51 <drakonis> right
2021-08-03 19:46:55 <drakonis> you want two different versions of it
2021-08-03 19:46:58 <drakonis> one sec
2021-08-03 19:46:58 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
2021-08-03 19:47:05 <mastarija> I could use the "Alt" from "semigrupoids" which doesn't need the "empty", but that's a lot of extra dependencies (there's only "base" so far).
2021-08-03 19:47:09 <mastarija> On the other hand, if the inner type is a "Monoid", I could also make an "Alt" like combinator, but I'm not sure what typeclass would that be, other than "Monoid" which would require using the "newtype" and given the nature of my library, that could be a pain in the ass.
2021-08-03 19:47:16 <mastarija> So, do I:
2021-08-03 19:47:18 <mastarija> 1. Create new combinators + their operator aliases, e.g. <?> for "Alt" like operation and <+> or <#> for "Alt" + "Monoid" operation
2021-08-03 19:47:21 <mastarija> 2. Add a flag to my package which allows the user to choose if he wants the "semigrupoids" package and "Alt" (but then <#> is left hanging)
2021-08-03 19:47:24 <mastarija> 3. Combination of both, and make <?> an alias of <!> from "semigrupoids" when the flag is active (and <#> is still left hanging alone without a typeclass)
2021-08-03 19:47:33 <drakonis> as far as i'm concerned, a package can have multiple versions
2021-08-03 19:47:50 <drakonis> a single definition can be made available with multiple versions
2021-08-03 19:47:54 <drakonis> let me see if i can find any
2021-08-03 19:48:57 <sclv> mastarija: you can declare a constraint that says Monoid a => Alternative (YourType a) no?
2021-08-03 19:49:07 <drakonis> found it
2021-08-03 19:49:12 Atum_ joins (IRC@user/atum/x-2392232)
2021-08-03 19:49:17 <mastarija> sclv, No
2021-08-03 19:49:24 <sclv> why
2021-08-03 19:49:30 <mastarija> Alternative takes * -> *
2021-08-03 19:49:34 <mastarija> You have *
2021-08-03 19:49:36 <mastarija> No?
2021-08-03 19:49:52 <sclv> oh right, braindead
2021-08-03 19:50:06 <mastarija> But my point is, both monoidal and non monoidal Alt would be useful
2021-08-03 19:50:17 <mastarija> They could have different semantics, which are both useful
2021-08-03 19:50:34 <drakonis> davean: anyways, you can just have the definition inherit the existing one and just change the hash and version to another
2021-08-03 19:50:42 <sclv> erm you can do Monoid a => Monoid (YourType a) which gets you something close to what you want
2021-08-03 19:50:56 <davean> drakonis: right, but you'd have to do that for every combinatorical combination
2021-08-03 19:50:57 <mastarija> Yes, but that is already taken :D
2021-08-03 19:51:03 <drakonis> you can use functions for that lol
2021-08-03 19:51:14 <mastarija> sclv, there's also a very logical Monoid instance
2021-08-03 19:51:15 <davean> drakonis: right, so functions don't reify?
2021-08-03 19:51:21 <davean> drakonis: thats part of the question
2021-08-03 19:51:28 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-03 19:51:38 chris joins (~chris@81.96.113.213)
2021-08-03 19:51:42 chris is now known as Guest802
2021-08-03 19:51:44 <sclv> ok in that case i'd just add new combinators and not even bother with operator aliases tbh
2021-08-03 19:51:50 <sclv> and leave that to consumers of my lib

All times are in UTC.