Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,475 events total
2021-08-25 12:11:57 <mastarija> Looking at the docs, it seems like AllowAmbiguousTypes is introduced exactly for this problem
2021-08-25 12:12:11 <mastarija> Making type application useful in my particular case
2021-08-25 12:12:13 <mastarija> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/ambiguous_types.html?highlight=ambiguoustypes#extension-AllowAmbiguousTypes
2021-08-25 12:16:47 <jumper149> mastarija: Gen is from Test.QuickCheck?
2021-08-25 12:16:55 <mastarija> Yes
2021-08-25 12:19:32 <jumper149> What are you trying to test here? To me it looks like you want to test something like fmap? What is going on on the value level?
2021-08-25 12:19:59 <jumper149> I can see why you need TypeApplications though
2021-08-25 12:20:11 <mastarija> jumper149, I'm testing the applicative homomorphism law
2021-08-25 12:20:27 <mastarija> And I'm passing in a generator for 1 argument function and a value
2021-08-25 12:21:05 <mastarija> then I want to wrap those values in `pure` of the `Applicative` and I want to pass in the type constructor of the applicative
2021-08-25 12:21:17 <mastarija> So I can use pure @MyType etc
2021-08-25 12:21:36 <mastarija> This basically : pure $ ( pure @f f <*> pure v ) == ( pure $ f v )
2021-08-25 12:23:08 pbrisbin joins (~patrick@174-081-116-011.res.spectrum.com)
2021-08-25 12:23:21 <mastarija> I mean, it's done, I was just wondering if there's some other way other than enabling the ambiguous types
2021-08-25 12:23:52 <jumper149> It really doesn't look like you need AmbiguousTypes here, to me atleast.
2021-08-25 12:23:53 <mastarija> I always feel a bit of remorse when enabling a language extension
2021-08-25 12:24:27 hseg joins (~gesh@IGLD-84-228-238-79.inter.net.il)
2021-08-25 12:24:32 <jumper149> What type variable is ambiguous without enabling it?
2021-08-25 12:24:42 <jumper149> What does GHC throw
2021-08-25 12:26:01 oxide joins (~lambda@user/oxide)
2021-08-25 12:31:49 <mastarija> jumper149, "Could not deduce (Applicative f0) from the context: (Applicative f, Eq (f b))"
2021-08-25 12:32:03 <mastarija> But leave it, I think ambiguous types are necessary here
2021-08-25 12:32:23 <mastarija> GHC docs pretty much say that.
2021-08-25 12:32:36 <jumper149> mastarija: Yeah, after re-reading the GHC docs, it seems to be the case here.
2021-08-25 12:32:46 <mastarija> Unless I've interpreted something incorrectly :D
2021-08-25 12:33:48 × markpythonicbtc quits (~textual@2601:647:5a00:35:999f:46ac:3d0f:19d0) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-08-25 12:35:00 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
2021-08-25 12:36:10 <hseg> mastarija: an alternative to AAT is to have some parameter force the tyvar to unify with the desired type
2021-08-25 12:36:41 <mastarija> hseg, Yes, something like Proxy you mean :D
2021-08-25 12:37:13 <hseg> or something like #. from Data.Functor.Utils
2021-08-25 12:37:30 <hseg> https://hackage.haskell.org/package/base-4.14.1.0/docs/src/Data.Functor.Utils.html#%23.
2021-08-25 12:39:04 famubu joins (~famubu@14.139.174.50)
2021-08-25 12:40:33 bontaq joins (~user@ool-18e47f8d.dyn.optonline.net)
2021-08-25 12:41:22 <maerwald> who knew about this: https://hackage.haskell.org/package/bustle
2021-08-25 12:41:50 <hseg> ooh cool
2021-08-25 12:42:45 <Hecate> wow I most certainly did not
2021-08-25 12:45:04 <Clint> i did
2021-08-25 12:46:36 aman joins (~aman@user/aman)
2021-08-25 12:46:40 × oxide quits (~lambda@user/oxide) (Ping timeout: 240 seconds)
2021-08-25 12:46:44 shriekingnoise joins (~shrieking@186.137.144.80)
2021-08-25 12:47:34 oxide joins (~lambda@user/oxide)
2021-08-25 12:47:51 × ubert quits (~Thunderbi@77.119.197.143.wireless.dyn.drei.com) (Ping timeout: 250 seconds)
2021-08-25 12:49:13 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2021-08-25 12:50:25 favonia joins (~favonia@user/favonia)
2021-08-25 12:53:58 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
2021-08-25 12:54:42 × mikoto-c1 quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Quit: mikoto-c1)
2021-08-25 12:57:39 jakalx joins (~jakalx@base.jakalx.net)
2021-08-25 13:01:09 mikoto-c1 joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-08-25 13:01:58 <hseg> til type families look through type synonyms. in particular, eg given type Throwing a e = Either e a, evaluating a type family with an equation such as Map n (f a) = f (n a) at (f a) ~ Throwing a e will result in the type Throwing (n a) e, not Throwing a (n e)
2021-08-25 13:03:00 markpythonicbtc joins (~textual@50.228.44.6)
2021-08-25 13:03:29 × mastarija quits (~mastarija@78-3-210-70.adsl.net.t-com.hr) (Ping timeout: 248 seconds)
2021-08-25 13:04:15 <Hecate> type synonyms were a mistake of God
2021-08-25 13:04:16 <hseg> which means my elaborate system of type synonyms doesn't work well once it reaches type-level manipulations
2021-08-25 13:07:32 <hseg> hrmph. ok, that last bit of hope I had for my experimental refactor has died
2021-08-25 13:07:59 <hseg> seems constructing the type of the function I want is too heavy
2021-08-25 13:08:02 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
2021-08-25 13:08:07 <Boomerang> It would be nice if GHC could report all type synonyms encountered along the way in error messages
2021-08-25 13:08:15 <Boomerang> > map (+1) "Hello"
2021-08-25 13:08:17 <lambdabot> error:
2021-08-25 13:08:17 <lambdabot> • No instance for (Num Char) arising from a use of ‘+’
2021-08-25 13:08:17 <lambdabot> • In the first argument of ‘map’, namely ‘(+ 1)’
2021-08-25 13:08:43 hendursaga joins (~weechat@user/hendursaga)
2021-08-25 13:08:45 <Boomerang> Here, it would be great if it could mention `String` somewhere in the error
2021-08-25 13:09:05 <Boomerang> Maybe not the best example
2021-08-25 13:11:45 <Boomerang> > "hello" + 1
2021-08-25 13:11:47 <lambdabot> error:
2021-08-25 13:11:47 <lambdabot> • No instance for (Num [Char]) arising from a use of ‘+’
2021-08-25 13:11:47 <lambdabot> • In the expression: "hello" + 1
2021-08-25 13:12:26 <jumper149> When using servant it would be really cool, if GHC told me why exactly it can't unify `ServerT API m` and my the type of my handler. But instead it just uses the type synonym `ServerT ...`.
2021-08-25 13:16:19 Lycurgus joins (~juan@cpe-45-46-140-49.buffalo.res.rr.com)
2021-08-25 13:16:58 <lortabac> hseg: you have to use newtypes to invert parameters properly
2021-08-25 13:17:00 <dminuoso> maerwald: Haha!
2021-08-25 13:17:11 <dminuoso> Didn't we just talk about "dynamically linking ssl to allow for prompt updates"?
2021-08-25 13:17:13 <dminuoso> https://www.openssl.org/news/secadv/20210824.txt
2021-08-25 13:17:30 <dminuoso> Or did you read that yesterday already?
2021-08-25 13:17:46 <hseg> lortabac: yeah, except newtypes have the ergonomics issue of needing wrapping/unwrapping
2021-08-25 13:18:32 <hseg> dminuoso: don't see the relevance to dynamic linking?
2021-08-25 13:20:08 <dminuoso> hseg: maerwald's argument was that, if someone statically links openssl into each binary that you use, then you have to wait for *every* maintainer to provide a patched version.
2021-08-25 13:20:22 <dminuoso> Assuming there even is a maintainer..
2021-08-25 13:20:29 doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net)
2021-08-25 13:20:54 <dminuoso> And `openssl` is one of those things that, if a security vulnerability is found, you likely want it patched as soon as possible.
2021-08-25 13:21:15 <maerwald> patched via your package manager with working gpg signatures
2021-08-25 13:21:21 <maerwald> because your network is compromised now
2021-08-25 13:22:04 hendursa1 joins (~weechat@user/hendursaga)
2021-08-25 13:22:05 <dminuoso> So yeah. We have a buffer overflow with high criticality in openssl again. The advisory is from yesterday.
2021-08-25 13:22:22 <maerwald> well, but haskell-tls isn't affected, right? :D
2021-08-25 13:22:26 <dminuoso> hahaha
2021-08-25 13:22:48 <hseg> ah, so it was the coincidence of openssl being cited as an example, and then having this kind of advisory right after?
2021-08-25 13:22:56 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-08-25 13:22:56 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-08-25 13:22:56 wroathe joins (~wroathe@user/wroathe)
2021-08-25 13:22:58 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 244 seconds)
2021-08-25 13:23:26 <dminuoso> maerwald: A long while ago, I was doing some research on "API security gateway appliances" that you put in front of your API, and they essentially just do MITM, run a bunch of regex, and then break your application in funny ways.
2021-08-25 13:23:49 × Jonno_FTW quits (~come@api.carswap.me) (Ping timeout: 252 seconds)
2021-08-25 13:24:04 <dminuoso> And one of the vendors even *advertized* their "inhouse developed TLS library that is not vulnerable to OpenSSL vulerabilities. Our device was never vulnerable to Heartbleed"
2021-08-25 13:24:07 × dunj3 quits (~dunj3@p200300f617104f71b48bd778569fa2df.dip0.t-ipconnect.de) (Quit: Leaving)
2021-08-25 13:24:18 <dminuoso> Realy bragged about it.
2021-08-25 13:24:39 <dminuoso> hseg: yes
2021-08-25 13:25:15 Jonno_FTW joins (~come@api.carswap.me)
2021-08-25 13:26:33 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)

All times are in UTC.