Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-04 16:08:52 <lambdabot> http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
2021-03-04 16:09:03 <ski> @where PFDS
2021-03-04 16:09:04 <lambdabot> http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504
2021-03-04 16:09:20 <dolio> Yeah, the book might be more readable than the thesis, I'm not sure.
2021-03-04 16:09:29 <ski> the book is quite nice
2021-03-04 16:09:41 <dolio> I've only read the book in detail.
2021-03-04 16:09:43 <jhaxim> o nice
2021-03-04 16:10:19 <infinisil> ski: It seems that CoArbitrary is for generating inputs, Arbitrary for outputs. And tasty-quickchecks `Testable (a -> prop)` instance is a function that takes a as an input
2021-03-04 16:10:24 chenshen joins (~chenshen@2620:10d:c090:400::5:dc3c)
2021-03-04 16:10:34 <infinisil> Therefore it seems that it should use `CoArbitrary a`, instead of what it currently does, `Arbitrary a`
2021-03-04 16:10:43 <infinisil> Does that makes sense?
2021-03-04 16:10:45 __minoru__shirae joins (~shiraeesh@46.34.206.213)
2021-03-04 16:11:00 × Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 265 seconds)
2021-03-04 16:11:16 <infinisil> Oh Testable is part of quickcheck itself
2021-03-04 16:11:46 <infinisil> Hmm..
2021-03-04 16:12:07 kunsttyv joins (~kunsttyv@ti0005q162-5102.bb.online.no)
2021-03-04 16:12:47 agander joins (~agander@193.46.28.55)
2021-03-04 16:12:49 <shapr> jhaxim: did you have a particular queue in mind?
2021-03-04 16:13:17 <jhaxim> yeah, i was just wondering why you can't just implement it as a linked list?
2021-03-04 16:13:23 <jhaxim> the one i had in mind was the one with 2 lists
2021-03-04 16:14:03 × kiweun quits (~kiweun@dsl-173-206-6-91.tor.primus.ca) (Remote host closed the connection)
2021-03-04 16:14:18 <dolio> Lists in Haskell only allow fast access to one side, but queues are expected to have fast access to certain operations on both sides.
2021-03-04 16:14:21 <int-e> infinisil: The 'a' is an argument for which test cases are to be generated... which is what Arbitrary is for
2021-03-04 16:14:41 <jhaxim> yeah, why doesn't haskell have something like linked lists?
2021-03-04 16:14:46 <jhaxim> where you can keep pointers to both ends?
2021-03-04 16:15:27 <dolio> Haskell lists are linked lists. But they're not made with mutable pointers.
2021-03-04 16:16:07 <infinisil> I may be confused a bit
2021-03-04 16:16:14 <infinisil> int-e: What is CoArbitrary for?
2021-03-04 16:16:22 agander_ joins (~agander@193.46.28.55)
2021-03-04 16:16:23 <jhaxim> why does only being able to expand on one end change anything?
2021-03-04 16:16:24 <int-e> @check \(x :: Int) -> odd x || even x -- here, a = Int, prop = Bool.
2021-03-04 16:16:25 <lambdabot> <unknown>.hs:1:13:ScopedTypeVariables language extension is not enabled. Ple...
2021-03-04 16:16:25 hiroaki_ joins (~hiroaki@2a02:8108:8c40:2bb8:4bed:da7a:2692:1300)
2021-03-04 16:16:26 <jhaxim> i'm a little confused
2021-03-04 16:16:34 <int-e> oh.
2021-03-04 16:16:44 × malumore quits (~alecs@151.62.127.36) (Ping timeout: 245 seconds)
2021-03-04 16:16:48 <int-e> @check \x -> odd x || even (x :: Int)
2021-03-04 16:16:50 <lambdabot> +++ OK, passed 100 tests.
2021-03-04 16:16:59 peasynt joins (~AdminUser@pool-173-76-103-124.bstnma.fios.verizon.net)
2021-03-04 16:17:30 aggin joins (~ecm@103.88.87.27)
2021-03-04 16:18:12 <int-e> jhaxim: operationally, Coarbitrary is for retrieving entropy from function arguments, so you can have Arbitrary instances for functions a -> b that aren't constant.
2021-03-04 16:18:20 × aggin quits (~ecm@103.88.87.27) (Client Quit)
2021-03-04 16:18:25 kibo joins (~kibo@51-171-46-249-dynamic.agg2.ens.lmk-pgs.eircom.net)
2021-03-04 16:18:27 × DustyDingo quits (~nonamen@v2202001112302107134.ultrasrv.de) (Quit: leaving)
2021-03-04 16:18:35 DustyDingo joins (~nonamen@v2202001112302107134.ultrasrv.de)
2021-03-04 16:18:55 × graf_blu` quits (~user@adsl-178-38-234-220.adslplus.ch) (Remote host closed the connection)
2021-03-04 16:19:11 kiweun joins (~kiweun@dsl-173-206-6-91.tor.primus.ca)
2021-03-04 16:19:23 <infinisil> (I guess that was meant for me)
2021-03-04 16:19:30 <int-e> hence instance (Coarbitrary a, Arbitrary b) => Arbitrary (a -> b)
2021-03-04 16:19:45 <int-e> infinisil: yes, sorry...
2021-03-04 16:19:49 <infinisil> What are "functions that aren't constant"?
2021-03-04 16:19:58 quackrabbit joins (~aeline@129-2-180-100.wireless.umd.edu)
2021-03-04 16:20:03 <infinisil> Function that change the `b` depending on the `a`?
2021-03-04 16:20:14 × mouseghost quits (~draco@wikipedia/desperek) (Quit: mew wew)
2021-03-04 16:20:30 <int-e> instance Arbitrary b => Arbitrary (a -> b) would not be able to do anything with the 'a', hence all the functions it could produce would be constantr
2021-03-04 16:20:39 <int-e> so yes, that
2021-03-04 16:20:41 <infinisil> Ah I see
2021-03-04 16:22:18 <dolio> jhaxim: If you use a single list, then either the front of the list is the output or the input. If it's the input, then dequeue has to rebuild the list and get an element from the far end, which takes O(n) time to get the value. If it's the output, then enqueue has to rebuild the whole list, which costs O(n) each time in the long run.
2021-03-04 16:22:40 Lycurgus joins (~niemand@cpe-45-46-139-165.buffalo.res.rr.com)
2021-03-04 16:23:18 <infinisil> So CoArbitrary is really only for generating functions
2021-03-04 16:23:28 Varis joins (~Tadas@unaffiliated/varis)
2021-03-04 16:23:54 <dolio> So using two lists lets you access both ends fast, and only pay the linear rebuilding cost every so often.
2021-03-04 16:24:04 × kiweun quits (~kiweun@dsl-173-206-6-91.tor.primus.ca) (Read error: Connection reset by peer)
2021-03-04 16:24:29 malumore joins (~malumore@151.62.127.36)
2021-03-04 16:24:33 kiweun joins (~kiweun@dsl-173-206-6-91.tor.primus.ca)
2021-03-04 16:25:17 <int-e> infinisil: yup
2021-03-04 16:26:42 <dolio> The three lists version duplicates one of the lists when you perform the reversal and incrementally forces it on every operation to spread out the cost.
2021-03-04 16:27:09 × ph88 quits (~ph88@ip5f5af71a.dynamic.kabel-deutschland.de) (Quit: Leaving)
2021-03-04 16:27:38 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-04 16:28:12 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Remote host closed the connection)
2021-03-04 16:28:28 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-04 16:29:18 jakalx parts (~jakalx@base.jakalx.net) ("Error from remote client")
2021-03-04 16:30:15 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Remote host closed the connection)
2021-03-04 16:31:28 nineonine joins (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639)
2021-03-04 16:32:09 × agander_ quits (~agander@193.46.28.55) (Quit: Leaving)
2021-03-04 16:32:18 × teardown quits (~user@gateway/tor-sasl/mrush) (Ping timeout: 268 seconds)
2021-03-04 16:32:20 × deviantfero quits (~deviantfe@190.150.27.58) (Quit: WeeChat 3.0)
2021-03-04 16:32:42 vicfred joins (vicfred@gateway/vpn/mullvad/vicfred)
2021-03-04 16:33:57 heatsink joins (~heatsink@2600:1700:bef1:5e10:dd5f:6f4f:a50:215d)
2021-03-04 16:36:00 pavonia joins (~user@unaffiliated/siracusa)
2021-03-04 16:36:23 × nineonine quits (~nineonine@2604:3d08:7785:9600:d6d:9e4a:ef90:7639) (Ping timeout: 260 seconds)
2021-03-04 16:36:41 × kritzefitz quits (~kritzefit@fw-front.credativ.com) (Remote host closed the connection)
2021-03-04 16:38:46 teardown joins (~user@gateway/tor-sasl/mrush)
2021-03-04 16:39:05 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.0.1)
2021-03-04 16:40:57 × chenshen quits (~chenshen@2620:10d:c090:400::5:dc3c) (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
2021-03-04 16:42:14 chenshen joins (~chenshen@2620:10d:c090:400::5:dc3c)
2021-03-04 16:43:14 × Boomerang quits (~Boomerang@2a05:f6c7:2179:0:64:db14:2c3a:3ba3) (Ping timeout: 264 seconds)
2021-03-04 16:44:36 <ezzieyguywuf> i'm using megaparsec, and I have two parsers written 'parseFront :: Parser Text', and 'parseLast :: Parser Text'. how would I go about consuming as many 'parseFront' as possible until 'parseLast' succeeds?
2021-03-04 16:46:11 kritzefitz joins (~kritzefit@212.86.56.80)
2021-03-04 16:49:08 <c_wraith> ezzieyguywuf: https://hackage.haskell.org/package/parser-combinators-1.2.1/docs/Control-Monad-Combinators.html#v:manyTill_
2021-03-04 16:49:18 <c_wraith> note that megaparsec re-exports that for you
2021-03-04 16:50:25 <ezzieyguywuf> c_wraith: dope tahnks
2021-03-04 16:51:53 mayleesia joins (4d0b2c7f@dynamic-077-011-044-127.77.11.pool.telefonica.de)
2021-03-04 16:52:41 aarvar joins (~foewfoiew@2601:602:a080:fa0:176:cad2:9667:c008)
2021-03-04 16:53:15 jamm_ joins (~jamm@unaffiliated/jamm)
2021-03-04 16:53:43 × jhaxim quits (c036de94@192.54.222.148) (Ping timeout: 240 seconds)
2021-03-04 16:55:25 × romesrf quits (~romesrf@2001:818:dcef:c700:d53a:4836:b1c5:f3ae) (Quit: WeeChat 3.0.1)
2021-03-04 16:58:32 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-03-04 17:00:59 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
2021-03-04 17:01:03 × knupfer quits (~Thunderbi@200116b82c5bbe00c174e65d57f6f6eb.dip.versatel-1u1.de) (Remote host closed the connection)

All times are in UTC.