Logs: liberachat/#haskell
| 2021-07-26 17:36:14 | <davean> | monochrom: they have a nice JIT toolkit! |
| 2021-07-26 17:37:08 | <DigitalKiwi> | plz buy my new book on dysfunctional programming; types without thinking, available soon but maybe never! |
| 2021-07-26 17:38:05 | <monochrom> | Wait, types without thinking? thinking without types? |
| 2021-07-26 17:38:24 | <DigitalKiwi> | yes |
| 2021-07-26 17:38:41 | <monochrom> | You know, "without" can also mean "outside", so "think outside the types" sounds like an attractive kind of "think outside the box" thing :) |
| 2021-07-26 17:38:56 | <DigitalKiwi> | Hecate: does your quotes.txt have an api; i would like to query it |
| 2021-07-26 17:39:24 | <monochrom> | "curl | grep" :) |
| 2021-07-26 17:39:51 | × | dunj3 quits (~dunj3@2001:16b8:30df:3d00:990a:dac8:a84c:f3b6) (Remote host closed the connection) |
| 2021-07-26 17:40:02 | × | fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 252 seconds) |
| 2021-07-26 17:40:04 | → | pavonia joins (~user@user/siracusa) |
| 2021-07-26 17:40:54 | → | fossdd joins (~fossdd@sourcehut/user/fossdd) |
| 2021-07-26 17:40:55 | <dsal> | arkanoid: My experience is that I build dumb things dumb ways and then every once in a while, I remember a thing I read that didn't make any sense to me at the time and realize how it applies to my current situation and makes things much simpler. |
| 2021-07-26 17:41:11 | <DigitalKiwi> | .glirclogs/#mostlyabsurd/2020-04-27.log:[12:56:36] <DigitalKiwi> you may wonder how my brain works, to which i ask, does it? |
| 2021-07-26 17:41:21 | <monochrom> | DigitalKiwi: Which one do you like more: "thinking without types without thinking", "types without thinking without types" |
| 2021-07-26 17:41:33 | <dsal> | e.g., I read about FunctionalDependencies and just kind of ignored it because why would I ever need that? Then it was suddenly the exact solution to a problem I ran into when trying to design something. |
| 2021-07-26 17:42:07 | <DigitalKiwi> | monochrom: are you gonna name squat it lol |
| 2021-07-26 17:42:08 | <monochrom> | Yeah I like to tell people "I'm a Chinese Room right here" too. |
| 2021-07-26 17:42:18 | <monochrom> | :) |
| 2021-07-26 17:42:24 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 2021-07-26 17:42:26 | <dsal> | Or monoids... they seem so dumb when you read the description. Then you find that when you just do the dumb thing and model stuff as a monoid, things get incrementally easier and suddenly a lot of stuff gets easier. |
| 2021-07-26 17:42:43 | <dsal> | But you don't need to start out that way. Just do the simple things and then watch things emerge. |
| 2021-07-26 17:42:57 | → | Morrow joins (~Morrow@bzq-110-168-31-106.red.bezeqint.net) |
| 2021-07-26 17:43:00 | → | sedeki joins (~textual@user/sedeki) |
| 2021-07-26 17:43:07 | × | euandreh quits (~euandreh@2804:14c:33:9fe5:f655:102a:90bc:6632) (Quit: WeeChat 3.2) |
| 2021-07-26 17:43:25 | <dsal> | DigitalKiwi: that looks exactly like something I think constantly. |
| 2021-07-26 17:45:20 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2021-07-26 17:46:02 | <DigitalKiwi> | oh no |
| 2021-07-26 17:46:31 | <DigitalKiwi> | the doctors think i'm crazy but what do they know |
| 2021-07-26 17:48:10 | <arkanoid> | dsal: I know that feeling. I dived into FP after naively asking (while doing procedure-based programming) "this function is not pure just because it raises exception, is there a solution?" and BAM I was inside the Monad rabbit hole |
| 2021-07-26 17:49:44 | × | mnrmnaugh quits (~mnrmnaugh@pool-96-252-87-182.bstnma.fios.verizon.net) (Quit: Leaving) |
| 2021-07-26 17:49:45 | <arkanoid> | so I wrote a Monad metaprogramming based library to cope with that, and then I realised that I was lacking HKT, and BAM I'm here |
| 2021-07-26 17:50:09 | <DigitalKiwi> | monochrom: what's that mean |
| 2021-07-26 17:50:38 | <DigitalKiwi> | the only mandarin i know is oranges ;( |
| 2021-07-26 17:51:06 | <monochrom> | I know Chinese. I came from and grew up in Hong Kong. |
| 2021-07-26 17:52:02 | <DigitalKiwi> | what was that like |
| 2021-07-26 17:52:10 | <monochrom> | Then I learned that this fellow, John Searle, whose only arguments are founded in circular logic and human ego, coined the term "Chinese Room" to badmouth A.I. |
| 2021-07-26 17:52:11 | <maerwald> | odd question :D |
| 2021-07-26 17:54:05 | → | mastarija joins (~mastarija@31.217.8.174) |
| 2021-07-26 17:54:37 | <monochrom> | So my reply is I'm a Chinese Room here, you can't prove that I understand Chinese either (even though you find that I can use it greatly). And BTW I have seen that a lot of TOEFL takers trained for it by training themselves to be awesome English Rooms not awesome English users. |
| 2021-07-26 17:55:02 | → | burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk) |
| 2021-07-26 17:55:26 | → | roboguy__ joins (~roboguy_@2605:a601:ac0e:ae00:f433:8617:e8c3:dcbe) |
| 2021-07-26 17:55:40 | <monochrom> | Anyway back to being a Haskell Room! |
| 2021-07-26 17:56:01 | <DigitalKiwi> | i'll have you know i do not speak english; i'm american! |
| 2021-07-26 17:56:14 | <monochrom> | haha |
| 2021-07-26 17:56:28 | <sm> | geekosaur, edrx: |
| 2021-07-26 17:56:28 | <sm> | cd; stack exec -- ghc-pkg list |
| 2021-07-26 17:56:28 | <sm> | stack exec -- ghc-pkg describe ieee754 |
| 2021-07-26 17:56:33 | <DigitalKiwi> | https://mostlyabsurd.com/about/#robert-djubek |
| 2021-07-26 17:56:44 | → | ikex1 joins (~ash@user/ikex) |
| 2021-07-26 17:56:47 | <monochrom> | Shameless plug: Learn how to become a type inference room from my http://www.vex.net/~trebla/haskell/type-inference.html |
| 2021-07-26 17:57:29 | → | ikex- joins (~ash@user/ikex) |
| 2021-07-26 17:58:17 | × | ikex quits (ash@user/ikex) (Ping timeout: 265 seconds) |
| 2021-07-26 17:58:17 | ikex- | is now known as ikex |
| 2021-07-26 17:58:59 | × | roboguy_ quits (~roboguy_@2605:a601:ac0e:ae00:6549:5b6:6ac5:3a5d) (Ping timeout: 255 seconds) |
| 2021-07-26 17:59:36 | × | burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 258 seconds) |
| 2021-07-26 18:01:23 | × | ikex1 quits (~ash@user/ikex) (Ping timeout: 268 seconds) |
| 2021-07-26 18:01:53 | <catern> | dear #haskell, is there anything like Java's native methods/JNI for Haskell? I know that there's FFI in general, of course, but I mean specifically, a way that you can write down a file full of type signatures, and some tool will process that and generate corresponding C headers that you can then implement? akin to https://www.baeldung.com/jni#2-implementing-a-method-in-c |
| 2021-07-26 18:03:55 | <mastarija> | So, I want to create Alternative instance `Alternative f` where `f :: Monoid a => a -> Type` |
| 2021-07-26 18:03:58 | <mastarija> | Is this possible? |
| 2021-07-26 18:04:51 | <mastarija> | GHC suggests adding instance sigs when I play dumb and define `empty` as `MyCons mempty` |
| 2021-07-26 18:05:03 | <mastarija> | But it doesn't seem to be working |
| 2021-07-26 18:06:17 | <roboguy__> | mastarija: you are trying to constrain the type argument to f to be a Monoid? If so, that is not really possible without making a new Alternative typeclass (or using one from a library that provides a constrained Alternative class) |
| 2021-07-26 18:06:45 | <mastarija> | Yes, that's right |
| 2021-07-26 18:07:07 | <mastarija> | roboguy__, hm... that's a shame |
| 2021-07-26 18:07:22 | <[exa]> | mastarija: you'd need a proof that the `f` is a monoid for all possible parameters `a` |
| 2021-07-26 18:07:56 | <mastarija> | [exa], No, I just want a from `f a` to be a monoid |
| 2021-07-26 18:08:20 | <mastarija> | `f` doesn't have to be |
| 2021-07-26 18:08:22 | <[exa]> | which you promise to be any type by promising that you can do instances of `Alternative f` |
| 2021-07-26 18:09:22 | × | betelgeuse quits (~john2gb@94-225-47-8.access.telenet.be) (Quit: The Lounge - https://thelounge.chat) |
| 2021-07-26 18:09:24 | → | burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk) |
| 2021-07-26 18:09:27 | <roboguy__> | mastarija: you could make a Monoid instance for f with that constraint if that helps, though |
| 2021-07-26 18:09:27 | <[exa]> | I'm currently understanding the problem as trying to construct something like `instance (Applicative f, Monoid f a) => Alternative f "if applied to a"`, does that look right? |
| 2021-07-26 18:09:43 | <mastarija> | Yes |
| 2021-07-26 18:09:59 | <mastarija> | Cani I use something like ~ in the type constraints? |
| 2021-07-26 18:10:25 | <mastarija> | Maybe I can say (Alternative ~ f, Monoid f a)? |
| 2021-07-26 18:10:28 | <roboguy__> | You can actually only use ~ in a constraint, if I'm understanding you |
| 2021-07-26 18:10:36 | <[exa]> | mastarija: one solution would be to have a parametrizable monoid type, like `Monoid1 f` which promises that all `f a` are monoids |
| 2021-07-26 18:10:57 | <[exa]> | mastarija: surprise: that typeclass might be almost equivalent to Alternative now (I don't have a proof at hand tho, might need to consult typeclassopedia) |
| 2021-07-26 18:11:29 | <DigitalKiwi> | if monochrom is an AI it would explain a lot actually hmm |
| 2021-07-26 18:11:51 | <monochrom> | :) |
| 2021-07-26 18:11:53 | × | mc47 quits (~mc47@xmonad/TheMC47) (Read error: Connection reset by peer) |
| 2021-07-26 18:12:12 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 2021-07-26 18:12:21 | <roboguy__> | catern: I'm not sure if there's a general purpose solution to that, but `gl` package has a thing that automatically generates the OpenGL bindings |
| 2021-07-26 18:12:35 | <roboguy__> | https://github.com/ekmett/gl |
| 2021-07-26 18:14:12 | <DigitalKiwi> | monochrom: do you write for business insider? |
| 2021-07-26 18:14:27 | <monochrom> | No. |
| 2021-07-26 18:14:57 | <mastarija> | Damn, I tried `forall f a. ( Validated a ~ f a , Monoid a )=> Alternative Validated` and it didn't work :D |
| 2021-07-26 18:15:29 | <[exa]> | mastarija: that won't match the kind of Alternative, you're feeding it (* ->Constraint) but it expects * |
| 2021-07-26 18:16:53 | <[exa]> | mastarija: btw what's the point of exercise? create an Alternative automatically for all Applicatives that can kindof "behave like" monoids? |
| 2021-07-26 18:17:06 | × | fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 256 seconds) |
| 2021-07-26 18:17:13 | × | MoC quits (~moc@user/moc) (Quit: Konversation terminated!) |
| 2021-07-26 18:17:35 | <mastarija> | [exa], No, I can successfully implement many instances for my `data Validated e = Inert e | Wrong e` data type |
| 2021-07-26 18:17:47 | <mastarija> | All but alternative, which I need for validation purposes |
| 2021-07-26 18:17:55 | <roboguy__> | mastarija: The fact that you cannot do something like this is a pretty well known limitation, which is why some libraries exist that provide replacement type classes when it is necessary (see, for instance, the "constrained monad problem": https://ku-fpg.github.io/files/Sculthorpe-13-ConstrainedMonad.pdf) |
| 2021-07-26 18:18:01 | → | fossdd joins (~fossdd@sourcehut/user/fossdd) |
| 2021-07-26 18:18:18 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
| 2021-07-26 18:18:23 | <mastarija> | I could do something like `data Validated e a = Inert a | Wrong e` |
| 2021-07-26 18:18:27 | <monochrom> | There are only 4 cases... |
| 2021-07-26 18:19:00 | <mastarija> | Then I could implement Alternative, but then I have extra type variable which doesn't really make sense. |
| 2021-07-26 18:19:18 | <roboguy__> | mastarija: what about `data Validated_ e a = Inert a | Wrong e; type Validated e = Validated_ e e`? |
All times are in UTC.