Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-02 21:11:00 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Read error: Connection reset by peer)
2021-04-02 21:11:26 <infinisil> Wait what's wrong with those?
2021-04-02 21:11:27 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-04-02 21:11:49 <monochrom> "strict" is a denotational concern, "lazy" is an operational concern. Level mismatch.
2021-04-02 21:12:31 <monochrom> Do people speak like "temperature vs particle momentum"?
2021-04-02 21:13:16 <monochrom> Sorry, "temperature vs particle position".
2021-04-02 21:13:25 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Read error: Connection reset by peer)
2021-04-02 21:13:49 <maerwald> pretty sure most ppl don't reason about denotational semantics much in non-trivial haskell programs, so these terms get blurry by lack of frequent exposure
2021-04-02 21:13:58 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-04-02 21:14:17 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-04-02 21:15:49 <monochrom> I also have beef with "parallel vs concurrent" when a better wording is "parallel=concurrent vs communication=synchronization" but that's for another day.
2021-04-02 21:15:59 <monochrom> or rather, that's a lost cause.
2021-04-02 21:16:20 × ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Read error: Connection reset by peer)
2021-04-02 21:17:39 haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220)
2021-04-02 21:17:39 × haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host)
2021-04-02 21:17:39 haritz joins (~hrtz@unaffiliated/haritz)
2021-04-02 21:18:36 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 260 seconds)
2021-04-02 21:19:10 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds)
2021-04-02 21:19:43 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2021-04-02 21:20:38 × dixie_ quits (~dixie@real.wilbury.sk) (Quit: leaving)
2021-04-02 21:21:03 dixie joins (~dixie@real.wilbury.sk)
2021-04-02 21:25:05 × __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving)
2021-04-02 21:25:58 son0p joins (~son0p@181.136.122.143)
2021-04-02 21:28:06 × Lycurgus quits (~niemand@98.4.115.201) (Quit: Exeunt)
2021-04-02 21:29:24 DTZUZU joins (~DTZUZO@207.81.119.43)
2021-04-02 21:29:45 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-04-02 21:29:49 × DTZUZU quits (~DTZUZO@207.81.119.43) (Client Quit)
2021-04-02 21:30:35 × andi- quits (~andi-@NixOS/user/andi-) (Ping timeout: 258 seconds)
2021-04-02 21:30:53 DTZUZU joins (~DTZUZO@205.ip-149-56-132.net)
2021-04-02 21:31:37 mkDoku joins (~TheMule@aftr-37-201-195-134.unity-media.net)
2021-04-02 21:33:50 andi- joins (~andi-@NixOS/user/andi-)
2021-04-02 21:34:18 <hololeap> Philonous: i'm not sure what you mean. it uses the Enum class to convert to/from Int, so it should work on any Enum including Word8/16/32. the type system will keep you from doing anything "dangerous" unless you get too fancy with the intMapToEnumMap/enumMapToIntMap functions
2021-04-02 21:34:26 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
2021-04-02 21:34:36 × Feuermagier quits (~Feuermagi@213.178.26.41) (Quit: Leaving)
2021-04-02 21:35:30 fendor_ joins (~fendor@77.119.130.232.wireless.dyn.drei.com)
2021-04-02 21:35:46 <Philonous> > fromEnum (maxBound @Word64) :: Int
2021-04-02 21:35:48 <lambdabot> error:
2021-04-02 21:35:48 <lambdabot> Pattern syntax in expression context: maxBound@Word64
2021-04-02 21:35:48 <lambdabot> Did you mean to enable TypeApplications?
2021-04-02 21:36:04 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-04-02 21:36:05 <Philonous> > fromEnum (maxBound :: Word64) :: Int
2021-04-02 21:36:07 <lambdabot> *Exception: Enum.fromEnum{Word64}: value (18446744073709551615) is outside o...
2021-04-02 21:36:32 <hololeap> so you want something that works specifically with Word64
2021-04-02 21:37:26 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-04-02 21:37:32 <Philonous> Yes, but it's not even guaranteed to work with Word32
2021-04-02 21:38:05 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-02 21:38:56 <Philonous> (Int is only guaranteed to hold up to 2^29-1)
2021-04-02 21:38:59 × fendor quits (~fendor@178.115.129.241.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
2021-04-02 21:39:58 natechan joins (~natechan@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
2021-04-02 21:40:07 <hololeap> % fromEnum (maxBound :: Word32)
2021-04-02 21:40:07 <yahb> hololeap: 4294967295
2021-04-02 21:40:30 <Philonous> Lambdabot happens to run on AMD64, so Int really is Int64. But you can't rely on that
2021-04-02 21:41:02 <hololeap> i mean, in theory you could create a newtype wrapper with where `fromEnum (minBound :: Word64)` = `minBound :: Int`, but ultimately you're constrained by Int's limitations
2021-04-02 21:41:12 <monochrom> Fortunately, the same source that says 2^29-1 for Int, it doesn't even give any guarantee about Word. For all you know, the Haskell Report doesn't even say that Word cannot be isomorphic to (). >:)
2021-04-02 21:41:57 <Philonous> monochrom, Well, but Word64 is guaranteed to be 64 bit, which is what I care about ;)
2021-04-02 21:42:14 <monochrom> What really defeats you realistically is that "fromEnum (maxBound :: Word)" also fails.
2021-04-02 21:43:13 <monochrom> even under the GHC guarantee that Int and Word have the same entropy.
2021-04-02 21:44:02 <Philonous> monochrom, Well, if Int and Word have the same size it would fail since Int has to account for the sign bit, yes.
2021-04-02 21:44:16 <Philonous> Which is what I expect to be the case
2021-04-02 21:44:17 × stree quits (~stree@68.36.8.116) (Ping timeout: 268 seconds)
2021-04-02 21:44:17 <hololeap> ultimately you'll have to be creating some kind of isomorphism to Int, whether it be using Enum or Hashable or whatever, unless you just want to use Map
2021-04-02 21:44:49 <monochrom> I would consider unordered-container's hashset.
2021-04-02 21:45:34 <monochrom> Then again for Int and Word etc the hash function used is the identity function, which is pessimizing for some applications.
2021-04-02 21:46:16 <Philonous> I would really like to exploit the fact that the values I care about are going to be very close together, which IntSet optimizes well for since it removes the high-bit prefixes. If I use a HashSet that won't work
2021-04-02 21:46:41 <monochrom> Or perhaps look for a raw finger tree implementation?
2021-04-02 21:46:44 <Philonous> I thin the answer is going to be: Use Set for now and omdify IntSet to work on Word64 later
2021-04-02 21:47:10 <Philonous> Wait, if the hash for Word is id that would actually work in my favour
2021-04-02 21:47:13 <Philonous> Thanks for that hint
2021-04-02 21:47:17 <monochrom> :)
2021-04-02 21:47:19 <hololeap> but remember, you want to do it for any architecture ;)
2021-04-02 21:47:37 <Philonous> Word64 is Word64 on any architecture
2021-04-02 21:48:41 <hololeap> if you want it to work with the whole set of Word64 values on any architecture, you're stuck with Map
2021-04-02 21:49:15 <hololeap> or something fancy, like an array of IntMaps or something
2021-04-02 21:49:22 × fosterite quits (~fosterite@2600:6c46:7800:fecf:8b1:68fe:9103:2d9f) (Ping timeout: 258 seconds)
2021-04-02 21:49:45 <monochrom> Is there an architect that has a machine word size so big it can't move? >:)
2021-04-02 21:51:49 molehillish joins (~molehilli@2600:8800:8d06:1800:d9c:dee3:c2e:bb78)
2021-04-02 21:51:51 <Philonous> hololeap, Well, HashSet hashes to Ints, but worst case I get some collisions which would marginally impact performance.
2021-04-02 21:52:55 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 268 seconds)
2021-04-02 21:53:13 <hololeap> does HashSet/HashMap use patricia trees under the hood?
2021-04-02 21:53:26 <monochrom> http://hackage.haskell.org/package/hashable-1.3.1.0/docs/src/Data.Hashable.Class.html#line-372 has the hash function for Word64
2021-04-02 21:54:59 × kuribas quits (~user@ptr-25vy0i9ffr9vxfznwlf.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2021-04-02 21:55:00 <monochrom> "hash array mapped tries"
2021-04-02 21:56:16 × molehillish quits (~molehilli@2600:8800:8d06:1800:d9c:dee3:c2e:bb78) (Ping timeout: 258 seconds)
2021-04-02 21:56:55 stree joins (~stree@68.36.8.116)
2021-04-02 21:58:45 × natechan quits (~natechan@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2021-04-02 21:58:58 <dmj`> I'm writing a haskell guide, but it uses type signature instances to show what's going on in the proofs, and will provide equational reasoning of all instances for the laws of the typeclass, I think that will increase intuition much faster.
2021-04-02 21:59:43 × alx741 quits (~alx741@181.196.68.6) (Quit: alx741)
2021-04-02 22:00:50 <hololeap> happy little tries
2021-04-02 22:02:16 conal joins (~conal@64.71.133.70)
2021-04-02 22:02:44 <hololeap> dmj`: i'd like to see it when you publish it
2021-04-02 22:05:34 <dmj`> hololeap: here's an example of an instance
2021-04-02 22:06:06 <dmj`> https://gist.github.com/dmjio/b834954af8ff98a1bf04242d8d5a5b8c
2021-04-02 22:07:25 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection)
2021-04-02 22:08:17 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-02 22:08:18 × ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Read error: Connection reset by peer)
2021-04-02 22:08:37 × fendor_ quits (~fendor@77.119.130.232.wireless.dyn.drei.com) (Read error: Connection reset by peer)
2021-04-02 22:14:22 <dmj`> hololeap: unless readers can point to any variable in the instance and tell its type, they might be fooling themselves into thinking they understand it
2021-04-02 22:15:26 × gienah quits (~mwright@gentoo/developer/gienah) (Quit: leaving)
2021-04-02 22:24:05 v01d4lph4 joins (~v01d4lph4@223.190.20.92)
2021-04-02 22:24:15 natechan joins (~natechan@108-233-125-227.lightspeed.sntcca.sbcglobal.net)

All times are in UTC.