Logs: freenode/#haskell
| 2021-04-18 09:45:20 | <Cale> | text is marked trustworthy |
| 2021-04-18 09:45:42 | <Cale> | Or at least, the Data.Text module is |
| 2021-04-18 09:45:52 | <Cale> | But that's not what I'm talking about |
| 2021-04-18 09:45:53 | <gentauro> | Cale: not building -> https://uniprocess.org/template.html ;) |
| 2021-04-18 09:47:05 | <Cale> | What I mean is that if you decide to add text to your trusted package set, then that's the end of it, pretty much. Anything it marks as trustworthy, you're fine with. |
| 2021-04-18 09:47:06 | <nshepperd2> | I don't understand that |
| 2021-04-18 09:47:07 | gentauro | let me rephrase: «Cale: you can't mark a package at `trustworthy` if they don't expose `unsafePerformIO` ;)» as «Cale: you can't mark a package at `trustworthy` if they use `unsafePerformIO` and don't expose it in the signature ;)» |
| 2021-04-18 09:47:29 | → | bitmagie joins (~Thunderbi@200116b8068a3b00488727cbe58c7a6a.dip.versatel-1u1.de) |
| 2021-04-18 09:47:48 | <nshepperd2> | can't how? is this a philosophical objection to adding -trust=text? |
| 2021-04-18 09:48:02 | × | bitmagie quits (~Thunderbi@200116b8068a3b00488727cbe58c7a6a.dip.versatel-1u1.de) (Client Quit) |
| 2021-04-18 09:48:45 | <gentauro> | nshepperd2: I tried, GHC doesn't build |
| 2021-04-18 09:49:00 | <Cale> | Trustworthy doesn't impose any restrictions on the module being marked as such |
| 2021-04-18 09:49:12 | <nshepperd2> | huh? |
| 2021-04-18 09:49:45 | <Cale> | Ah, well, it adds a couple, but not much |
| 2021-04-18 09:50:12 | <Cale> | Trustworthy modules are allowed to invoke unsafe things |
| 2021-04-18 09:50:30 | <Cale> | That's the point of Trustworthy vs. Safe |
| 2021-04-18 09:50:30 | <gentauro> | Cale: that is correct |
| 2021-04-18 09:50:45 | <Cale> | But there's no distinction between different kinds of "unsafe" things |
| 2021-04-18 09:51:56 | → | Major_Biscuit joins (~Major_Bis@82-169-100-198.biz.kpn.net) |
| 2021-04-18 09:52:02 | <Cale> | So if you think a package is good enough about its present interpretation of "Trustworthy" to add it to your trusted set, once you've done that, you're never going to be warned if that package starts using things that are more likely to be problematic -- no such distinction exists. |
| 2021-04-18 09:55:13 | <nshepperd2> | well, -trust=foo means either that you trust the foo maintainer to verify referential transparency to your satisfaction or that you personally checked that specific version of the code, i suppose |
| 2021-04-18 09:55:21 | × | jbetz_ quits (uid283648@gateway/web/irccloud.com/x-ebjzdarufjrfhfrh) (Quit: Connection closed for inactivity) |
| 2021-04-18 09:55:38 | <Cale> | yeah |
| 2021-04-18 09:58:28 | <nshepperd2> | you could imagine a more fine grained system where you -trust=Module.Name or even -trust=package-version.Module.Name.identifier |
| 2021-04-18 09:58:29 | <Cale> | But of course, I could also have just done that without Safe Haskell... I think it's just at an awkward place, where it doesn't quite accomplish enough to be useful more often than it is an annoyance. |
| 2021-04-18 09:58:50 | <nshepperd2> | not sure who would want to go to that extent though |
| 2021-04-18 10:00:24 | <nshepperd2> | well the point of safe haskell isn't to verify Trustworthy modules for you... it's for verifying the Safe modules |
| 2021-04-18 10:00:30 | <Cale> | It might be nice to be able to say "I trust anything to use Unsafe.Coerce", and then if that was the only violation of a Trustworthy module, then it gets approved. |
| 2021-04-18 10:00:44 | <gentauro> | «Not in scope: ‘System.Environment.withArgs’» and «Not in scope: ‘Control.Monad.void’» by added `-XSafe` to a stack script: https://pastebin.ubuntu.com/p/5nvcpMDrtg/ |
| 2021-04-18 10:01:11 | <gentauro> | so I guess -Xsafe remove modules from `base` that doesn't live-up to it's requirements? |
| 2021-04-18 10:01:34 | <Cale> | Well, not all the modules in base are marked Safe |
| 2021-04-18 10:02:06 | <nshepperd2> | gentauro: it should print out a bunch of errors saying that things can't be safely imported |
| 2021-04-18 10:02:13 | <Cale> | er, I meant to say Data.Coerce above, not Unsafe.Coerce, haha |
| 2021-04-18 10:02:34 | <Cale> | (but it was a metavariable anyway) |
| 2021-04-18 10:02:49 | <nshepperd2> | then you add -trust=base and then it lets you import those modules |
| 2021-04-18 10:03:51 | <gentauro> | nshepperd2: it doesn't. But it might be to the nature of `stack` (wrapping?) |
| 2021-04-18 10:03:56 | <Cale> | System.Environment is marked Safe though |
| 2021-04-18 10:04:09 | <gentauro> | but normally when I build with GCH, it gives me all those kind of errors as you mention |
| 2021-04-18 10:04:16 | <Cale> | That error looks like something else, I'm not sure |
| 2021-04-18 10:04:41 | <nshepperd2> | ah, a stack misfeature |
| 2021-04-18 10:04:59 | <gentauro> | Cale: Probably. I really haven't got `-XSafe` to work with `ghci` so I think it will probably not work with `stack scripts` neither |
| 2021-04-18 10:05:19 | <nshepperd2> | "ghci -XSafe -fpackage-trust -trust=base -trust=text" works just fine for me |
| 2021-04-18 10:05:20 | <Cale> | Yeah, I haven't ever had an occasion to use stack, so I don't know what its quirks are |
| 2021-04-18 10:05:45 | <nshepperd2> | I can import Data.Text and do stuff with it, no problems |
| 2021-04-18 10:06:29 | <gentauro> | nshepperd2: so it's fixed? :o |
| 2021-04-18 10:06:53 | gentauro | I have to be honest that last time I tried, it was ages ago (COVID-19 has destroyed my notion of time) |
| 2021-04-18 10:07:31 | <Cale> | gentauro: Well, I don't think nshepperd was using stack... |
| 2021-04-18 10:07:44 | → | z88 joins (~z88@221.85-84-199.dynamic.clientes.euskaltel.es) |
| 2021-04-18 10:07:53 | <gentauro> | Cale: no, I was refering to: "ghci -XSafe -fpackage-trust -trust=base -trust=text" |
| 2021-04-18 10:08:12 | <gentauro> | that's huge (if I can finally use the Data.Text package) :) |
| 2021-04-18 10:08:16 | <Cale> | That was broken? |
| 2021-04-18 10:08:32 | <gentauro> | Cale: around 2018 - 2019 it was :) |
| 2021-04-18 10:08:35 | → | aveltras joins (uid364989@gateway/web/irccloud.com/x-uutfhochnudnpuow) |
| 2021-04-18 10:08:46 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-18 10:08:53 | <gentauro> | but again, 2019 in my brain was just "not long time ago" |
| 2021-04-18 10:08:56 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-04-18 10:10:04 | <aveltras> | is there a way to get "C♯O" to work as a data constructor using extensions or something ? I guess not because of reserver character (note this isn't the classic "#") but still ask because it would be nice since "D♭0" works fine |
| 2021-04-18 10:10:45 | <Cale> | I think that'll parse as the application of the infix operator ♯ to C and 0 |
| 2021-04-18 10:11:19 | <Cale> | It's odd to me that one would work and not the other? |
| 2021-04-18 10:11:43 | <aveltras> | i get "not a data constructor '♯' |
| 2021-04-18 10:11:51 | <aveltras> | oh wait |
| 2021-04-18 10:11:58 | <Cale> | Well, yeah, it's... not a data constructor |
| 2021-04-18 10:12:07 | <aveltras> | in fact neither works, it complains about the second if first is commented out |
| 2021-04-18 10:12:13 | <aveltras> | too bad then |
| 2021-04-18 10:12:16 | <Cale> | The only "uppercase" symbol character is : |
| 2021-04-18 10:12:46 | <Cale> | But you probably wanted that to parse as all one identifier name, which it won't, because it's a mix of alphanums and symbols |
| 2021-04-18 10:12:55 | <gentauro> | yeah, it is fixed :o |
| 2021-04-18 10:12:58 | × | Major_Biscuit quits (~Major_Bis@82-169-100-198.biz.kpn.net) (Ping timeout: 240 seconds) |
| 2021-04-18 10:12:58 | <gentauro> | `stack ghci --ghc-options -XSafe --ghc-options -fpackage-trust --ghc-options -trust=base --ghc-options -trust=text` |
| 2021-04-18 10:13:06 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds) |
| 2021-04-18 10:13:12 | <Cale> | aveltras: You could make a ♯ function... |
| 2021-04-18 10:13:21 | <gentauro> | `λ> import Data.Text (0.01 secs, 0 bytes)` |
| 2021-04-18 10:13:37 | <gentauro> | `λ> import System.IO.Unsafe<no location info>: error:System.IO.Unsafe: Can't be safely imported!The module itself isn't safe.` |
| 2021-04-18 10:13:40 | <gentauro> | nice !!! |
| 2021-04-18 10:13:54 | <Cale> | aveltras: I kind of hate this suggestion though ;) |
| 2021-04-18 10:14:30 | <aveltras> | i'll stick with the spelled version then (Csharp0, Dflat0), a bit uglier on the eyes though |
| 2021-04-18 10:14:40 | <Cale> | Like, (♯) :: Diatonic -> Octave -> Note |
| 2021-04-18 10:14:43 | <Cale> | haha |
| 2021-04-18 10:16:06 | × | malumore quits (~malumore@151.62.123.9) (Ping timeout: 240 seconds) |
| 2021-04-18 10:16:06 | × | nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 240 seconds) |
| 2021-04-18 10:18:56 | → | Codaraxis_ joins (~Codaraxis@141.98.255.147) |
| 2021-04-18 10:19:27 | <Cale> | Or you could make an ordinary sharp function which takes a note (probably in some more convenient representation) and goes up by 8 perfect fifths and then down 4 octaves ;) |
| 2021-04-18 10:21:13 | × | Codaraxis quits (Codaraxis@gateway/vpn/mullvad/codaraxis) (Ping timeout: 240 seconds) |
| 2021-04-18 10:23:12 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 240 seconds) |
| 2021-04-18 10:23:33 | <aveltras> | im not that familiar with music theory right now, just wanted to reproduce https://pages.mtu.edu/~suits/notefreqs.html with a big sum type, not sure that's the best way to approach this anyway, might be better to have the seven notes and a ToFrequency typeclass which takes the note and a "modifier" # b since in the end, i'll probably parse those from strings |
| 2021-04-18 10:25:18 | <Cale> | Whenever a type has more data constructors than there will be times that you're going to ever pattern match on it completely, one thing to consider is whether you'd rather just make a record of the results of those pattern matches |
| 2021-04-18 10:28:27 | <aveltras> | i guess that's the case here :) |
| 2021-04-18 10:29:58 | <Cale> | > [2**(k/12) * 440 | k <- [-57 ..]] |
| 2021-04-18 10:30:00 | <lambdabot> | [16.351597831287414,17.323914436054505,18.354047994837977,19.445436482630058... |
| 2021-04-18 10:30:16 | <Cale> | That's the formula for the frequency column in that table btw |
| 2021-04-18 10:30:20 | → | nicholasbulka joins (~nicholasb@2601:900:4301:da0:34df:482b:a0b7:2d77) |
| 2021-04-18 10:31:21 | <Cale> | The wavelength is just the speed of sound divided by the frequency. |
| 2021-04-18 10:31:45 | → | heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-04-18 10:32:39 | → | nineonine joins (~nineonine@2604:3d08:7785:9600:68a6:8c79:2caf:5ce4) |
| 2021-04-18 10:33:42 | <Cale> | If I was only concerned with 12 tone equal temperament, I would probably just use integer values for notes -- probably can't go too wrong with MIDI's convention. |
| 2021-04-18 10:34:34 | × | nicholasbulka quits (~nicholasb@2601:900:4301:da0:34df:482b:a0b7:2d77) (Ping timeout: 258 seconds) |
| 2021-04-18 10:35:33 | <Cale> | btw, I was off by one above, should have been 7 perfect fifths (of course, I was thinking it was the eighth note along the circle of fifths, lol) |
| 2021-04-18 10:35:49 | <Cale> | > (3/2)^7 / 2^4 |
| 2021-04-18 10:35:51 | <lambdabot> | 1.06787109375 |
| 2021-04-18 10:35:57 | <Cale> | > 2^(1/12) |
All times are in UTC.