[GHC] #16027: Cannot use DefaultSignatures for TypeFamiles
GHC
ghc-devs at haskell.org
Mon Dec 10 11:47:33 UTC 2018
#16027: Cannot use DefaultSignatures for TypeFamiles
-------------------------------------+-------------------------------------
Reporter: Ericson2314 | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: 8.6.3
Component: Compiler | Version: 8.6.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
Until constrained type families are implemented (which likely won't be for
a good while), you can do this:
{{{#!hs
class Monad m => MyMonad m where
type AssociatedMonad m :: Type -> Type
type AssociatedMonad m = DefaultAssociatedMonad m
fun :: Foo -> m ()
default fun :: (m ~ t m', MonadTrans t, MyMonad m') => Foo -> m ()
fun = lift . fun
type family DefaultAssociatedMonad (m :: Type -> Type) :: Type -> Type
where
DefaultAssociatedMonad (t m') = t (AssociatedMonad m')
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16027#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list