Skip to content

Instantly share code, notes, and snippets.

@kosmikus
Created April 28, 2017 17:17
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 kosmikus/33a1a7daa7f9dc8c51425e784d1c3063 to your computer and use it in GitHub Desktop.
Save kosmikus/33a1a7daa7f9dc8c51425e784d1c3063 to your computer and use it in GitHub Desktop.
instance {-# OVERLAPPING #-} (Validatable' r, KnownSymbol s) => Validatable' (MetaX s r) where
form' = M1 <$> (fieldName DIG..: form')
where
fieldName = pack $ symbolVal (Proxy :: Proxy s)
instance {-# OVERLAPPABLE #-} (Validatable' r) => Validatable' (M1 i a r) where
form' = M1 <$> form'
instance (Validatable' r, Validatable' s) => Validatable' (r :*: s) where
form' = (:*:) <$> form' <*> form'
-- all other instances as before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment