Typelevel Blog

typelevel.org · Company blog · on HN since 2013

Typelevel is the Scala community organization behind Cats and Cats Effect, publishing on functional programming in Scala.

What HN saysHN commenters mention Cats Effect as a way to make async code easier to follow in Scala, alongside ZIO, when discussing Scala's strengths.
65HN people shared it
44linked it in comments
34stories submitted
501story points
7 months agolast shared
2013people per year2026

Most-shared posts

  1. 1
    Typelevel.scala – powerful libraries for Scala
    8 people · 1 points · first shared 2013 · discussion on HN
  2. 2
    Cats
    8 people · first shared 2016
  3. 3
    Cats effect
    5 people · first shared 2020
  4. 4
    Typelevel Scala and the future of the Scala ecosystem
    3 people · 169 points · first shared 2014 · 76 comments on HN
  5. 5
  6. 6
    Concurrency Basics
    3 people · 13 points · first shared 2018 · 1 comments on HN
  7. 7
    Scala Cats hits 1.0
    3 people · 6 points · first shared 2017 · discussion on HN
  8. 8
  9. 9
    Why is ADT pattern matching allowed?
    2 people · 6 points · first shared 2014 · discussion on HN
  10. 10
    There are at least three types of strings
    2 people · 2 points · first shared 2017 · discussion on HN
  11. 11
    Why Are Fibers Fast?
    2 people · 2 points · first shared 2021 · discussion on HN
  12. 12
    Scala Compiler Phases
    2 people · 1 points · first shared 2018 · discussion on HN
  13. 13
    Scala
    2 people · first shared 2017
  14. 14
    Functor
    2 people · first shared 2019
  15. 15
    Io
    2 people · first shared 2019

What HN people wrote when they linked it

still_grokking · 2022-08-15
Some tips and remarks for starters: Scala is a quite "deep" language as it's very powerful (actually it's one of the most powerful languages out there). That can be "overwhelming" to someone just starting out I guess. But regardless some FUD written here and there on the interwebs Scala is not a complicated language. At least if you don't make it so. Scala was made specifically with the intend to teach people programming. From the ground up. You don't need to understand monads to understand "Hello World", like in Haskell where printing to the console is an "advanced topic" :-). You can't mess up even the most trivial programs with memory leaks and undefined behavior like in C/C++. You can start out with simple, down to earth code without any friction and slowly build up more understanding for more advanced topics as you go. No need to understand "the monkey holding the jungle" and all that at once. This is something in which Scala is more or less similar to Python or JavaScript. Actually it's even more amenable to people learning programming from the ground up than the former 'cause it has a very simple "evaluation by substitution" model of operation by default. Everything is an expression, and immutable at first, with makes reasoning about programs as easy as putting numbers into math or physics formulas; something that most people practiced in school for many years already! To have a smooth start with the language I would recommend having a look at `scala-cli`¹ (for a…
bad_user · 2017-03-02
Kotlin is a cool language, but doesn't do enough to differentiate itself from Java 8. There are real benefits to picking the mainstream / popular option, which includes tons of documentation, forum discussions, books and developers available immediately for it. So when you go against the mainstream, those alternative tools have to be worth it. I think Scala got over the worthiness threshold, by exposing one of the best OOP implementations exposed in a static language, sane generics, higher kinded types and implicits which make it possible to encode type-classes, which led to a community emphasizing on functional programming. I think Kotlin isn't over that threshold. Some people view its thin layer approach to be an advantage. But it either has to evolve in being more than that, or to divorce itself from the JVM, because it is in direct competition with Java 8 otherwise. Evolving to be more than a Java++ goes against its own philosophy. Divorcing itself from the JVM is a work in progress, they also have a Javascript compiler, but the results aren't convincing enough for now. It's a nice language, but personally I like those with a strong community of functional programmers and libraries. If I'll see http://typelevel.org for Kotlin, I might reconsider.
valenterry · 2025-07-29
I'm using JOOQ. Not saying that JOOQ is the greatest library, but all of what you just mentioned works in there without problem. Including CTEs and json stuff. With a library such as SQLx, you can never really factor anything out. Or at least it's very hard and you lose the actual typesafety. I've been there and done that with doobie [https://typelevel.org/doobie/] which is basically the same in green.
sideeffffect · 2022-09-20
I would use Scala. I like FP and Scala comes with some awesome libraries for concurrent/async programming like Cats Effect or ZIO. Good choice for creating modern style micro-services to be run in the cloud (or even macro-services, Scala has a powerful module system, so it's made to handle large codebases). https://typelevel.org/cats-effect/ https://zio.dev/ The language, the community and customs are great. You don't have to worry about nulls, things are immutable by default, domain modelling with ADTs and patter matching is pure joy. The tooling available is from good to great and Scala is big enough that there are good libraries for typical if not vast majority of stuff and Java libs as a reliable fallback.
emptysea · 2021-10-24
Not the parent, but presumably it would allow for fancy monad stuff like Scala's Cats Effects[0] and Zio[1] which can make async programming easier to follow without having to introduce async/await [0]: https://typelevel.org/cats-effect/ [1]: https://zio.dev
clhodapp · 2021-07-19
Admittedly, loom will do much better but cats-effect does try its best within the limitations of the current JVM: https://typelevel.org/cats-effect/docs/2.x/guides/tracing
esarbe · 2021-05-15
Have a look at the typelevel ecosystem of libraries. [0] [0] https://typelevel.org/
tigerlilythecat · 2021-02-06
You are absolutely correct, because there is a great Scala library called "Cats"! https://typelevel.org/cats/
Milner08 · 2020-12-11
Im a Scala fan, so all these will be focused around Scala, but they will teach you about Monad and Category Theory. I would start with http://learnyouahaskell.com - Its Haskell based but it covers them pretty well. Otherwise I use https://typelevel.org/cats/ for Scala daily and they have an _ok_ guide. But the best guide I've found for it was http://eed3si9n.com/herding-cats/
noelwelsh · 2020-03-16
FP libraries have pretty much solved this IMO. You create a value that describes what you want to happen and that description can include cancellation if some condition is met (e.g. it takes too long). There are limitations imposed by the runtime on what you can actually cancel (e.g. I don't believe all OS calls can be interrupted) but beyond that it works as specified. Here's one example of such a library, though without a bit of FP background it probably doesn't make a great deal of sense: https://typelevel.org/cats-effect/typeclasses/concurrent.html
cultus · 2018-12-05
Here's a fantastic set of cartoons explaining concurrency and parallelism: https://typelevel.org/cats-effect/concurrency/basics.html
user1241320 · 2016-02-29
Overall I think this is actually good news for people like typelevel[1]... that is people with a strong passion for Scala, a stronger community approach and a slightly different view than Typesafe/Lightbend. [1]http://typelevel.org/
glibgil · 2013-10-16
The most interesting things in the Scala space are at http://typelevel.org.
jackcviers3 · 2021-06-29
If you restrict yourself using scalafix [1](a linter), scalazzi [2](a linter) or wartremover [3](another linter), you can prevent your code from returning `Any`, `AnyRef`, `Nothing`, or `Unit` and prevent yourself from using `Throw` , partial std lib functions, or `NonUnitStatements` without explicit annotation. This effectively locks you into writing pure code (you can extend the linter to cover other things like not using `Future` or not using Java libs outside of `MonadError` from cats[4]). The linters operate on typed ASTs at compile time, and have plugins for the most popular scala build tools. Coupled with `-XFatalWarnings', you can guarantee that nothing unexpected happens unless you explicitly pop the escape hatch, for the most part. You can still bring in external libraries that haven't been compiled with these safties in place, so you aren't completely safe, but if you use ZIO[5]/Typelevel[6] libraries you can be reasonably assured of referentially transparent code in practice. There are three schools of thought, roughly, in the scala community towards the depth of using the type system and linters to provide guarantees and capabilities, currently: 1) Don't attempt to do this, it makes the barrier to entry to high for Scala juniors. I don't understand this argument - you want to allow runtime footguns you could easily prevent at compile time because the verifiable techniques take time to learn? Why did you even choose to use a typesafe language and pay the…
harveywi · 2016-07-31
Here is a quick shortlist of some type inference issues (some bugs, some enhancements, and some fundamental limitations of the language design) that I run into pretty much daily: 1. (Search for "asInstanceOf"): http://typelevel.org/cats/tut/freemonad.html 2. (Finally fixed and will hopefully be released soon - yay!): https://issues.scala-lang.org/browse/SI-2712 3. https://twitter.com/extempore2/status/430456002392391681 4. http://pchiusano.blogspot.com/2011/05/making-most-of-scalas-extremely-… 5. (Anecdotal): Various pattern matching peculiarities. Compiler bugs: As long as I write code on the happy path and steer clear of scalaz/shapeless/cats, the compiler is pretty well-behaved and I can go months without getting a compiler crash. However, when I add those in and start writing pure functional code with complicated types that hits the intersections of various features (e.g., GADTs, package objects, implicits), I get a few crashes per week related to known bugs. It works pretty well, and I am not trying to complain too much about all the mileage I get out of Scala and the excellent tooling! Just trying to get the most out of it.
merb · 2026-04-08
OneOrMore is more or less an example from the functional world. i.e.: https://hackage.haskell.org/package/oneormore or scala: https://typelevel.org/cats/datatypes/nel.html it's for type purists, because sometimes you want the first element of the list but if you do that you will get T? which is stupid if you know that the list always holds an element, because now you need to have an unnecessary assertion to "fix" the type.
koiueo · 2025-07-14
I think I know what you are talking about. In a typical three-tier enterprise application there's no clear separation of concerns between "services" and DAO/Repo... And this is due to how most persistence libraries are designed: they eagerly execute side-effects, this breaks composability due to poor transaction control, so you end up leaking a lot of your business logic into your supposedly persistence layer. Take a look at Scala's doobie[1]. Any doobie operation returns a `ConnectionIO`, which is only a description of an operation (free monad). With a proper doobie usage the DAO layer is an algebra of possible persistence-related operations, and the service layer implements business logic by combining primitive ConnectionIOs and interpreting them with full control of transaction boundaries. [1] https://typelevel.org/doobie/index.html
TJSomething · 2024-09-12
I've been out of the Scala game for a few years, but I would use a for comprehension with the cats EitherT monad transformer. https://typelevel.org/cats/datatypes/eithert.html def divisionProgramAsync(inputA: String, inputB: String): EitherT[Future, String, Double] = for { a <- EitherT(parseDoubleAsync(inputA)) b <- EitherT(parseDoubleAsync(inputB)) result <- EitherT(divideAsync(a, b)) } yield result
AdieuToLogic · 2024-08-29
A key thing to keep in mind is that the thrush combinator is a fancy name for a simple construct. The semantics it provides is a declarative form of traditional function composition. For example, given the expression: f (g (h (x))) The same can be expressed in languages which support the "|>" infix operator as: h (x) |> g |> f There are other, equivalent, constructs such as the Cats Arrow[0] type class available in Scala, the same Arrow[1] concept available in Haskell, and the `andThen` method commonly available in many modern programming languages. 0 - https://typelevel.org/cats/typeclasses/arrow.html 1 - https://wiki.haskell.org/Arrow_tutorial
crvdgc · 2024-07-24
edit: from OP's comments, the library was already performing the coalescing. There's Discete Interval Encoding Tree (Diet). The basic idea is that, in a BST of intervals, if an insertion fills a hole of two intervals, they get merged into a single node. The paper: https://web.engr.oregonstate.edu/~erwig/diet/ A Scala implementation example: https://typelevel.org/cats-collections/diet.html
cbeach · 2024-04-26
In terms of ecosystem, it reflects well on the leadership of Zio (John De Goes) that he refused to join the cancellation mob on principle: https://twitter.com/jdegoes/status/1783878876726219016 Whereas Typelevel, on the other hand, were only too happy to join the mob, and then to stick the knife in with their own lynching-by-blog post: https://typelevel.org/blog/2021/04/27/community-safety.html Which they still haven't retracted. The legacy of Travis Brown lives on at Typelevel. They're a political organisation masquerading as a technical organisation.
darkr · 2022-09-13
I think this is mainly in reference to John De Goes, founder of the ZIO framework: https://typelevel.org/blog/2019/09/05/jdg.html https://meta.plasm.us/posts/2020/07/25/response-to-john-de-goes/
joeyhage · 2022-08-07
Scala is a difficult language to learn but, once I got past the learning curve, I found it to be enjoyable and powerful. The cats effect [0] framework is a no-brainer for chaining side effects. [0] https://typelevel.org/cats-effect/
Twisol · 2021-09-10
I do think familiarity plays a big role. I find the Haskell syntax much more pleasant than Java, even though I'm perfectly familiar with both. The equivalent signature in Java (if we could abstract over type functions) would be: interface Functor<F<_>> { <A, B> Function<F<A>, F<B>> map(Function<A, B> f); } You'll find very similar in Scala's `cats`, up to some currying and reordering. [0] [0] https://typelevel.org/cats/typeclasses/functor.html
stank345 · 2021-01-06
> Why did they adopt Scala in the first place? I think in the case of Scala many companies became invested in Spark and Scala came along for the ride. Then as time went on, it turned out you could do advanced FP in Scala, despite its warts, with principled libraries like Cats and the Typelevel stack (see https://typelevel.org/cats/). Companies could then use Scala as a "better Java" or squint-and-it's-almost-Haskell. Or like you said they could just ditch Scala and use something less powerful but easier to learn and work with.
rockostrich · 2019-11-04
I think you may have misunderstood their point. They're just saying that specifying `Functor` in the return type of `map` isn't enough to resolve the issue because you could still have a case of `List#map` returning a `Maybe` or `Either` since they are all implementations of `Functor`. This gets handle by the Cats library in Scala (https://typelevel.org/cats/typeclasses/functor.html) by defining the type class the functor is being defined for as an abstract type on the functor itself.
melling · 2019-09-08
Scala seems to be chugging along. Twitter still uses it heavily. I recently watched a few Scala Days 2019 videos: https://www.youtube.com/channel/UCOHg8YCiyMVRRxb3mJT_0Mg It seems to have a healthy community. 3.0 comes out next year. If you want a functional gateway drug, Scala appears to be the answer: https://typelevel.org/cats/
acjohnson55 · 2019-01-13
I read about this concept before, I think here: https://typelevel.org/blog/2016/09/19/variance-phantom.html
hugofirth · 2018-09-07
If you enjoyed this then there is at least a passable chance you'll be interested in the scala library cats-effect, which just 1.0 and has a nice toolkit of concurrency primitives, which are well documented. https://typelevel.org/cats-effect/concurrency/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close