Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-07 16:15:00 gawen joins (~gawen@movzbl.root.sx)
2020-11-07 16:15:11 <motte> hi, i'm using the dhall library to parse a config file into haskell and i'm having problems with decoding Lists into Sets - dhall defaults to setIgnoringDuplicates which gives errors when duplicates are found
2020-11-07 16:15:23 <motte> this is the relevant instance declaration: https://hackage.haskell.org/package/dhall-1.36.0/docs/src/Dhall.html#line-1410
2020-11-07 16:15:42 <motte> my question is, how can i override the declaration in a reasonable way in my own code?
2020-11-07 16:15:50 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-11-07 16:17:18 <motte> should i define my own type class for the types i want to be decoded with setIgnoringDuplicates so i can write a more specific instance declaration?
2020-11-07 16:19:31 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:2d48:c414:1e60:fe62) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-07 16:19:58 × JuanMiguel quits (~juanmi@85.red-79-146-201.dynamicip.rima-tde.net) (Quit: This computer has gone to sleep)
2020-11-07 16:20:30 ensyde joins (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net)
2020-11-07 16:23:19 × Cale quits (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) (Ping timeout: 260 seconds)
2020-11-07 16:24:09 Cale joins (~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com)
2020-11-07 16:25:48 × ensyde quits (~ensyde@99-185-235-117.lightspeed.chrlnc.sbcglobal.net) (Ping timeout: 260 seconds)
2020-11-07 16:26:28 × eayus quits (c2991d13@194.153.29.19) (Remote host closed the connection)
2020-11-07 16:26:29 Rudd0^ joins (~Rudd0@185.189.115.108)
2020-11-07 16:28:43 × Rudd0 quits (~Rudd0@185.189.115.108) (Ping timeout: 260 seconds)
2020-11-07 16:30:19 × ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 260 seconds)
2020-11-07 16:33:12 thir joins (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de)
2020-11-07 16:33:13 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 256 seconds)
2020-11-07 16:33:20 <[exa]> Is there a common name for GADTs that hide an inner type behind typeclass interface?
2020-11-07 16:33:59 <[exa]> roughly: data X where ToX :: Someclass a => a -> X
2020-11-07 16:34:30 <[exa]> s/name/naming scheme or idiom/
2020-11-07 16:36:05 <Franciman> [exa], existential data type?
2020-11-07 16:36:18 × aveltras quits (uid364989@gateway/web/irccloud.com/x-alccjlfffbnhjsto) (Quit: Connection closed for inactivity)
2020-11-07 16:36:30 <[exa]> uh yes that's true, I was asking more like how to name the types
2020-11-07 16:36:40 nbloomf joins (~nbloomf@2600:1700:ad14:3020:d06e:e910:1cbc:b8b0)
2020-11-07 16:37:06 <[exa]> say the typeclass is "Fooable", should the type be say "GenericFoo" or "WrappedFooable"?
2020-11-07 16:37:14 × cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Quit: cosimone)
2020-11-07 16:37:31 × thir quits (~thir@p200300f27f0b7e00f4e9381c2bf90854.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2020-11-07 16:39:40 rookie101 joins (~rookie@207.154.204.166)
2020-11-07 16:41:11 <nshepperd> SomeFoo?
2020-11-07 16:41:41 <int-e> . o O ( Fooize )
2020-11-07 16:42:20 <int-e> Or maybe -ify
2020-11-07 16:43:44 × britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Quit: This computer has gone to sleep)
2020-11-07 16:44:00 hackage tldr 0.9.0 - Haskell tldr client https://hackage.haskell.org/package/tldr-0.9.0 (psibi)
2020-11-07 16:45:27 × elliott_ quits (~elliott_@pool-108-51-141-12.washdc.fios.verizon.net) (Read error: Connection reset by peer)
2020-11-07 16:45:46 <[exa]> hm, sounds like SomeX wins
2020-11-07 16:45:48 elliott_ joins (~elliott_@pool-108-51-141-12.washdc.fios.verizon.net)
2020-11-07 16:46:06 <[exa]> -ize and -ify names are superoverloaded by js libs... in this case Selectize
2020-11-07 16:46:10 <[exa]> thanks!
2020-11-07 16:46:31 × m4lvin quits (~m4lvin@w4eg.de) (Quit: m4lvin)
2020-11-07 16:47:00 m4lvin joins (~m4lvin@w4eg.de)
2020-11-07 16:47:36 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2020-11-07 16:56:52 × darjeeling_ quits (~darjeelin@115.215.43.51) (Ping timeout: 256 seconds)
2020-11-07 16:57:26 laxask joins (~lax@unaffiliated/laxask)
2020-11-07 16:59:01 hackage minizinc-process 0.1.1.0 - A set of helpers to call minizinc models. https://hackage.haskell.org/package/minizinc-process-0.1.1.0 (LucasDiCioccio)
2020-11-07 16:59:30 × coot quits (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2020-11-07 17:01:05 <ski> [exa] : i commonly go for "Some-" or "-able" (assuming the class doesn't end with "able" ..)
2020-11-07 17:04:00 <[exa]> it's for wrapping selda queries now, SomeSelect works perfectly (like, I should have asked myself "what's inside? oh yeah some select")
2020-11-07 17:06:11 niko joins (~niko@freenode/staff/ubuntu.member.niko)
2020-11-07 17:07:46 bitmapper joins (uid464869@gateway/web/irccloud.com/x-duordpjumbquhybw)
2020-11-07 17:08:10 <ski> (i guess i'm not sure i'm that happy with the naming of `Typeable',`Foldable',`Traversable' .. hmm)
2020-11-07 17:09:26 darjeeling_ joins (~darjeelin@122.245.210.126)
2020-11-07 17:12:45 geekosaur joins (82659a09@host154-009.vpn.uakron.edu)
2020-11-07 17:13:13 <merijn> fgaz: The basic problem is this. Suppose we (sensibly!) limit ourselves to executables that in cabal packages
2020-11-07 17:13:43 <merijn> fgaz: We "just" have to install those in, say, the libexecdir, obtainable via getLibexecDir to keep prefix independence
2020-11-07 17:13:53 hekkaidekapus_ is now known as hekkaidekapus
2020-11-07 17:14:18 <merijn> fgaz: Except...what if that executable itself uses getDataDir/etc. to access stuff (or hell, it's own libexecdir with other executables!)
2020-11-07 17:14:41 alp joins (~alp@88.126.45.36)
2020-11-07 17:15:32 <merijn> fgaz: If we wanna keep things prefix independent we probably wanna combine that in (sub)directories of our package's prefix, but then you need to change the way the installed executables access those files to point to our package's datadir(s)
2020-11-07 17:16:17 <merijn> fgaz: Now, that's not unsolvable, but it'll probably require at least *some* thinking on how to get it right
2020-11-07 17:16:46 <merijn> fgaz: Where as with build-dependencies we can just assume they're in the global store, because you don't need to package them
2020-11-07 17:17:09 <merijn> (build-tool-depends, I should say)
2020-11-07 17:19:06 <Cheery> merijn: I figured out how to do the unit removal.
2020-11-07 17:19:42 <Cheery> https://www.reddit.com/r/haskell/comments/jmzg57/is_it_possible_to_trim_unit_types_away_from_a_type/
2020-11-07 17:20:24 <merijn> reddit's CDN seems to have died :p
2020-11-07 17:20:38 <siraben> merijn: how come?
2020-11-07 17:21:25 <siraben> Oh it's very slow right now
2020-11-07 17:21:31 <merijn> siraben: I get an error
2020-11-07 17:21:56 <siraben> "all of our servers are busy right now"
2020-11-07 17:22:50 <hekkaidekapus> motte: The setFromDistinctList’s documentation says: “An error is thrown if the list contains duplicates.” You have to ensure you are decoding from a set-like list.
2020-11-07 17:23:20 <hekkaidekapus> motte: You can decode a list and convert it to a set in Haskell.
2020-11-07 17:23:45 <hekkaidekapus> > S.fromList [1, 1, 2, 3, 3] -- motte
2020-11-07 17:23:47 <lambdabot> fromList [1,2,3]
2020-11-07 17:24:25 <Cheery> I lost my mouse to my cat and it's a bit awkward to do stuff with a computer right now. Maybe that thing gets back up or smt.
2020-11-07 17:24:26 <fgaz> merijn: why can't we assume they're in the global store?
2020-11-07 17:25:04 elliott__ joins (~elliott@pool-108-51-141-12.washdc.fios.verizon.net)
2020-11-07 17:25:32 <fgaz> After all, we do with data files
2020-11-07 17:25:58 <merijn> fgaz: Eh, no, we don't
2020-11-07 17:26:06 <merijn> fgaz: That's simply their *default* location
2020-11-07 17:26:11 × jedws quits (~jedws@101.184.150.81) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-07 17:26:33 <geekosaur> there's some horribly ugly and fragile hacks for data files, iirc
2020-11-07 17:26:45 <merijn> fgaz: It's overridable, so that packagers of, say, apt-get etc. can install them wherever is appropriate for their system
2020-11-07 17:26:45 × Ariakenom_ quits (~Ariakenom@h-82-196-111-76.NA.cust.bahnhof.se) (Read error: Connection reset by peer)
2020-11-07 17:26:57 <merijn> geekosaur: I wouldn't say that
2020-11-07 17:27:05 <merijn> It's about as sensible as you can do
2020-11-07 17:27:20 Ariakenom joins (~Ariakenom@h-82-196-111-76.NA.cust.bahnhof.se)
2020-11-07 17:27:22 <geekosaur> we may be thinking of different things, I'm thinking of the hack to allow running smething in place before installation
2020-11-07 17:27:38 <geekosaur> which iirc only works right with cabal 1.x
2020-11-07 17:27:52 <merijn> fgaz: You can't assume thing will be in the store at runtime, because you can't assume there will *be* a store on the machine a user wants to use an executable
2020-11-07 17:28:13 <motte> hekkaidekapus: yes, but i'd like that the conversion be done while decoding
2020-11-07 17:28:26 <merijn> geekosaur: Eh, I can tell you that every cabal-install between 2.0 and 3.4 has had 0 issues in finding data files of uninstalled executables when using v2-run
2020-11-07 17:29:06 <merijn> geekosaur: Because literally everything in my phd project has dependend on that working since 2016 and it never once broke, across all those cabal versions and several systems :p
2020-11-07 17:29:07 <motte> hekkaidekapus: i can write a separate instance declaration for every type i plan to keep in a set like this: http://ix.io/2DkK
2020-11-07 17:29:43 <matthew-> :t (id,id)
2020-11-07 17:29:44 <motte> hekkaidekapus: i'm wondering if there might be a better way
2020-11-07 17:29:44 <lambdabot> (a1 -> a1, a2 -> a2)
2020-11-07 17:30:01 <matthew-> am I right in thinking the universal quantification is outside the whole thing?
2020-11-07 17:30:14 <hekkaidekapus> motte: `list :: Decoder a -> Decoder [a]`. You can do `S.fromList <$> list`.
2020-11-07 17:30:39 <matthew-> i.e. (∀A,B.(Tuple ((⊗ ((→ A) A)) (⊗ ((→ B) B))))) ?
2020-11-07 17:30:42 <merijn> hekkaidekapus: Well, no, because that exact expression is a type error ;)

All times are in UTC.