Logs: freenode/#haskell
| 2020-10-20 14:09:58 | × | zoran119 quits (~zoran119@124-169-31-193.dyn.iinet.net.au) (Ping timeout: 246 seconds) |
| 2020-10-20 14:10:34 | × | JetNoBrains quits (bc12e18b@188.18.225.139) (Remote host closed the connection) |
| 2020-10-20 14:11:09 | → | JetNoBrains joins (bc12e18b@188.18.225.139) |
| 2020-10-20 14:12:41 | <Cheery> | Eg. (/2) is not injective, because 1/2 and 2/2 produce same result. |
| 2020-10-20 14:12:48 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-10-20 14:13:02 | <Cheery> | > (1/2, 2/2) :: (Int, Int) |
| 2020-10-20 14:13:05 | <lambdabot> | error: |
| 2020-10-20 14:13:05 | <lambdabot> | • No instance for (Fractional Int) arising from a use of ‘/’ |
| 2020-10-20 14:13:05 | <lambdabot> | • In the expression: 1 / 2 |
| 2020-10-20 14:13:16 | × | codygman quits (~codygman@2600:380:f939:3d2d:1763:ec2f:9c5c:6459) (Read error: Connection reset by peer) |
| 2020-10-20 14:13:16 | → | Gerula joins (~Gerula@unaffiliated/gerula) |
| 2020-10-20 14:13:32 | → | kish joins (~oracle@unaffiliated/oracle) |
| 2020-10-20 14:13:36 | → | codygman joins (~codygman@47-184-107-46.dlls.tx.frontiernet.net) |
| 2020-10-20 14:13:47 | <Cheery> | haskell has no floordiv? |
| 2020-10-20 14:14:08 | × | shafox quits (~shafox@106.51.234.111) (Remote host closed the connection) |
| 2020-10-20 14:14:35 | <Cheery> | ah it has better. |
| 2020-10-20 14:14:54 | <Cheery> | > (quot 2 2, quot 3 2) |
| 2020-10-20 14:14:58 | <lambdabot> | (1,1) |
| 2020-10-20 14:15:22 | <Cheery> | Ug good at math. |
| 2020-10-20 14:15:28 | → | zoran119 joins (~zoran119@124-169-22-28.dyn.iinet.net.au) |
| 2020-10-20 14:15:43 | <opqdonut> | see also: div |
| 2020-10-20 14:16:03 | <opqdonut> | > (div 3 2, quot 3 2, div (-3) 2, quot (-3) 2) |
| 2020-10-20 14:16:05 | <lambdabot> | (1,1,-2,-1) |
| 2020-10-20 14:16:44 | <opqdonut> | and divMod and quotRem |
| 2020-10-20 14:16:47 | → | shafox joins (~shafox@106.51.234.111) |
| 2020-10-20 14:18:13 | <JetNoBrains> | Why `r` parameter in `ContT` transformer isn't universally quantified inside constructor? |
| 2020-10-20 14:18:41 | <Taneb> | JetNoBrains: because that would be a different, less powerful |
| 2020-10-20 14:18:43 | <Taneb> | type |
| 2020-10-20 14:18:46 | <DigitalKiwi> | thanks |
| 2020-10-20 14:19:48 | <Taneb> | JetNoBrains: having it outside lets us reset :: Cont r r -> Cont r' r |
| 2020-10-20 14:20:32 | × | GyroW_ quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie) |
| 2020-10-20 14:20:42 | → | GyroW joins (~GyroW@d54C03E98.access.telenet.be) |
| 2020-10-20 14:20:42 | × | GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host) |
| 2020-10-20 14:20:42 | → | GyroW joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-20 14:22:09 | <JetNoBrains> | Taneb interesting, but I can't find such function in mtl - where it is located? |
| 2020-10-20 14:22:44 | <Taneb> | It's in Control.Monad.Trans.Cont in transformers |
| 2020-10-20 14:23:17 | <Taneb> | I'm a little surprised that mtl doesn't reexport it |
| 2020-10-20 14:23:24 | <JetNoBrains> | Thanks, will take a look! |
| 2020-10-20 14:23:34 | × | hololeap quits (~hololeap@unaffiliated/hololeap) (Ping timeout: 260 seconds) |
| 2020-10-20 14:23:49 | → | polyrain_ joins (~polyrain@2001:8003:e501:6901:d502:fff6:715b:77f5) |
| 2020-10-20 14:24:05 | <Taneb> | JetNoBrains: the type you described, with the r parameter quantified on the inside of the constructor, is Control.Monad.Codensity in the kan-extensions package |
| 2020-10-20 14:25:21 | → | nados joins (~dan@69-165-210-185.cable.teksavvy.com) |
| 2020-10-20 14:26:42 | × | jonathanx quits (~jonathan@dyn-8-sc.cdg.chalmers.se) (Remote host closed the connection) |
| 2020-10-20 14:26:57 | × | polyrain quits (~polyrain@2001:8003:e501:6901:14f1:da8f:9790:497b) (Ping timeout: 260 seconds) |
| 2020-10-20 14:27:22 | → | djcaston joins (~djcaston@pool-71-188-85-134.cmdnnj.east.verizon.net) |
| 2020-10-20 14:27:46 | → | jonathanx joins (~jonathan@dyn-8-sc.cdg.chalmers.se) |
| 2020-10-20 14:29:34 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-20 14:29:44 | × | Philonous quits (~Philonous@unaffiliated/philonous) (Quit: ZNC - http://znc.in) |
| 2020-10-20 14:30:08 | → | Philonous joins (~Philonous@unaffiliated/philonous) |
| 2020-10-20 14:31:33 | <JetNoBrains> | I'm reading an article https://ro-che.info/articles/2019-06-07-why-use-contt where author uses ContT to manage resources, here "universality" of `r` is moved to function level |
| 2020-10-20 14:31:36 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-10-20 14:32:03 | <JetNoBrains> | But it seems that building intuition for ContT as "lifetime management" is not complete |
| 2020-10-20 14:34:25 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 264 seconds) |
| 2020-10-20 14:35:57 | → | ddellacosta joins (~dd@86.106.121.168) |
| 2020-10-20 14:38:10 | × | MindlessDrone quits (~MindlessD@unaffiliated/mindlessdrone) (Ping timeout: 272 seconds) |
| 2020-10-20 14:38:18 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 256 seconds) |
| 2020-10-20 14:39:45 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-20 14:41:09 | → | zoran119_ joins (~zoran119@124-169-22-52.dyn.iinet.net.au) |
| 2020-10-20 14:41:42 | × | zoran119 quits (~zoran119@124-169-22-28.dyn.iinet.net.au) (Ping timeout: 256 seconds) |
| 2020-10-20 14:42:09 | <maerwald> | with 3 words, do you do `foo $ bar baz` or `foo . bar $ baz`? :D |
| 2020-10-20 14:43:10 | <ski> | either the latter, or `(foo . bar) baz' or `foo (bar baz)' |
| 2020-10-20 14:43:11 | → | son0p joins (~son0p@181.136.122.143) |
| 2020-10-20 14:43:55 | <JetNoBrains> | `foo (bar baz)` anyone? :) |
| 2020-10-20 14:44:18 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 2020-10-20 14:44:25 | <ski> | DigitalKiwi : two different timezones had the same name, apparently |
| 2020-10-20 14:44:34 | × | kritzefitz quits (~kritzefit@2003:5b:203b:200::10:49) (Remote host closed the connection) |
| 2020-10-20 14:45:37 | <ski> | `f :: T -> U' being injective means that given different `T' inputs, it produces different `U' outputs. in a formula, one can say it like `forall (x0 :: T) (x1 :: T). f x0 = f x1 => x0 = x1' (if the outputs are the same, then the inputs must also have been the same) |
| 2020-10-20 14:45:54 | → | MindlessDrone joins (~MindlessD@unaffiliated/mindlessdrone) |
| 2020-10-20 14:46:48 | → | irc_user joins (uid423822@gateway/web/irccloud.com/x-dfebbsighvffakyp) |
| 2020-10-20 14:47:14 | <ski> | data constructors are injective in Haskell. this means that you can pattern-match uniquely. if a value matches `Just x0' and also matches `Just x1', then `x0' is the same as `x1'. so in the pattern `Just x', there's no ambiguity about what `x' would be. the only question is whether there exists such an `x' at all (if the input is `Nothing', then there is no `x' such that the input is equal to `Just x') |
| 2020-10-20 14:47:14 | × | bitmapper quits (uid464869@gateway/web/irccloud.com/x-ccvftmqgiojwtxir) (Quit: Connection closed for inactivity) |
| 2020-10-20 14:47:36 | → | Iwawa joins (~mdomin45@cpe-24-211-129-187.nc.res.rr.com) |
| 2020-10-20 14:47:59 | × | invaser quits (~Thunderbi@31.148.23.125) (Ping timeout: 260 seconds) |
| 2020-10-20 14:48:31 | → | knupfer joins (~Thunderbi@i59F7FF6F.versanet.de) |
| 2020-10-20 14:48:34 | × | knupfer quits (~Thunderbi@i59F7FF6F.versanet.de) (Client Quit) |
| 2020-10-20 14:48:45 | → | knupfer joins (~Thunderbi@200116b82c27b200ad7c9ffd9ebcfe8b.dip.versatel-1u1.de) |
| 2020-10-20 14:48:57 | → | fresheyeball joins (~isaac@c-71-237-105-37.hsd1.co.comcast.net) |
| 2020-10-20 14:49:13 | <ski> | however, if you're doing an abstract data type, often you want to simulate a "quotient type", and then, conceptually, the data constructor (which should not be exported) is not injective. e.g. the same `Set' (or `Map') can potentially be represented internally as different (balanced) trees |
| 2020-10-20 14:49:39 | <fresheyeball> | I got a hardish one |
| 2020-10-20 14:49:47 | <fresheyeball> | https://hackage.haskell.org/package/servant-server-0.14.1/docs/Servant-Server-StaticFiles.html#v:serveDirectoryWith |
| 2020-10-20 14:50:00 | <fresheyeball> | I need to replicate the behavior of this function but for a new Servant combinator |
| 2020-10-20 14:50:25 | × | Pitaya quits (~mdomin45@cpe-24-211-129-187.nc.res.rr.com) (Ping timeout: 240 seconds) |
| 2020-10-20 14:50:25 | × | JetNoBrains quits (bc12e18b@188.18.225.139) (Remote host closed the connection) |
| 2020-10-20 14:50:28 | × | britva quits (~britva@51.154.14.117) (Quit: This computer has gone to sleep) |
| 2020-10-20 14:50:29 | <fresheyeball> | and I just cannot get the types to unify |
| 2020-10-20 14:50:54 | <fresheyeball> | I don't totally understand what is going on in Servant but I can get my custom version to compile |
| 2020-10-20 14:50:59 | <fresheyeball> | with the correct implimentation |
| 2020-10-20 14:51:02 | <fresheyeball> | but with the following type |
| 2020-10-20 14:51:07 | <ski> | another example would be doing rational numbers. we could have `data Ratio a = a :% a', where `1 :% 2' is supposed to represent the same rational number as `2 :% 4'. so, conceptually, if you match on `n :% d', uniqueness of `n' and `d' isn't given. meaning, you have to make sure that the result is the same (or behaves the same), if the input had instead been another representation of the same rational number |
| 2020-10-20 14:51:22 | <fresheyeball> | StaticSettings -> Tagged (Get '[HTML] (Html m a)) Application |
| 2020-10-20 14:51:32 | <fresheyeball> | that type works for the implimentation |
| 2020-10-20 14:51:38 | <fresheyeball> | but I need it to be this |
| 2020-10-20 14:51:46 | <fresheyeball> | StaticSettings -> ServerT (Get ' |
| 2020-10-20 14:51:57 | raichoo_ | is now known as raichoo |
| 2020-10-20 14:52:08 | <fresheyeball> | StaticSettings -> ServerT (Get '[HTML] (Html m a)) Handler |
| 2020-10-20 14:52:12 | → | justanotheruser joins (~justanoth@unaffiliated/justanotheruser) |
| 2020-10-20 14:52:27 | <fresheyeball> | the same exact implimentation is what is used for the library version, I don't get what is wrong |
| 2020-10-20 14:52:35 | <fresheyeball> | and the library version has this type |
| 2020-10-20 14:52:45 | <fresheyeball> | StaticSettings -> ServerT Raw Handler |
| 2020-10-20 14:53:09 | <fresheyeball> | Tagged is kind polymorphic in a way I don't understand, and I could use help |
All times are in UTC.