Skip to content

Instantly share code, notes, and snippets.

@mxswd
Created January 6, 2014 10:38
Show Gist options
  • Save mxswd/8280964 to your computer and use it in GitHub Desktop.
Save mxswd/8280964 to your computer and use it in GitHub Desktop.
{-# 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