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

How to do it...

  1. Create a new project called custom-datatype with the simple stack template:
        stack new custom-datatype simple
  1. Add dependencies on the persistentpersistent-template, persistent-sqlitetext, and mtl libraries in the build-depends sub-section of the executable section. Also add email-validate as a dependency. We will use it to store grammatically valid email addresses. Also add a Custom module to the other-modules subsection in the same section (you will have to add this subsection). Other-modules represents a set of modules that are part of the compilation but aren't exposed to the user. We will be adding the Custom module for defining a custom data type:
 executable custom-datatype hs-source-dirs: src main-is: Main.hs ...

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