Skip to content

Instantly share code, notes, and snippets.

@evancz
Created March 27, 2014 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evancz/9796849 to your computer and use it in GitHub Desktop.
Save evancz/9796849 to your computer and use it in GitHub Desktop.
type Point3D = { x : Float, y : Float, z : Maybe Float }
deriving Json, New, Binary
-- Resulting in the folliwing derived values:
Point3D.Json.encode : Point3D -> String
Point3D.Json.decode : String -> Maybe Point3D
Point3D.New : Float -> Float -> Maybe Float -> Point3D
Point3D.Binary.encode : Point3D -> Bits
Point3D.Binary.decode : Bits -> Maybe Point3D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment