Created
January 6, 2014 10:38
-
-
Save mxswd/8280964 to your computer and use it in GitHub Desktop.
This file contains 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 DeriveGeneric, DataKinds, KindSignatures #-} | |
import GHC.TypeLits | |
import Data.Text (Text) | |
import GHC.Generics (Generic) | |
data Field (n :: Symbol) v = Field v | |
data Value t = Value t | |
data Banana = Banana | |
{ shape :: Field "banana-shape" (Value Text) | |
, size :: Field "banana size" (Value (Maybe Int)) | |
, name :: Field "banana's name" (Value Text) | |
} deriving (Generic, Show) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment