Logs: freenode/#haskell
| 2021-03-03 23:02:52 | <pjb> | even worse: your computer is a very small part of this universe, and your life expectency is a very small part of this universe. |
| 2021-03-03 23:02:53 | <int-e> | . o O ( you have reached the algorithm complexity hotline. the next representative will be available to talk to you in O(1) time. ) |
| 2021-03-03 23:03:07 | <Axman6> | koz_: can :info tell you? |
| 2021-03-03 23:03:18 | <koz_> | Axman6: I dunno, can it? |
| 2021-03-03 23:03:37 | <Axman6> | \_(ツ)_/¯ |
| 2021-03-03 23:03:49 | × | ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection) |
| 2021-03-03 23:04:14 | <Axman6> | oh no, my hand fell off again |
| 2021-03-03 23:04:17 | → | ukari joins (~ukari@unaffiliated/ukari) |
| 2021-03-03 23:04:28 | × | dunj3 quits (~dunj3@p200300f61714a669de906847d1a6f7e3.dip0.t-ipconnect.de) (Quit: Leaving) |
| 2021-03-03 23:04:31 | <koz_> | Nope. |
| 2021-03-03 23:04:34 | <Axman6> | :info Generic might be more useful than :info Foo though |
| 2021-03-03 23:05:11 | <koz_> | Tells me nothing either. |
| 2021-03-03 23:05:26 | <koz_> | It just says (the equivalent of) 'instance Generic (Foo f)'. |
| 2021-03-03 23:06:06 | <Axman6> | interesting. What's Rep (Foo f) look like? (I'm just curious now) |
| 2021-03-03 23:06:16 | <monochrom> | I have looked at core, and both -O and -O2. Strict already does the implicit bang pattern I want. |
| 2021-03-03 23:06:25 | <Axman6> | as in (I think) :kind! Rep (Foo Maybe) |
| 2021-03-03 23:06:43 | × | Neuromancer quits (~Neuromanc@unaffiliated/neuromancer) (Read error: Connection reset by peer) |
| 2021-03-03 23:07:43 | <wmacmil> | i'm just beginning to use Dante, if I hover over an error it gives the error message, but only for like 2 seconds |
| 2021-03-03 23:07:55 | <monochrom> | In fact even better, the loop works on Int# directly, no Int. |
| 2021-03-03 23:07:58 | <wmacmil> | is there any way to keep it longer? or display the error message somewhere else? |
| 2021-03-03 23:08:13 | <d34df00d> | Why is it so slow then? |
| 2021-03-03 23:09:10 | <monochrom> | Does the fast version ever produce any bytestring other than the empty one? |
| 2021-03-03 23:09:30 | <Axman6> | that code feels like a perfect thing to use stream fusion or the foldl package, it's kind of a hybrid of both |
| 2021-03-03 23:10:10 | → | stree joins (~stree@68.36.8.116) |
| 2021-03-03 23:10:16 | <Axman6> | wmacmil: this is a speed reading feature intended to help you read faster, keep practicing! |
| 2021-03-03 23:11:12 | × | Katarushisu quits (~Katarushi@cpc152083-finc20-2-0-cust170.4-2.cable.virginm.net) (Quit: Ping timeout (120 seconds)) |
| 2021-03-03 23:11:28 | <monochrom> | Whereas the slow version actually uses "first" to do: get the tuple (x, y) from the recursive call, now I want (c : x , y) instead. That's expensive on multiple fronts. |
| 2021-03-03 23:11:30 | → | Raito_Bezarius joins (~Raito@unaffiliated/raito-bezarius/x-8764578) |
| 2021-03-03 23:11:31 | × | Tesseraction quits (~Tesseract@unaffiliated/tesseraction) (Read error: Connection reset by peer) |
| 2021-03-03 23:12:11 | × | seanparsons quits (~sean@cpc145088-gill21-2-0-cust281.20-1.cable.virginm.net) (Remote host closed the connection) |
| 2021-03-03 23:12:12 | × | Anthaas quits (~Anthaas@unaffiliated/anthaas) (Quit: ZNC 1.7.1 - https://znc.in) |
| 2021-03-03 23:12:34 | → | Anthaas joins (~Anthaas@unaffiliated/anthaas) |
| 2021-03-03 23:12:40 | → | seanparsons joins (~sean@cpc145088-gill21-2-0-cust281.20-1.cable.virginm.net) |
| 2021-03-03 23:12:47 | → | Katarushisu joins (~Katarushi@cpc152083-finc20-2-0-cust170.4-2.cable.virginm.net) |
| 2021-03-03 23:13:20 | <Axman6> | would the irrefutable pattern thing help there? go skips (byte : rest) = case go skips rest of ~(xs,i) -> (byte : xs, i)? |
| 2021-03-03 23:13:23 | → | Tesseraction joins (~Tesseract@unaffiliated/tesseraction) |
| 2021-03-03 23:13:25 | <monochrom> | Ah OK the fast version produces non-empty, non-constant output. |
| 2021-03-03 23:13:49 | × | zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving) |
| 2021-03-03 23:14:09 | <Axman6> | I also wonder if builders would help, particularly if you know what the final buffer size needs to be |
| 2021-03-03 23:14:12 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving) |
| 2021-03-03 23:14:32 | <monochrom> | Still, it is along the line of "filter p (x:xs) | p x = x : recursive call". That's very much cheaper than "case recursive call of (x,y) -> (c:x, y)" |
| 2021-03-03 23:14:42 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-03-03 23:15:07 | → | zaquest joins (~notzaques@5.128.210.178) |
| 2021-03-03 23:17:31 | <d34df00d> | Yea, that explains why it's faster and has better memory consumption, but is it possible to write the counting version in a similar fashion? |
| 2021-03-03 23:17:39 | <monochrom> | I would use the Builder thingies. Then it is really a foldl' . |
| 2021-03-03 23:19:34 | <d34df00d> | Hmm, I just realized I want an (unboxed or storable) vector of it anyway, so right now I'm unpacking that later again and repacking... fromList'ing, that is, into a vector. |
| 2021-03-03 23:20:04 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds) |
| 2021-03-03 23:20:05 | <d34df00d> | And since my input is lazy, I can't construct a vector in O(1) even via the .Internal stuff. |
| 2021-03-03 23:20:33 | <d34df00d> | I shall probably just become impure and do everything in an ST monad or something. |
| 2021-03-03 23:22:54 | <monochrom> | Axman6: After some thoughts, I think it just delays the inevitable. |
| 2021-03-03 23:24:06 | <monochrom> | I mean the ~(xs,i) -> (byte:xs, i) idea. |
| 2021-03-03 23:24:23 | <Axman6> | If the output size is likely to be comparable to the size of the input then doing it in ST, allocating the buffer to write into seems like the best option. might waste a bit of ram, but only in a single object |
| 2021-03-03 23:25:56 | × | cgadski quits (~textual@a95-95-106-208.cpe.netcabo.pt) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-03-03 23:27:36 | × | conal_ quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2021-03-03 23:30:27 | × | poscat quits (~poscat@123.116.89.28) (Ping timeout: 256 seconds) |
| 2021-03-03 23:31:09 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Ping timeout: 264 seconds) |
| 2021-03-03 23:31:09 | → | poscat joins (~poscat@2408:8207:482e:5730::1) |
| 2021-03-03 23:31:14 | → | fissureman joins (~quassel@c-73-201-159-163.hsd1.dc.comcast.net) |
| 2021-03-03 23:31:29 | <d34df00d> | I need it as a vector anyway (or so I think), and there are not that many bytes removed (less than 1% typically), so looks like the extra overhead is inevitable. |
| 2021-03-03 23:31:57 | <d34df00d> | The problem at hand is that I'm writing a jpeg decoder just for lulz, and I need to do certain massaging on the compressed image bytes. |
| 2021-03-03 23:32:26 | <d34df00d> | The other problem is that I'm using binary for deserialization, and doing all this byte fiddling at deserialization time seems even worse. |
| 2021-03-03 23:34:31 | <monochrom> | Hrm, "first" already does ~(x,y). |
| 2021-03-03 23:34:33 | × | __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving) |
| 2021-03-03 23:34:47 | → | notzmv joins (~zmv@unaffiliated/zmv) |
| 2021-03-03 23:35:17 | <Axman6> | Good to know |
| 2021-03-03 23:36:03 | × | Varis quits (~Tadas@unaffiliated/varis) (Quit: Leaving) |
| 2021-03-03 23:36:56 | <monochrom> | % case Data.Bifunctor.first undefined undefined of (_,_) -> "dab" |
| 2021-03-03 23:36:56 | <yahb> | monochrom: "dab" |
| 2021-03-03 23:37:01 | <monochrom> | very lazy |
| 2021-03-03 23:37:25 | <Axman6> | needs to pull itself up by its bootstraps |
| 2021-03-03 23:37:48 | × | Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.) |
| 2021-03-03 23:38:19 | <d34df00d> | Also, too bad binary doesn't have a monad transformer so that I could stack Get on top of ST. |
| 2021-03-03 23:38:33 | <d34df00d> | Then I could do all this vectors nonsense without constant reallocations. |
| 2021-03-03 23:39:02 | <Axman6> | I pushed for adding a parameter to the ceborg/serialise stuff for exactly this reason |
| 2021-03-03 23:39:10 | <Axman6> | cborg* |
| 2021-03-03 23:39:38 | <mananamenos> | Hi, im reading https://ocharles.org.uk/posts/2016-01-26-transformers-free-monads-mtl-laws.html and there is `env :: M Environment; env = M ask` in the beginning of the article. I can't figure out how/why this snippet typechecks. `ask` from Control.Monad.Trans.Reader returns a value of type `ReaderT r m r`, so that snippet's type would be `env :: M (ReaderT Environment (StateT State IO) a)`. How is it `M Environment`?` |
| 2021-03-03 23:40:33 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-83-46.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!) |
| 2021-03-03 23:40:55 | → | cole-h_ joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2021-03-03 23:40:56 | → | zebrag joins (~inkbottle@aaubervilliers-654-1-83-46.w86-212.abo.wanadoo.fr) |
| 2021-03-03 23:41:03 | <monochrom> | r = ReaderT hardcoded because of the definition of M. |
| 2021-03-03 23:41:30 | → | conal joins (~conal@64.71.133.70) |
| 2021-03-03 23:42:07 | <monochrom> | a = r by unification. |
| 2021-03-03 23:42:34 | <monochrom> | ask :: ReaderT Environment (StateT State IO) Environment |
| 2021-03-03 23:42:46 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:dd5f:6f4f:a50:215d) |
| 2021-03-03 23:42:49 | <monochrom> | err, r = Environment |
| 2021-03-03 23:42:55 | × | cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 240 seconds) |
| 2021-03-03 23:43:30 | <Axman6> | what's the definition of M? |
| 2021-03-03 23:43:42 | × | usr25 quits (~usr25@unaffiliated/usr25) (Quit: Leaving) |
| 2021-03-03 23:43:44 | <monochrom> | newtype M a = M (ReaderT Environment (StateT State IO) a) |
| 2021-03-03 23:44:35 | <monochrom> | And assume Control.Monad.Trans.Reader for now, no mtl MonadReader generalness. |
| 2021-03-03 23:44:55 | <Axman6> | yeah thought so - so the instance of ask which is used there has type ReaderT Environment (StateT State IO) Environment, and since M :: ReaderT Environment (StateT State IO) a -> M a then it all works out |
| 2021-03-03 23:45:22 | cole-h_ | is now known as cole-h |
| 2021-03-03 23:46:18 | → | apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net) |
| 2021-03-03 23:46:55 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:dd5f:6f4f:a50:215d) (Ping timeout: 240 seconds) |
| 2021-03-03 23:49:21 | × | apache801 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 265 seconds) |
| 2021-03-03 23:51:15 | × | justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 240 seconds) |
| 2021-03-03 23:51:22 | <mananamenos> | monochrom, Axman6 thanks a lot, I see it now. |
| 2021-03-03 23:51:25 | × | elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 256 seconds) |
| 2021-03-03 23:54:45 | × | chele quits (~chele@ip5b40237d.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
| 2021-03-04 00:05:38 | → | apache801 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net) |
All times are in UTC.