VY
--repl-optionsSize: a a a
VY
--repl-optionsAP
class Action x a where
send :: (MonadIO m , IsLabel x (r -> TQueue a) , MonadReader r m) => a -> m ()
send act = do
chan <- asks (getField @x)
atomically $ writeTQueue chan act
AP
TChan и разные Action которые я по ним передаюAP
send для всехAP
instance Action "chanFieldName" SomeAction whereAP
MK
MK
AP
library/IDCar/Action.hs:13:3-80: error:
• Could not deduce (Action x0 a)
from the context: (Action x a, MonadIO m,
IsLabel x (r -> TQueue a), MonadReader r m)
bound by the type signature for:
send :: forall (x :: ghc-prim-0.5.3:GHC.Types.Symbol) a (m :: *
-> *) r.
(Action x a, MonadIO m, IsLabel x (r -> TQueue a),
MonadReader r m) =>
a -> m ()
at library/IDCar/Action.hs:13:3-80
The type variable ‘x0’ is ambiguous
• In the ambiguity check for ‘send’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method:
send :: forall (x :: ghc-prim-0.5.3:GHC.Types.Symbol) a (m :: *
-> *) r.
(Action x a, MonadIO m, IsLabel x (r -> TQueue a),
MonadReader r m) =>
a -> m ()
In the class declaration for ‘Action’
|
13 | send :: (MonadIO m , IsLabel x (r -> TQueue a) , MonadReader r m) => a -> m ()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MK
AP
MK
AP
AP
AP
AP
MK
AP
library/IDCar/Action.hs:17:19-29: error:
• Cannot apply expression of type ‘t1’
to a visible type argument ‘x’
• In the first argument of ‘asks’, namely ‘(getField @x)’
In a stmt of a 'do' block: chan <- asks (getField @x)
In the expression:
do chan <- asks (getField @x)
atomically $ writeTQueue chan act
|
17 | chan <- asks (getField @x)
| ^^^^^^^^^^^
MK
AP