servant VS polysemy

Compare servant vs polysemy and see what are their differences.

servant

Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more! (by haskell-servant)

polysemy

:gemini: higher-order, no-boilerplate monads (by polysemy-research)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
servant polysemy
16 7
1,768 1,023
0.4% 0.5%
7.5 5.5
3 days ago about 1 month ago
Haskell Haskell
BSD 3-clause "New" or "Revised" License BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

servant

Posts with mentions or reviews of servant. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-10-07.
  • An alternative front end for Haskell?
    3 projects | news.ycombinator.com | 7 Oct 2023
    > do you really have to understand language extensions?

    You do when your code doesn't compile and you're trying to figure out what the error message means, or when the library you want to use makes heavy use of it for even basic functionality.

    > These days one just enables GHC2021

    My experience was pre-GHC2021. I basically had to enable at a minimum 5-6 language extensions in every single file.

    > Mostly they're just about removing unnecessary restrictions from the older standard.

    Yeah, those ones are usually fine. I have zero objection to things like FlexibleInstances or DeriveFoldable.

    > Could you give an example?

    I believe I was trying to implement Central Authentication Service using Servant. However, that required returning a custom HTTP status code. There has been an open Github issue for this since 2017, but it seems to require basically rewriting the entire framework: https://github.com/haskell-servant/servant/issues/732

    Looking back at it now Servant does have "ServerError", but that basically requires giving up all the advantages Servant claims to have and I believe it was not a viable option at the time. Looking at the timeline I was probably also on Servant 0.15, and there seems to have been a rewrite since then.

    I vaguely recall running into a similar issue trying to interact with a database, but I can't remember the details of that.

  • Question: Servant with NamedRoutes and Swagger
    1 project | /r/haskell | 25 Nov 2022
    a HasSwagger instance for NamedRoutes was added in May 2022 (in this commit) but there hasn't been a package release since March
  • Monthly Hask Anything (November 2022)
    3 projects | /r/haskell | 1 Nov 2022
    If you don't like this style, the usual alternative is to change mkDualAuthHandler to take two additional arguments, Proxy tag0 and Proxy tag1 (as e.g. lots of Servant functions do, for historical reasons).
  • How introduce `ResourceT` into my stack
    3 projects | /r/haskell | 14 Oct 2022
    Dunno if this is helpful, but I found this github issue about ResourceT and servant https://github.com/haskell-servant/servant/issues/1345
  • Introduction to Doctests in Haskell
    6 projects | /r/haskell | 19 Apr 2022
    And what about the cabal repl --with-compiler=doctest, which was added recently, in doctest v0.20? I recently submitted a PR for Servant to use this in place of GHC environment files, because it seems less finicky to me. Was this a bad idea?
  • Generate Typescript from Servant API
    5 projects | /r/haskell | 15 Mar 2022
    I asked a somewhat relevant question recently. Maybe you'll find this discussion somewhat helpful: https://github.com/haskell-servant/servant/issues/1547; two packages were talked about. One of the folks from Well Typed replied, and said they tried it recently (and worked fine).
  • Named Routes in Servant
    3 projects | /r/haskell | 9 Mar 2022
  • [ANN] Servant 0.19 release
    1 project | /r/haskell | 2 Feb 2022
    You are highly encouraged to test this release out and let us know what you think ! For bug reports, features requests or any kind of feedback, just open a ticket on our issue tracker.
  • [Servant] Best practices to not mixup routes with same signatures.
    1 project | /r/haskell | 5 Aug 2021
    Even slower than :<|> quadratic compile time in number of routes?
  • Help with servant-client
    1 project | /r/haskell | 30 Apr 2021
    Check this out https://github.com/haskell-servant/servant/issues/335#issuecomment-172300487

polysemy

Posts with mentions or reviews of polysemy. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-02.
  • Functional Declarative Design: A Comprehensive Methodology for Statically-Typed Functional Programming Languages
    4 projects | /r/haskell | 2 Jun 2023
    Thirdly, composing arbitrary effects without losing state is really, really difficult. Things are fine when you limit yourself to State and Reader, sure, but once you start with nondeterminism you’ll discover it’s shockingly easy to produce behaviors that are baffling unless you’ve spent a preposterous amount of time thinking about this stuff. (I’ve been bitten in prod by silent state-dropping bugs, and rarely have I been more flummoxed.) Consider this example, which produces silent changes in the semantics of <|> depending on whether you use it inside or outside of a higher-order effect. Every single effect library (besides the still-unreleased eff) gets certain combinations of effects + nondeterminism wrong. You could make the argument that most people don’t use nondeterministic monads, but eDSLs really shine when you have access to them, as you can turn a concrete interpreter to an abstract one fairly easily.
  • Introduction to Doctests in Haskell
    6 projects | /r/haskell | 19 Apr 2022
    Looking for a few projects that make use of it, I found accelerate, hawk, polysemy and pretty-simple, so I'll be interested to poke around in their code and see how they have things set up.
  • ReaderT pattern is just extensible effects
    2 projects | /r/haskell | 3 Feb 2022
    Right, I think I'll just give it a shot to see. Polysemy is nice but I'm still having trouble getting what I want out of it (which may very well be entirely a fault of my own understanding)
  • Where's more discussion of the designs of effect systems?
    4 projects | /r/ProgrammingLanguages | 17 Nov 2021
    Languages such as Koka only support algebraic effects, not scoping operations such as catch and listen. The Effect Handlers in Scope paper introduces scoping operations, which lead to the Haskell libraries fused-effects and polysemy, but they turned out to have some weird semantics. eff is her effort to fix that.
  • Monthly Hask Anything (June 2021)
    16 projects | /r/haskell | 2 Jun 2021
  • Trouble Reinterpreting Higher Order Effects in PolySemy
    1 project | /r/haskell | 23 Apr 2021
    Looking at the interpreter for Reader might give some clues if this doesn't work. https://github.com/polysemy-research/polysemy/blob/master/src/Polysemy/Reader.hs#L38-L45
  • Structuring Code with ZIO &amp; ZLayers
    3 projects | /r/scala | 3 Mar 2021
    *But I'm not terribly well versed in Scala's other DI offerings. I came from Haskell and didn't find anything in Scala that clicked with me until I found ZIO. It reminded me a lot of my favorite way of writing Haskell programs (https://github.com/polysemy-research/polysemy)—albeit with a completely different implementation.

What are some alternatives?

When comparing servant and polysemy you can also consider the following projects:

servant-ts - See the docs and live playground here

fused-effects - A fast, flexible, fused effect system for Haskell

graphql - Haskell GraphQL implementation

purescript - A strongly-typed language that compiles to JavaScript

loli

freer-simple - A friendly effect system for Haskell

swagger-petstore - swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.

ast-monad - A library for constructing AST by using do-notation

gc-monitoring-wai - a wai application to show `GHC.Stats.GCStats`

Exercism - Scala Exercises - Crowd-sourced code mentorship. Practice having thoughtful conversations about code.

servant-blaze

ghc - Mirror of the Glasgow Haskell Compiler. Please submit issues and patches to GHC's Gitlab instance (https://gitlab.haskell.org/ghc/ghc). First time contributors are encouraged to get started with the newcomers info (https://gitlab.haskell.org/ghc/ghc/wikis/contributing).