- Create a new project called custom-datatype with the simple stack template:
stack new custom-datatype simple
- Add dependencies on the persistent, persistent-template, persistent-sqlite, text, 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 ...