Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-13 13:13:25 × jchia1 quits (~jchia@58.32.71.83) (Ping timeout: 264 seconds)
2020-11-13 13:14:40 jchia joins (~jchia@45.32.62.73)
2020-11-13 13:15:12 <bqv> ggole: i don't think anyone has
2020-11-13 13:15:12 christo joins (~chris@81.96.113.213)
2020-11-13 13:15:51 Yumasi joins (~guillaume@2a01cb09b06b29ea5faf5572fb93fcc2.ipv6.abo.wanadoo.fr)
2020-11-13 13:16:51 × jchia quits (~jchia@45.32.62.73) (Remote host closed the connection)
2020-11-13 13:17:37 × _ashbreeze_ quits (~mark@72-161-252-32.dyn.centurytel.net) (Ping timeout: 264 seconds)
2020-11-13 13:17:53 jchia joins (~jchia@45.32.62.73)
2020-11-13 13:18:07 <carbolymer> even `stack build --test project:test:project-lib` builds and copies executables god knows why
2020-11-13 13:18:34 × solonarv quits (~solonarv@astrasbourg-653-1-156-155.w90-6.abo.wanadoo.fr) (Quit: Lost terminal)
2020-11-13 13:18:47 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2020-11-13 13:18:53 geekosaur joins (82659a09@host154-009.vpn.uakron.edu)
2020-11-13 13:19:54 × jchia quits (~jchia@45.32.62.73) (Remote host closed the connection)
2020-11-13 13:20:11 dbmikus__ joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2020-11-13 13:20:20 jchia joins (~jchia@45.32.62.73)
2020-11-13 13:21:21 × jchia quits (~jchia@45.32.62.73) (Remote host closed the connection)
2020-11-13 13:22:11 jchia joins (~jchia@45.32.62.73)
2020-11-13 13:23:12 × jchia quits (~jchia@45.32.62.73) (Remote host closed the connection)
2020-11-13 13:23:48 jchia joins (~jchia@45.32.62.73)
2020-11-13 13:24:45 × dbmikus__ quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 240 seconds)
2020-11-13 13:25:37 × Yumasi quits (~guillaume@2a01cb09b06b29ea5faf5572fb93fcc2.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
2020-11-13 13:26:19 solonarv joins (~solonarv@astrasbourg-653-1-156-155.w90-6.abo.wanadoo.fr)
2020-11-13 13:27:30 neiluj joins (~jco@43.245.204.77.rev.sfr.net)
2020-11-13 13:27:30 × neiluj quits (~jco@43.245.204.77.rev.sfr.net) (Changing host)
2020-11-13 13:27:30 neiluj joins (~jco@unaffiliated/neiluj)
2020-11-13 13:29:16 × jchia quits (~jchia@45.32.62.73) (Remote host closed the connection)
2020-11-13 13:29:25 <royal_screwup21> what's the time complexity of adding an element to the a list, like `x: my_list`?
2020-11-13 13:29:47 jchia joins (~jchia@58.32.36.109)
2020-11-13 13:29:58 <royal_screwup21> for context, I am wondering what's the complexity of `before` and `after` functions here https://ideone.com/jqgyfk
2020-11-13 13:29:58 <bqv> cons is O(1)
2020-11-13 13:30:20 <bqv> anything else needs a scan
2020-11-13 13:32:36 gproto023 joins (~gproto23@unaffiliated/gproto23)
2020-11-13 13:32:52 × bitmagie quits (~Thunderbi@200116b8068f010041b23aab865e3023.dip.versatel-1u1.de) (Quit: bitmagie)
2020-11-13 13:33:10 bitmagie joins (~Thunderbi@200116b8068f010041b23aab865e3023.dip.versatel-1u1.de)
2020-11-13 13:35:23 × bitmagie quits (~Thunderbi@200116b8068f010041b23aab865e3023.dip.versatel-1u1.de) (Client Quit)
2020-11-13 13:35:32 × gproto23 quits (~gproto23@unaffiliated/gproto23) (Ping timeout: 260 seconds)
2020-11-13 13:36:03 dbmikus__ joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2020-11-13 13:37:50 <royal_screwup21> hmm
2020-11-13 13:37:52 bitmagie joins (~Thunderbi@200116b8068f010041b23aab865e3023.dip.versatel-1u1.de)
2020-11-13 13:38:45 <royal_screwup21> I'm looking at an impl of ziplist, which I'm told has parallels to a doubly linked list. I understand lists in haskell, and I know what doubly linked lists are, but I fail to see what the impl has to do with a dll
2020-11-13 13:38:49 nbloomf joins (~nbloomf@2600:1700:ad14:3020:4085:c5d6:bbdf:5f4e)
2020-11-13 13:38:50 Whome joins (0c986a83@12.152.106.131)
2020-11-13 13:38:53 <royal_screwup21> https://ideone.com/baFQja
2020-11-13 13:39:27 cfricke joins (~cfricke@unaffiliated/cfricke)
2020-11-13 13:40:47 × dbmikus__ quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 260 seconds)
2020-11-13 13:41:26 jakalx joins (~jakalx@base.jakalx.net)
2020-11-13 13:42:58 <lyxia> you can move both forward and backwards in constant time
2020-11-13 13:45:37 <royal_screwup21> if I have a list [1,2,3] and I want to append 4 to it - how can I do this?
2020-11-13 13:45:44 <royal_screwup21> I want the output to be [1,2,3,4]
2020-11-13 13:45:52 × DavidEichmann quits (~david@43.240.198.146.dyn.plus.net) (Ping timeout: 256 seconds)
2020-11-13 13:46:11 <xerox_> @hoogle [a] -> [a] -> [a]
2020-11-13 13:46:12 <lambdabot> Prelude (++) :: [a] -> [a] -> [a]
2020-11-13 13:46:12 <lambdabot> Data.List (++) :: [a] -> [a] -> [a]
2020-11-13 13:46:12 <lambdabot> GHC.Base (++) :: [a] -> [a] -> [a]
2020-11-13 13:46:31 hackage phonetic-languages-examples 0.5.0.0 - A generalization of the uniqueness-periods-vector-examples functionality. https://hackage.haskell.org/package/phonetic-languages-examples-0.5.0.0 (OleksandrZhabenko)
2020-11-13 13:46:39 <royal_screwup21> hmm is there a O(1) way to do it
2020-11-13 13:47:02 DavidEichmann joins (~david@62.110.198.146.dyn.plus.net)
2020-11-13 13:47:08 <xerox_> unfortunately, in general no
2020-11-13 13:48:53 × ClaudiusMaximus quits (~claude@unaffiliated/claudiusmaximus) (Quit: ->)
2020-11-13 13:48:54 hiroaki joins (~hiroaki@ip4d168e73.dynamic.kabel-deutschland.de)
2020-11-13 13:49:24 <dminuoso> royal_screwup21: btw, thats better called a zipper than a ziplist
2020-11-13 13:49:41 × jchia__ quits (~jchia@58.32.37.146) (Quit: Leaving.)
2020-11-13 13:49:42 <royal_screwup21> dminuoso why do you say that?
2020-11-13 13:49:44 <dminuoso> We have a newtype ZipList which provides an alternate Alternative instance for [], but it's unrelated to your thing
2020-11-13 13:50:01 <dminuoso> (or zipper list, list zipper, those are fine names)
2020-11-13 13:50:37 <dminuoso> (The general idea is usually called zippers and extends well to trees as well as lists)
2020-11-13 13:50:54 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:4085:c5d6:bbdf:5f4e) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-11-13 13:50:57 <dminuoso> in case of lists the implementation is just trivial and obvious
2020-11-13 13:51:58 Beetstra1 joins (~Beetstra@178.162.212.214)
2020-11-13 13:54:56 × Zetagon quits (~leo@c151-177-52-233.bredband.comhem.se) (Ping timeout: 256 seconds)
2020-11-13 13:55:20 fendor_ joins (~fendor@178.165.131.115.wireless.dyn.drei.com)
2020-11-13 13:55:58 × britva quits (~britva@31-10-157-156.cgn.dynamic.upc.ch) (Quit: This computer has gone to sleep)
2020-11-13 13:57:29 luke joins (~luke@bitnomial/staff/luke)
2020-11-13 13:57:58 × fendor quits (~fendor@178.165.129.175.wireless.dyn.drei.com) (Ping timeout: 260 seconds)
2020-11-13 13:59:23 Qui_Sum1 joins (~Qui_Sum@178.162.212.214)
2020-11-13 13:59:59 <ski> royal_screwup21 : i would not make that `Show' instance for `ZipElem'
2020-11-13 14:00:43 <royal_screwup21> ski why not?
2020-11-13 14:01:33 urodna joins (~urodna@unaffiliated/urodna)
2020-11-13 14:03:20 <ski> because it doesn't output valid Haskell expressions of type `ZipElem a'. because it doesn't handle precedence correctly. because that `show' can't be pre-inverse of a `read', because `read' is supposed to ignore extra wrapping brackets
2020-11-13 14:03:48 <ski> `Show' is not intended for pretty-printing
2020-11-13 14:04:42 × luke quits (~luke@bitnomial/staff/luke) (Quit: sleep)
2020-11-13 14:04:45 machinedgod joins (~machinedg@207.253.244.210)
2020-11-13 14:04:52 <ski> > read "(((False)))" :: Bool
2020-11-13 14:04:54 <lambdabot> False
2020-11-13 14:05:37 st8less joins (~st8less@2603:a060:11fd:0:48e3:54d2:40b:a73f)
2020-11-13 14:05:49 <ski> if you define
2020-11-13 14:06:07 <ski> toZipList :: [a] -> a -> [a] -> ZipList a
2020-11-13 14:06:29 <ski> toZipList ls x rs = ZL (reverse ls) x rs
2020-11-13 14:06:44 <ski> then you could do
2020-11-13 14:06:53 <ski> instance Show a => Show (ZipList a)
2020-11-13 14:06:55 <ski> where
2020-11-13 14:07:16 <ski> showsPrec p (ZL ls x rs) = showsPrec (p > 10)
2020-11-13 14:07:34 <ski> $ showString "toZipList "
2020-11-13 14:07:48 <ski> . showsPrec 11 (reverse ls)
2020-11-13 14:07:53 <ski> . showsChar ' '
2020-11-13 14:07:59 <ski> . showsPrec 11 x
2020-11-13 14:08:00 <ski> . showsChar ' '
2020-11-13 14:08:05 <ski> . showsPrec 11 rs
2020-11-13 14:08:56 FreeBirdLjj joins (~freebirdl@101.228.42.108)
2020-11-13 14:09:44 <ski> and then `show (insertBefore 0 (insertAfter 1 (insertBefore 2 (newZipList 3))))' would evaluate to `"toZipList [2] 0 [1,3]"'

All times are in UTC.