Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 784 785 786 787 788 789 790 791 792 793 794 .. 5022
502,152 events total
2020-10-21 20:06:26 Iwawa joins (~mdomin45@cpe-24-211-129-187.nc.res.rr.com)
2020-10-21 20:07:53 coot joins (~coot@37.30.51.94.nat.umts.dynamic.t-mobile.pl)
2020-10-21 20:08:54 <tabaqui> Oh, probably I could replace TypeFamilies
2020-10-21 20:09:41 <ski> (or at least, infinitely many of them being non-empty)
2020-10-21 20:09:49 × Pitaya quits (~mdomin45@cpe-24-211-129-187.nc.res.rr.com) (Ping timeout: 264 seconds)
2020-10-21 20:10:19 × geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Remote host closed the connection)
2020-10-21 20:10:31 kritzefitz joins (~kritzefit@212.86.56.80)
2020-10-21 20:10:50 <ski> hololeap : `forall r. (a -> r -> r) -> r -> r' is (doubly) CPS (success, and failure, continuation)
2020-10-21 20:11:27 geekosaur joins (82659a09@host154-009.vpn.uakron.edu)
2020-10-21 20:12:07 <hololeap> ski: i don't have much of an intuition for cps, so that doesn't help much
2020-10-21 20:12:27 avoandmayo joins (~textual@122-58-158-238-adsl.sparkbb.co.nz)
2020-10-21 20:12:40 <hololeap> i can see how (a -> r -> r) is roughly equal to (:) and r is roughly equal to []
2020-10-21 20:13:11 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-21 20:13:13 conal joins (~conal@ip-66-115-176-174.creativelink.net)
2020-10-21 20:13:57 <hololeap> % :t runContT
2020-10-21 20:13:57 <yahb> hololeap: ContT r m a -> (a -> m r) -> m r
2020-10-21 20:14:23 <hololeap> % :t ContT
2020-10-21 20:14:24 <yahb> hololeap: ((a -> m r) -> m r) -> ContT r m a
2020-10-21 20:14:59 ZarTek parts (znc@static.138.236.76.144.clients.your-server.de) ()
2020-10-21 20:15:12 × notnatebtw quits (~nate@110.138.18.157) (Quit: WeeChat 2.9)
2020-10-21 20:15:39 notnatebtw joins (~nate@110.138.18.157)
2020-10-21 20:15:52 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 20:16:13 × notnatebtw quits (~nate@110.138.18.157) (Client Quit)
2020-10-21 20:17:10 notnatebtw joins (~nate@110.138.18.157)
2020-10-21 20:18:38 wroathe joins (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net)
2020-10-21 20:19:08 × ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection)
2020-10-21 20:19:25 × wroathe_ quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
2020-10-21 20:19:29 ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net)
2020-10-21 20:19:31 ukari joins (~ukari@unaffiliated/ukari)
2020-10-21 20:21:18 × britva quits (~britva@2a02:aa13:7240:2980:b1bf:9c31:7687:bea1) (Quit: This computer has gone to sleep)
2020-10-21 20:24:14 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2020-10-21 20:26:32 <ski> @unmtl ContT () (Cont r) a
2020-10-21 20:26:32 <lambdabot> (a -> (() -> r) -> r) -> (() -> r) -> r
2020-10-21 20:26:37 <ski> hololeap ^
2020-10-21 20:27:38 <hololeap> huh, ok
2020-10-21 20:28:00 × notnatebtw quits (~nate@110.138.18.157) (Quit: WeeChat 2.9)
2020-10-21 20:28:27 notnatebtw joins (~nate@110.138.18.157)
2020-10-21 20:28:44 <ski> (that's what i meant by "doubly". there's two CPS "levels", one on top of the other one)
2020-10-21 20:29:00 <ski> hololeap : happen to know any Prolog ?
2020-10-21 20:30:01 <hololeap> unfortunately, no. and i don't have a specific use-case needing Logic(T). i was just trying to understand another tool
2020-10-21 20:30:27 hackage ordinal 0.3.1.0 - Convert numbers to words in different languages. https://hackage.haskell.org/package/ordinal-0.3.1.0 (wvanonsem90)
2020-10-21 20:31:25 <ski> well, consider using lists as "multiple alternative successes"
2020-10-21 20:31:42 <ski> what the `Applicative' and `Monad' instance of `[]' gives you
2020-10-21 20:32:26 britva joins (~britva@2a02:aa13:7240:2980:b1bf:9c31:7687:bea1)
2020-10-21 20:33:01 z0_ joins (~z0@bl15-167-204.dsl.telepac.pt)
2020-10-21 20:33:20 × z0_ quits (~z0@bl15-167-204.dsl.telepac.pt) (Client Quit)
2020-10-21 20:33:21 <ski> you can think of `child :: Person -> [] Person' as computing for you "an arbitrary child" of a person (given some family relations database / knowledge base that this queries)
2020-10-21 20:33:40 × Franciman quits (~francesco@host-82-54-10-114.retail.telecomitalia.it) (Quit: Leaving)
2020-10-21 20:33:46 × buckworst quits (~nate@110.138.18.157) (Quit: WeeChat 2.9)
2020-10-21 20:33:57 <ski> (well, let's rename that function to `childOf')
2020-10-21 20:34:12 z0_ joins (~z0@bl15-167-204.dsl.telepac.pt)
2020-10-21 20:34:28 <hololeap> interesting that you're not naming it "childrenOf", but i think i see where you're going
2020-10-21 20:34:41 bartemius joins (~bartemius@109-252-19-142.nat.spd-mgts.ru)
2020-10-21 20:34:47 <ski> then you could define `grandChildOf :: Person -> [] Person; grandChild person = do child <- childOf person; grandChild <- childOf child; return grandChild'
2020-10-21 20:34:54 Plantain joins (~mdomin45@cpe-24-211-129-187.nc.res.rr.com)
2020-10-21 20:34:59 <ski> the point is to "think in the singular", so to speak
2020-10-21 20:35:28 z0__ joins (~z0@bl15-167-204.dsl.telepac.pt)
2020-10-21 20:35:28 <ski> it just so happens that it'll actually try all the children, so sequencing `;' here in `do' acts like nested loops
2020-10-21 20:35:28 × erolm_a quits (~erolm_a@62.19.60.223) (Read error: Connection reset by peer)
2020-10-21 20:35:41 erolm_a joins (~erolm_a@82.24.185.133)
2020-10-21 20:35:44 × z0__ quits (~z0@bl15-167-204.dsl.telepac.pt) (Client Quit)
2020-10-21 20:36:02 × z0_ quits (~z0@bl15-167-204.dsl.telepac.pt) (Client Quit)
2020-10-21 20:36:05 × Iwawa quits (~mdomin45@cpe-24-211-129-187.nc.res.rr.com) (Ping timeout: 240 seconds)
2020-10-21 20:37:05 <hololeap> grandChildOf = childOf >=> childOf
2020-10-21 20:37:14 <ski> in Prolog, you'd write this as `grand_child_of(Person,GrandChild) :- child_of(Person,Child),child_of(Child,GrandChild).' (where you can read `:-' as "if")
2020-10-21 20:38:32 <ski> ("`GrandChild' is a grand-child of `Person', if `Child' is a child of `Person', and `GrandChild' is a child of `Child'." is how you could read it out aloud)
2020-10-21 20:38:44 × Guest46583 quits (~z0@bl15-167-204.dsl.telepac.pt) (Quit: Lost terminal)
2020-10-21 20:39:13 × bartemius quits (~bartemius@109-252-19-142.nat.spd-mgts.ru) (Ping timeout: 264 seconds)
2020-10-21 20:40:07 × geekosaur quits (82659a09@host154-009.vpn.uakron.edu) (Remote host closed the connection)
2020-10-21 20:40:18 × stefan-__ quits (~cri@42dots.de) (Read error: Connection reset by peer)
2020-10-21 20:40:22 × hyperisco quits (~hyperisco@d192-186-117-226.static.comm.cgocable.net) (Read error: Connection reset by peer)
2020-10-21 20:40:33 <ski> consider `between(1,5,N),N > 2,M is N*N,M < 10'
2020-10-21 20:40:41 stefan-__ joins (~cri@42dots.de)
2020-10-21 20:41:01 <ski> `between(1,5,N)' will have five solutions for `N', being the integers between `1' and `5' (inclusive)
2020-10-21 20:42:05 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-21 20:42:19 <ski> at first, `N = 1' is tried (first solution of that between/3 call). then `N > 1' is tried, but this fails (no solutions / "empty list of solutions"). this causes "backtracking" (the program "executing backwards"), going back to the last point where we had an alternative choice, which here was the between/3 call
2020-10-21 20:43:31 <ski> so, the next solution of that call is tries, which is `N = 2', so execution resumes going forward again. but this solution also fails the test `N > 2', so we backtrack again, getting `N = 3' as solution from between/3, this time, finally passing the `N > 2' test
2020-10-21 20:44:24 <ski> next, we compute `M' to be the square of `N', so now `M = 9'. and this passes `M < 10', so we have an overall solution to the whole query : `N = 3,M = 9' (`,' means "and")
2020-10-21 20:44:30 <ski> hololeap : making any sense ?
2020-10-21 20:44:54 z0 joins (~z0@bl15-167-204.dsl.telepac.pt)
2020-10-21 20:44:58 × z0 quits (~z0@bl15-167-204.dsl.telepac.pt) (Client Quit)
2020-10-21 20:45:00 <ski> > [(m,n) | n <- [1 .. 5],n > 2,let m = n*n,m < 10]
2020-10-21 20:45:03 <lambdabot> [(9,3)]
2020-10-21 20:45:04 <ski> is the Haskell version of this
2020-10-21 20:45:37 <ski> > do n <- [1 .. 5]; guard (n > 2); let {m = n*n}; guard (m < 10); return (m,n) -- or, with `do'-notation
2020-10-21 20:45:39 <lambdabot> [(9,3)]
2020-10-21 20:47:24 <dminuoso> phadej: Hi! I recall you had a nice diagram of profunctor optics and their hierarchy, along with their profunctor constraints (Strong, Choice, etc). Was that up on the Glassery.md? If so, the images there are broken. :(
2020-10-21 20:47:37 z0 joins (~z0@bl15-167-204.dsl.telepac.pt)
2020-10-21 20:47:53 <ski> anyway ..
2020-10-21 20:48:31 z0_ joins (~z0@bl15-167-204.dsl.telepac.pt)
2020-10-21 20:49:08 <hololeap> dminuoso: this? http://i.imgur.com/ALlbPRa.png
2020-10-21 20:49:16 <ski> .. after getting the first solution `N = 3,M = 9', we can ask the Prolog interactor to check if it can find any other/more. (usually by pressing `;', which means "or"). conceptually, this acts as we telling Prolog we're not satisfied with the solution it found, so that it should try to find another
2020-10-21 20:49:31 <hololeap> dminuoso: sorry, that's lens not profunctors
2020-10-21 20:49:40 × z0_ quits (~z0@bl15-167-204.dsl.telepac.pt) (Client Quit)
2020-10-21 20:49:50 × texasmynsted quits (~texasmyns@104.140.52.83) (Remote host closed the connection)
2020-10-21 20:50:06 <ski> (similar to how the `N > 2' test "told" the between/3 call that the first two solutions of it were no good, by starting backtracking ("backward execution"), so control returned back, "unreturned into", that between/3 call)
2020-10-21 20:50:31 texasmynsted joins (~texasmyns@104.140.52.83)
2020-10-21 20:51:26 <ski> in this case, the last choice-point was still in between/3 (none of the other goals after it had alternative solutions). so we'll then try `N = 4', which passes the `N > 2' test, but then the `M < 10' test fails (since `M = 16' then). and similarly the `N = 5' solution also fails, so we try to backtrack to the left of the first call (to between/3), and "hit the wall"
2020-10-21 20:51:32 <ski> meaning, there are no (more) solutions
2020-10-21 20:52:03 <ski> hololeap : that's a very quick intro to backtracking in Prolog

All times are in UTC.