
Hello, I have a ByteString -> [ByteString] -> ByteString situation, i.e. concatenation ..... -- marshall into ByteString representation join (encode (buildHeader ss)) -- ByteString (map encode (buildEntries (sequenceListExtract ss))) -- [ByteString] I get the following typecheck error which is vexing me .... Couldn't match expected type `t -> t -> B.ByteString' against inferred type `B.ByteString' ??? Thanks, Vasili

Hello,
Using a strongly-typed language so should just have to check "domain"
and "co-domain" of functions?
Vasili
On Fri, Dec 26, 2008 at 11:13 PM, Galchin, Vasili
Hello,
I have a ByteString -> [ByteString] -> ByteString situation, i.e. concatenation .....
-- marshall into ByteString representation join (encode (buildHeader ss)) -- ByteString (map encode (buildEntries (sequenceListExtract ss))) -- [ByteString]
I get the following typecheck error which is vexing me ....
Couldn't match expected type `t -> t -> B.ByteString' against inferred type `B.ByteString'
???
Thanks, Vasili

2008/12/26 Galchin, Vasili
Hello,
I have a ByteString -> [ByteString] -> ByteString situation, i.e. concatenation .....
-- marshall into ByteString representation join (encode (buildHeader ss)) -- ByteString (map encode (buildEntries (sequenceListExtract ss))) -- [ByteString]
I get the following typecheck error which is vexing me ....
Couldn't match expected type `t -> t -> B.ByteString' against inferred type `B.ByteString'
???
join is not a function in Data.ByteString. By the error I'm guessing you're getting the join from Control.Monad, instantiated to (->). You are looking for "concat"; i.e. concat $ encode (buildHeader ss) : -- ByteString map encode (buildEntries (sequenceListExtract ss)) -- [ByteString] (Control.Monad.join does end up meaning"concat" when working on lists of lists, but it does not generalize to lists of other things). Luke

Hi Luke,
joinhttp://cvs.haskell.org/Hugs/pages/libraries/base/Data-ByteString.html#v%3Ajo...::
ByteStringhttp://cvs.haskell.org/Hugs/pages/libraries/base/Data-ByteString.html#t%3ABy...->
[
ByteStringhttp://cvs.haskell.org/Hugs/pages/libraries/base/Data-ByteString.html#t%3ABy...]
-> ByteStringhttp://cvs.haskell.org/Hugs/pages/libraries/base/Data-ByteString.html#t%3ABy...???
Vasili
On Sat, Dec 27, 2008 at 1:58 AM, Luke Palmer
2008/12/26 Galchin, Vasili
Hello,
I have a ByteString -> [ByteString] -> ByteString situation, i.e. concatenation .....
-- marshall into ByteString representation join (encode (buildHeader ss)) -- ByteString (map encode (buildEntries (sequenceListExtract ss))) -- [ByteString]
I get the following typecheck error which is vexing me ....
Couldn't match expected type `t -> t -> B.ByteString' against inferred type `B.ByteString'
???
join is not a function in Data.ByteString. By the error I'm guessing you're getting the join from Control.Monad, instantiated to (->).
You are looking for "concat"; i.e.
concat $ encode (buildHeader ss) : -- ByteString map encode (buildEntries (sequenceListExtract ss)) -- [ByteString]
(Control.Monad.join does end up meaning"concat" when working on lists of lists, but it does not generalize to lists of other things).
Luke
participants (2)
-
Galchin, Vasili
-
Luke Palmer