#Generics

Rob Williamsoneswag@dju.social
2025-06-03

Does anyone else want to use Rust generics to do dependency injection, particularly for testing, but find that Rust's compiler bug with handling async types stops them? It's been months, but it still bugs me.

#Rust #Bugs #Generics

Gina Intheburg 🇺🇦 🌻 🥥🌴ginaintheburg@mastodon.world
2025-05-25

How US #Tariffs Stand to Impact Prescription Drugs

The biggest impact will be on #generics - the backbone of #Medicare & #Medicaid - 80% of which are made in #China or #India, making many Rx unaffordable for many, eg the 60% of #Seniors that rely on Medicaid.
hbr.org/2025/05/how-u-s-tariff

#Healthcare #TrumpTariffs

2025-05-19

Nice website to play a bit with and learn typescript generics

typescript-exercises.github.io/

2025-04-02

The new tariffs imposed include a 26% tariff on India. Half of all generic medicines in the US are from India. This will impact 9 out of 10 prescriptions. #prescriptions #tariffs #generics

Daniel Neumanremaster
2025-03-12

Sitting in PhpStorm and trying to get type hinting to work for calling generic functions.
I assume `$result` should get the type `T` and `$x` should be parsed as `int`, but the editor gives me no hint at all.
Is this even supposed to work?
```
/**
* @template T
* @param callable(): T $fun
* @return T
*/
function call(callable $fun) {
$result = $fun();
return $result;
}

$x = call(fn() => 1);
```
phpstan.org/r/76b4d50f-dd91-4e

Chris Engelbert / noctariusnoctarius2k@mastodon.online
2025-02-07

Me: I love the possibilities of generics in Typescript.

Also me: I hate the possibilities of generics in Typescript.

#typescript #generics #coding

2025-02-01

Day 20 of PHP Generics.

This looks at the extends annotation. We also see how multiple things we've learnt can be used together.

vimeo.com/1052595811

#phpstan #php #generics

you╭👺+300╭🐈x5╭⁂+3╭(Ⓐ+aunspeaker
2024-12-14

but at least i got pinned down the syntax for "pass through all the and and just implement me this here "

2024-12-02

[Перевод] Дженерики в Go

Это первая часть статьи, посвященной дженерикам в Go, из четырех. Одна из последних и наиболее интересных фич в Golang — поддержка дженериков. Эта серия туториалов будет посвящена тому, что это такое, какую пользу приносит, когда их стоит использовать и как они меняют процесс написания приложений на Golang. Начнем же!

habr.com/ru/companies/beget/ar

#go #generics #обобщения

2024-11-26

This paragraph from "Effective Rust" book made me do "huh". It explains the difference in use cases between associated types and generics.

As a technical aside, it's worth understanding why the Deref traits can't be generic (Deref<Target>) for the destination type. If they were, then it would be possible for some type ConfusedPtr to implement both Deref<TypeA> and Deref<TypeB>, and that would leave the compiler unable to deduce a single unique type for an expression like *x. So instead, the destination type is encoded as the associated type named Target.

#rust #generics

2024-11-03

Clever rust. In that last screenshot it shows the maximum value that can be factored with that table of data (last value squared). In previous screnshots it showed as Max::Overflow, because in 32-bits it did. Now that we're in 64-bit territory it's showing the max for the last 32-bit table, near the top of the 64-bit range. Of course the very first entry above 32-bits will overflow 64 when squared - as the lower table shows in the max field. (It gets used a lot and square root calcs are expensive in the main loop - another gain of the 30-at-a-time - do it once for the topmost one only, and use the squared value instead while under overflow conditions.).

#rust #learning #generics

🪑Dr Rockstar ♫ajaxStardust@vivaldi.net
2024-10-28

The takeaway? Note the Dr's replies (dates between my outgoing). You are correct. There are none.

If nothing else, maybe BOOST it?

This is my attempt to communicate important life changing information to my primary care physician, of the Geisinger Family Health Network, in State College, Pennsylvania, 16803. In JULY 2024.
I'm still waiting for his reply.

#Lyrica #Pregabalin #Gabapentin
#Civilrights #CivilProtection #medicalmalpractice
#FBI #Fraud #Pfizer #generics #phamaceutical #pharmacy #braindamage

2024-10-25

SQLAlchemy 2.0 + Python Generic, или как создать универсальный репозиторий для работы с БД

Доброго времени суток, товарищи, эта статья, так скажем, продолжение предыдущей статьи об SQLAlchemy 2.0 для новичков , в этой статье мы узнаем что такое Python Generic и как его можно использовать в наших целях при взаимодействии с БД.

habr.com/ru/articles/853326/

#python #python3 #sqlalchemy_20 #sqlalchemy #generic #generics #типизация #пайтон #дженерики

Anthony Acciolyanthony@accioly.social
2024-10-21

"Small" things that I highly appreciate about Kotlin coming from Java - Chapter 1

Inline functions with reified type parameters:

𝚒𝚗𝚕𝚒𝚗𝚎 𝚏𝚞𝚗 <𝚛𝚎𝚒𝚏𝚒𝚎𝚍 𝚃> 𝚍𝚘𝚂𝚘𝚖𝚎𝚝𝚑𝚒𝚗𝚐(𝚟𝚊𝚕𝚞𝚎: 𝚃)

kotlinlang.org/docs/inline-fun

No more passing classes as parameters. No more super type tokens. It just works.

#Kotlin #Java #JVM #Generics #TypeErasure #Reification #SoftwareDevelopment

The Last Psion | Alexthelastpsion@bitbang.social
2024-09-25

It's getting late and I should go to bed, but I wanted to play with #ctran.

I thought I'd see how much faster it is to convert my `array of TToken` to a `TList<TToken>`.

Turns out, twice as fast!

Basically, when you concat() an array, the entire array is copied every time. With a TList.Add(), it just adds a pointer to the end.

The DOS executable is slightly larger (438KB vs 446KB), but the it's worth it for better efficiency and code readability.

#FreePascal #ObjectPascal #Pascal #generics

Screenshot of DOSBox Staging showing the execution of two versions of CTRAN, both processing the same DEMO.CAT category file. The first is with `array of TToken`, which took 660ms to run. The second is using generics, specifically `TList<TToken>`, which took 330ms to run.
you╭👺+300╭🐈x5╭⁂+3╭(Ⓐ+aunspeaker
2024-09-08

not even kidding about the

github.com/rust-lang/rust/issu dates from 2014

as do my intentions to write this program, come to think of it

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst