Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-14 01:41:52 jchia[m] joins (jchiamatri@gateway/shell/matrix.org/x-afhcftwgolwwlgft)
2021-04-14 01:42:39 hypercube joins (hypercube@gateway/vpn/protonvpn/hypercube)
2021-04-14 01:43:26 <alisa> During the exploration, just like nginx dynamic loading configuration, I want to realize that through custom commands like ./program run, ./program load souce_code_file.hs, it can be run in multiple instances. Just started, and now it’s just an idea.
2021-04-14 01:43:38 <jchia[m]> I need to copy a Data.Vector.Storable Float to a IOVector Float. Is there a more efficient way than to use write in a for_ to copy element-by-element? I would expect those two types of vectors to have the exact same data representation in memory.
2021-04-14 01:45:01 <jchia[m]> Let me add that the IOVector Float is larger. I want to copy the Storable vector to the IOVector starting from some non-zero index.
2021-04-14 01:45:19 <shapr> alisa: I hope your idea works!
2021-04-14 01:45:44 × alisa quits (adf8e1c6@173.248.225.198) (Quit: Connection closed)
2021-04-14 01:46:40 <hololeap> jchia[m]: looks like there's an unsafeCast function in Data.Vector.Storable
2021-04-14 01:46:59 <hololeap> oh, nvm that just casts the elements
2021-04-14 01:47:59 × santiacq1 quits (~santiacq@r167-60-199-83.dialup.adsl.anteldata.net.uy) (Quit: WeeChat 3.1)
2021-04-14 01:54:54 amol joins (~amol@c-67-169-78-228.hsd1.ca.comcast.net)
2021-04-14 01:55:05 amol is now known as syntactic_sugar
2021-04-14 01:55:16 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-04-14 01:57:11 × jlamothe quits (~jlamothe@198.251.57.81) (Ping timeout: 240 seconds)
2021-04-14 01:57:42 <hololeap> it doesn't seem like they have the same representation, or at least i don't see any supported way to do what you want, other than O(n) copy
2021-04-14 02:00:42 Tario joins (~Tario@201.192.165.173)
2021-04-14 02:01:41 <monochrom> "IOVector" is ambiguous, there are two or more.
2021-04-14 02:03:35 rajivr joins (uid269651@gateway/web/irccloud.com/x-ubwtsitjrarbotro)
2021-04-14 02:03:38 <monochrom> But Data.Vector.Storable.unsafeFreeze/Thaw is the unsafe cast between Storable.Vector and Storable.Mutable.IOVector
2021-04-14 02:04:24 × aVikingTrex quits (~holoirc@2001:8003:340d:d00:147c:abad:fef7:d5de) (Remote host closed the connection)
2021-04-14 02:04:37 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds)
2021-04-14 02:05:47 <hololeap> monochrom: it doesn't seem like the types match up
2021-04-14 02:07:15 <monochrom> As said, there are like 5 things all called "IOVector". The wrong ones don't match, sure.
2021-04-14 02:07:37 <hololeap> oh, i see what you're saying now :)
2021-04-14 02:09:20 gnumonic joins (~gnumonic@c-73-170-91-210.hsd1.ca.comcast.net)
2021-04-14 02:09:55 <jchia[m]> I mean Data.Vector.Mutable.IOVector
2021-04-14 02:10:45 <monochrom> No go. Data.Vector.Mutable is the "boxed" kind, i.e., behind Data.Vector
2021-04-14 02:11:02 <jchia[m]> Or Data.Vector.Unboxed.Mutable.Vector
2021-04-14 02:11:12 <monochrom> But you can always s/import Data.Vector.Mutable/import Data.Vector.Storable.Mutable/
2021-04-14 02:11:15 <jchia[m]> Data.Vector.Unboxed.Mutable.IOVector
2021-04-14 02:11:52 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Ping timeout: 265 seconds)
2021-04-14 02:11:58 <monochrom> <monochrom> As said, there are like 5 things all called "IOVector". The wrong ones don't match, sure.
2021-04-14 02:12:36 <jchia[m]> Is using Storable.Vector Float more or less efficient than Unboxed.Vector Float? I expect them to both be unboxed in the general sense.
2021-04-14 02:13:40 <monochrom> I heard yes for Float a most scalar element types. I haven't tested it though.
2021-04-14 02:13:47 <monochrom> s/a most/and most/
2021-04-14 02:14:14 <hololeap> Storable is using pointers hiding behind FFI. no idea though :)
2021-04-14 02:14:51 <monochrom> Naw just one pointer to the beginning of the whole array. Elementwise it uses Storable methods.
2021-04-14 02:15:15 × Sgeo quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Ping timeout: 265 seconds)
2021-04-14 02:15:19 <hololeap> i would think they would be very similar in performance
2021-04-14 02:15:45 Sgeo joins (~Sgeo@ool-18b98aa4.dyn.optonline.net)
2021-04-14 02:16:22 × syntactic_sugar quits (~amol@c-67-169-78-228.hsd1.ca.comcast.net) (Quit: syntactic_sugar)
2021-04-14 02:16:57 syntactic_sugar joins (~amol@c-67-169-78-228.hsd1.ca.comcast.net)
2021-04-14 02:17:15 × syntactic_sugar quits (~amol@c-67-169-78-228.hsd1.ca.comcast.net) (Client Quit)
2021-04-14 02:17:22 <monochrom> I would either ask the authors or do my benchmarks or just go Unboxed and not think. But Storable is sweet because it's much more user-customizable than Unboxed.
2021-04-14 02:18:12 syntactic_sugar joins (~amol@c-67-169-78-228.hsd1.ca.comcast.net)
2021-04-14 02:18:16 <monochrom> Like if I had "data E = MkE Int Bool Char" I would go Storable because that's the only choice. Unboxed is closed.
2021-04-14 02:18:51 <monochrom> But Float? Why even bother unless you're using someone else library that forces you to.
2021-04-14 02:18:56 × syntactic_sugar quits (~amol@c-67-169-78-228.hsd1.ca.comcast.net) (Client Quit)
2021-04-14 02:19:21 <monochrom> Or unless it's Float today but you envision you will change it to your own type tomorrow.
2021-04-14 02:19:26 × rekahsoft quits (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 240 seconds)
2021-04-14 02:19:34 <jchia[m]> It feels like storable should be a special case of unboxed, other than that unbox splits up parts of a tuple.
2021-04-14 02:19:53 syntactic_sugar joins (~amol@c-67-169-78-228.hsd1.ca.comcast.net)
2021-04-14 02:20:02 <jchia[m]> i.e. whatever you can do with unbox you should be able to do with storable
2021-04-14 02:20:05 × urodna_ quits (~urodna@unaffiliated/urodna) (Quit: urodna_)
2021-04-14 02:20:55 <jchia[m]> and treat a storable as an unbox without any expensive conversion, discounting tuples
2021-04-14 02:21:12 <jchia[m]> making the whole thing make sense while working for tuple splitting is a problem, though
2021-04-14 02:22:23 <jchia[m]> but then, there is no storable instance for tuples
2021-04-14 02:22:50 <hololeap> my guess is there is something about hiding behind FFI which does not guarantee structure, hence why there is no explicit conversion
2021-04-14 02:27:58 <monochrom> Hrm nevermind, Unboxed is pretty open too. But you may or may not like tearing up one Complex array into two Double arrays.
2021-04-14 02:28:56 <monochrom> err nevermind that too, it doesn't tear up into two arrays.
2021-04-14 02:29:10 pthariensflame joins (~pthariens@2600:6c52:727f:4200:4df9:43c4:992a:20a1)
2021-04-14 02:29:25 × pthariensflame quits (~pthariens@2600:6c52:727f:4200:4df9:43c4:992a:20a1) (Client Quit)
2021-04-14 02:31:37 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
2021-04-14 02:32:38 frozenErebus joins (~frozenEre@37.231.244.249)
2021-04-14 02:33:01 × myShoggoth quits (~myShoggot@97-120-72-12.ptld.qwest.net) (Ping timeout: 260 seconds)
2021-04-14 02:36:48 <gnumonic> Can someone explain what a "matchable function" is? Or at least clarify whether (k ~> Type) or (k -> Type) is "matchable"?
2021-04-14 02:40:59 myShoggoth joins (~myShoggot@97-120-72-12.ptld.qwest.net)
2021-04-14 02:41:19 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-04-14 02:46:13 × theDon quits (~td@muedsl-82-207-238-185.citykom.de) (Ping timeout: 240 seconds)
2021-04-14 02:47:28 jlamothe joins (~jlamothe@198.251.57.81)
2021-04-14 02:48:13 theDon joins (~td@94.134.91.214)
2021-04-14 02:48:41 × drbean_ quits (~drbean@TC210-63-209-49.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin2 - https://znc.in)
2021-04-14 02:50:28 <koz_> Unboxed is considerably more annoying to implement than Storable, that much _is_ true.
2021-04-14 02:51:05 FinnElija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716)
2021-04-14 02:51:05 finn_elija is now known as Guest79333
2021-04-14 02:51:05 FinnElija is now known as finn_elija
2021-04-14 02:51:06 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Excess Flood)
2021-04-14 02:52:23 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2021-04-14 02:53:57 × Guest79333 quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Ping timeout: 240 seconds)
2021-04-14 02:59:23 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
2021-04-14 03:00:54 <justsomeguy> Can someone give me a dumbed-down, possibly inaccurate summary of what Traversable is, just to give me a sense of it? Is it an iterator? A thingy that flips inner structure with outer structure? Something that helps me climb trees?
2021-04-14 03:02:22 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 252 seconds)
2021-04-14 03:02:33 <koz_> justsomeguy: Traversable is 'effectful fmap'.
2021-04-14 03:02:35 <koz_> :t fmap
2021-04-14 03:02:37 <lambdabot> Functor f => (a -> b) -> f a -> f b
2021-04-14 03:02:40 <koz_> :t traverse
2021-04-14 03:02:41 <lambdabot> (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
2021-04-14 03:03:07 <koz_> s/is/allows/
2021-04-14 03:06:58 justsomeguy slowly mulls over what an applicative effect is.
2021-04-14 03:07:48 <monochrom> IO is an example.
2021-04-14 03:08:03 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
2021-04-14 03:09:31 <monochrom> If you have ["hello", "hi", "aloha"], and if you want for each string there you putStrLn then getLine, and you want the result list to be the 3 lines you get from the 3 getLines:
2021-04-14 03:09:52 × roconnor quits (~roconnor@host-45-78-202-80.dyn.295.ca) (Ping timeout: 240 seconds)
2021-04-14 03:09:57 <monochrom> traverse (\s -> putStrLn s >> getLine) ["hello", "hi", "aloha"]
2021-04-14 03:10:04 <monochrom> THE END
2021-04-14 03:11:21 × syntactic_sugar quits (~amol@c-67-169-78-228.hsd1.ca.comcast.net) (Quit: syntactic_sugar)
2021-04-14 03:11:55 syntactic_sugar joins (~syntactic@c-67-169-78-228.hsd1.ca.comcast.net)
2021-04-14 03:11:55 × Sheilong quits (uid293653@gateway/web/irccloud.com/x-ljvkmqtgqlpdhiue) ()
2021-04-14 03:12:26 × syntactic_sugar quits (~syntactic@c-67-169-78-228.hsd1.ca.comcast.net) (Remote host closed the connection)
2021-04-14 03:12:36 syntactic_sugar joins (~syntactic@c-67-169-78-228.hsd1.ca.comcast.net)

All times are in UTC.