O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating custom data types

In the model definition for Persistent, we can use data types such as Int, Text, and Int64. They are translated to proper SQL data types according to the SQL dialect that we are working with. Sometimes, the supported data types are not sufficient for our needs, and we might want to write a custom data type.

In this recipe, we will write a custom data type that represents email.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required