Logs: freenode/#haskell
| 2020-10-26 02:23:39 | <lambdabot> | error: |
| 2020-10-26 02:23:39 | <lambdabot> | • No instance for (Integral Rational) arising from a use of ‘%’ |
| 2020-10-26 02:23:39 | <lambdabot> | • In the expression: |
| 2020-10-26 02:23:46 | <mikevdg> | toRational 1.2 |
| 2020-10-26 02:24:04 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection) |
| 2020-10-26 02:24:09 | <mikevdg> | > toRational 1.2 |
| 2020-10-26 02:24:10 | <gattytto> | dsal: deploying in kube sometimes gives more fine-grained expenditure, like if you containerize your apps in aws/gce it'll be cheaper than a vps because you pay as you use |
| 2020-10-26 02:24:11 | <lambdabot> | 5404319552844595 % 4503599627370496 |
| 2020-10-26 02:24:24 | <dsal> | It's not clear what you're trying to accomplish. Why would you type `toRational 1.2` ? |
| 2020-10-26 02:24:25 | <Axman6> | > decodeFloat 1.2 |
| 2020-10-26 02:24:27 | <lambdabot> | (5404319552844595,-52) |
| 2020-10-26 02:25:04 | <mikevdg> | I'm just playing with the numbers and trying to work out how they fit together. |
| 2020-10-26 02:25:47 | <dsal> | gattytto: But why would I want to do that? GoPro Plus already does all the cloud stuff for free. I wanted tools to free myself from that. I guess I did make a web interface as well, which maybe could use that, but the `backup` command runs locally and uses AWS Lambda to push all of the data to your own S3 bucket, tracking that state locally. |
| 2020-10-26 02:26:07 | <Axman6> | > properFraction 1.2 |
| 2020-10-26 02:26:09 | <lambdabot> | (1,0.19999999999999996) |
| 2020-10-26 02:26:20 | <mikevdg> | ew. |
| 2020-10-26 02:26:49 | <Axman6> | that's why you get the weird result with 1.2, since it cannot be exactly represented in IEEE-754 |
| 2020-10-26 02:27:05 | <Axman6> | > iterate (*2) 1.2 |
| 2020-10-26 02:27:07 | <lambdabot> | [1.2,2.4,4.8,9.6,19.2,38.4,76.8,153.6,307.2,614.4,1228.8,2457.6,4915.2,9830.... |
| 2020-10-26 02:27:10 | <dsal> | My goal is: GoPro decides to shut down, I can copy all my data out in ~43 minutes. (I have a slow connection, lots of latency, and that was without much concurrency) |
| 2020-10-26 02:27:22 | <dsal> | mikevdg: If you don't like IEEE standards, there are plenty of others to choose from. |
| 2020-10-26 02:27:37 | × | dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 246 seconds) |
| 2020-10-26 02:27:44 | <Axman6> | > properFraction (1.2 :: Rational) |
| 2020-10-26 02:27:45 | <lambdabot> | (1,1 % 5) |
| 2020-10-26 02:28:02 | <Axman6> | :t 1.2 |
| 2020-10-26 02:28:03 | <lambdabot> | Fractional p => p |
| 2020-10-26 02:29:51 | <Axman6> | > properFraction (1.2 :: Float) |
| 2020-10-26 02:29:53 | <lambdabot> | (1,0.20000005) |
| 2020-10-26 02:30:10 | <Axman6> | > toRational (1.2 :: Float) |
| 2020-10-26 02:30:12 | <lambdabot> | 5033165 % 4194304 |
| 2020-10-26 02:31:34 | × | Chi1thangoo quits (~Chi1thang@87.112.60.168) (Ping timeout: 258 seconds) |
| 2020-10-26 02:31:57 | hackage | crdt-event-fold 1.0.0.1 - Garbage collected event folding CRDT. https://hackage.haskell.org/package/crdt-event-fold-1.0.0.1 (rickowens) |
| 2020-10-26 02:34:25 | × | geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 240 seconds) |
| 2020-10-26 02:34:34 | → | danso joins (~dan@69-165-210-185.cable.teksavvy.com) |
| 2020-10-26 02:35:21 | × | djellemah quits (~djellemah@2601:5c2:100:96c:e008:b638:39fe:6a54) (Quit: Leaving) |
| 2020-10-26 02:35:47 | → | djellemah joins (~djellemah@2601:5c2:100:96c:e008:b638:39fe:6a54) |
| 2020-10-26 02:35:54 | <int-e> | The thing is, I believe that you can get a majority of Haskell users to agree that the existing numerical classes are awful, but you cannot get them to agree on a better design for them. There's too many conflicting design goals. |
| 2020-10-26 02:36:37 | <Axman6> | simple-reflect is the onlt reasonable number implementation, fight me |
| 2020-10-26 02:37:01 | <int-e> | > scanl (+) x [1..] |
| 2020-10-26 02:37:03 | <lambdabot> | [x,x + 1,x + 1 + 2,x + 1 + 2 + 3,x + 1 + 2 + 3 + 4,x + 1 + 2 + 3 + 4 + 5,x +... |
| 2020-10-26 02:37:06 | → | dyeplexer joins (~lol@unaffiliated/terpin) |
| 2020-10-26 02:37:18 | <Axman6> | keeping the AST and allowing the user to evaluate expressions if they need the answer is the proper thing to do |
| 2020-10-26 02:37:32 | <mikevdg> | What is simple-reflect? |
| 2020-10-26 02:37:40 | <Axman6> | > 1 + f x |
| 2020-10-26 02:37:42 | <lambdabot> | error: |
| 2020-10-26 02:37:42 | <lambdabot> | • Ambiguous type variable ‘a0’ arising from a use of ‘show_M820095627375... |
| 2020-10-26 02:37:42 | <lambdabot> | prevents the constraint ‘(Show a0)’ from being solved. |
| 2020-10-26 02:37:48 | <Axman6> | > 1 + f x :: Expr |
| 2020-10-26 02:37:50 | <lambdabot> | 1 + f x |
| 2020-10-26 02:38:02 | <Axman6> | > 3 ^ 7 :: Expr |
| 2020-10-26 02:38:04 | <lambdabot> | 3 * 3 * (3 * 3) * (3 * 3 * 3) |
| 2020-10-26 02:38:18 | <mikevdg> | :t (^) |
| 2020-10-26 02:38:19 | <lambdabot> | (Integral b, Num a) => a -> b -> a |
| 2020-10-26 02:38:38 | <Axman6> | > 3 ** 7 :: Expr |
| 2020-10-26 02:38:40 | <lambdabot> | 3**7 |
| 2020-10-26 02:38:50 | <mikevdg> | :t (**) |
| 2020-10-26 02:38:51 | <lambdabot> | Floating a => a -> a -> a |
| 2020-10-26 02:39:00 | → | dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) |
| 2020-10-26 02:39:07 | <mikevdg> | So (^) is exponent. What is (**) meant to be? |
| 2020-10-26 02:39:13 | <int-e> | mikevdg: You're seeing it in action... it captures numeric expressions in an ADT that can be pretty-printed |
| 2020-10-26 02:39:16 | <Axman6> | a different exponent... |
| 2020-10-26 02:39:24 | <Axman6> | > 3 ** 3.5 |
| 2020-10-26 02:39:26 | <lambdabot> | 46.76537180435969 |
| 2020-10-26 02:39:29 | <int-e> | :t (^^) |
| 2020-10-26 02:39:30 | <lambdabot> | (Fractional a, Integral b) => a -> b -> a |
| 2020-10-26 02:39:46 | <int-e> | ^ is for natural number exponents, ^^ for integer exponents, ** for arbitrary exponents |
| 2020-10-26 02:39:58 | <mikevdg> | :-o |
| 2020-10-26 02:40:03 | <Axman6> | Haskell is an exponential language, we have at least three ways to compute exponentials |
| 2020-10-26 02:40:25 | <int-e> | The operators live in different type classes. |
| 2020-10-26 02:40:34 | <Axman6> | > 5 ^ (-2) |
| 2020-10-26 02:40:37 | <lambdabot> | *Exception: Negative exponent |
| 2020-10-26 02:40:38 | <dsal> | Learning Haskell by exploring the surface area is a daunting task. |
| 2020-10-26 02:40:40 | <Axman6> | > 5 ^^ (-2) |
| 2020-10-26 02:40:42 | <lambdabot> | 4.0e-2 |
| 2020-10-26 02:41:08 | <int-e> | The numeric type classes are one of the worse places to start. |
| 2020-10-26 02:41:27 | <int-e> | (One other terrible place is the implementation of IO) |
| 2020-10-26 02:41:39 | <dsal> | :t show. (^^ 2) |
| 2020-10-26 02:41:40 | <lambdabot> | (Show a, Fractional a) => a -> String |
| 2020-10-26 02:41:45 | <mikevdg> | Yea, I got hit in the face with IO and lazy evaluation. |
| 2020-10-26 02:41:52 | × | jchia__ quits (~jchia@58.32.37.146) (Quit: Leaving.) |
| 2020-10-26 02:43:01 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2020-10-26 02:43:27 | <dsal> | Lazy evaluation sometimes makes really hard things easy, but I rarely notice it in general. It can make some things work in unexpected ways when mixed with io, for sure. |
| 2020-10-26 02:43:46 | → | T0pH4t joins (~josh@c-73-53-48-224.hsd1.wa.comcast.net) |
| 2020-10-26 02:43:48 | × | dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 260 seconds) |
| 2020-10-26 02:44:07 | <monsterchrom> | ** uses e^x and ln, and floating point approximations, it is inappropiate if you're doing natural numbers, or even your own number type for which ln doesn't make sense. |
| 2020-10-26 02:44:36 | × | crestfallen quits (~jvw@135-180-15-188.fiber.dynamic.sonic.net) (Ping timeout: 256 seconds) |
| 2020-10-26 02:44:37 | <mikevdg> | yea, like having a file be closed on you before you're done. Then you need to go read a chapter further ahead in the book that describes how `deepSeq` works. |
| 2020-10-26 02:44:43 | <monsterchrom> | x^^y allows negative powers, therefore 1/x must make sense. Well this doesn't make sense for some number types either. |
| 2020-10-26 02:45:22 | <monsterchrom> | Therefore, x^y is there for that. |
| 2020-10-26 02:45:25 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds) |
| 2020-10-26 02:45:34 | <dsal> | mikevdg: that sounds... Wrong. I don't think I've ever used deepseq outside of benchmarks. |
| 2020-10-26 02:46:06 | <dsal> | What book is this? |
| 2020-10-26 02:46:09 | <mikevdg> | Well, I gave up on the IO stuff and just moved on. |
| 2020-10-26 02:46:14 | <Axman6> | lazy IO is just a bad idea in general |
| 2020-10-26 02:47:32 | <T0pH4t> | hello all, quick question. Is there a way to access the type declaration in a class so that I can use it in func signature? For example "class Foo a where type Bar " then "doStuff :: Foo a => a -> Bar a" |
| 2020-10-26 02:47:47 | <T0pH4t> | Effectively I want access to the type declared for Bar in Foo |
| 2020-10-26 02:48:17 | <Axman6> | (b ~ Bar a, Foo a) => ... ? |
| 2020-10-26 02:48:34 | <T0pH4t> | oops that should be "type Bar a" in class def |
| 2020-10-26 02:48:48 | <Axman6> | wait, does that not work the way you've written it? |
| 2020-10-26 02:48:57 | <T0pH4t> | Well Bar is defined within class Foo, so Axman6 not sure that works |
All times are in UTC.