Created
August 24, 2019 08:51
-
-
Save geekingfrog/d41af4f3127362266ce72f575b5c3642 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveAnyClass #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Main where | |
import Data.Valor ( Validatable, Validate ) | |
import Data.Text ( Text ) | |
import Data.Functor.Identity ( Identity (..) ) | |
import Data.Aeson | |
import GHC.Generics | |
data User' a = User | |
{ username :: Validatable a String Text | |
, password :: Validatable a [String] Text | |
} | |
type User = User' Identity | |
deriving instance Show User | |
deriving instance Generic User | |
deriving instance ToJSON User | |
deriving instance FromJSON User | |
type UserError = User' Validate | |
deriving instance Show UserError | |
main :: IO () | |
main = putStrLn "yo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment