You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cancelMany :: [Async a] -> IO () is ... okay, but it's annoying when cancelling Asyncs with multiple types. Some options:
-- Not very nice. Allocates wrappers unnecessarily.dataSomeAsync=foralla.SomeAsync!(Asynca)
cancelSomeAsyncs:: [SomeAsync] ->IO()-- Is a `some` dependency okay, or copying stuff from there?cancelSomeAsyncs:: [SomeAsync] ->IO()-- Potentially expensive if there's a lot of `fmap`ping and not a lot of inlining.
cancelAsyncs [()<$ thisOne, ()<$ thatOne]
-- Can we make <$ cheaper? Yes, but it makes `Async` bigger. Any we need-- to unsafeCoerce with Any to allow Async to unbox (ugh).dataAsynca=Async!ThreadId!(TMVar (EitherSomeExceptionAny)) (Any->a)
a <$Async tid mv fun =Async tid mv (const a)
Activity
treeowl commentedon Mar 3, 2023
Oh yeah, there's also the
HListy option:But a custom heterogeneous list type doesn't seem appropriate for this package.