[Haskell-cafe] Reflection functional dependency as an associated type?

Brandon Moore brandon_m_moore at yahoo.com
Wed Oct 1 22:14:31 UTC 2014


I was trying to make a bridge like this
class MonadStateTF m where   type StateOf m :: *instance (MonadState s m) => MonadStateTF m where  type StateOF m = s

to allow writing constraints on state monads without a dangling type parameter
type NumMonad m = (MonadStateTF m, Num (StateOf m))

Unfortunately, the declaration type StateOF m = s
complains that "s" isn't mentioned on the left hand side rather
than somehow making use of the fundep.

Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141001/fc3679a9/attachment.html>


More information about the Haskell-Cafe mailing list