28 Sep
2011
28 Sep
'11
11:27 p.m.
Hi - I have a function, "f :: Monad m => a -> m b", as well as a list of a's. I'd like to produce a sequence (Data.Sequence) of b's, given the a's: g :: [a] -> m (Seq b) g a = do Data.Traversable.mapM f a -- type error! I see that "Data.Traversable.mapM f a" doesn't work... is this like asking the compiler to infer the cons/append operation from the type signature of g? Do I need to write my own function that explicitly calls the "append" functions from Data.Sequence or can I do something else that would work for any "g :: Traversable t, Traversable u => t a -> m (u b)" given "f :: a -> m b"? Thanks for any comments! Thomas
5447
Age (days ago)
5447
Last active (days ago)
0 comments
1 participants
participants (1)
-
thomas burt