Skip to main content


Arrow Core types, such as Either or NonEmptyList, often appear as part of serializable types. We've decided to keep the Core library as slim as possible; in particular we didn't want to depend on particular serialization libraries. As a result, you need a bit of additional ceremony compared to using built-in types, which we discuss in this section.


If you're using kotlinx.serialization, you need to depend on the arrow-core-serialization with the same version of your arrow-core. Declare your serializable types as usual. However, when one of the fields mentions a type from Arrow Core,

data class Book(val title: String, val authors: NonEmptyList<String>)

you need to "import" the serializer into the file. The easiest way is to include a UseSerializers annotation at the very top.


The list above mentions all the serializers, but you only need to add those which are used in your fields. Don't worry too much: if you miss one, the kotlinx.serialization plug-in gives you an error.

Additional reading

Marshalling Arrow Types in Ktor by Garth Gilmour includes additional information about using Arrow Core types in a Ktor project.


If you're using Jackson for serialization, this module adds support for Arrow types. You just need to call an additional method when creating the mapper.

val mapper = ObjectMapper()
.registerArrowModule() // <- this is the one