Skip to content

Instantly share code, notes, and snippets.

@tanakh
Created June 30, 2012 09:52
Show Gist options
  • Select an option

  • Save tanakh/3023194 to your computer and use it in GitHub Desktop.

Select an option

Save tanakh/3023194 to your computer and use it in GitHub Desktop.
type family conflict
class RpcMethodType f where
type BaseM f :: * -> *
toRpcMethod :: f -> RpcMethod (BaseM f)
instance (Functor m, MonadIO m, OBJECT o) => RpcMethodType (m o) where
type BaseM (m o) = m
toRpcMethod m = \[] -> toObject <$> m
instance (OBJECT o, RpcMethodType r) => RpcMethodType (o -> r) where
type BaseM (o -> r) = BaseM r
toRpcMethod f = \(x:xs) -> toRpcMethod (f $! fromObject' x) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment