I\'m reading Learn You a Haskell and I\'m wondering why so many things are acting like a list, and nothing in the Prelude is using the native facility of type classes to set
ByteString is not a generic type.
In other languages, there is something like Sequence for all list-like data structures.
I think this works, with correct extensions:
class Seq a b | a -> b where
head :: a -> b
isTail :: a -> Bool
# ([a]) is a sequence of a's
instance Seq [a] a where
head (x:xs) = x
isTail = (== [])
# ByteString is a sequence of chars
instance Seq ByteString Char
Or try this?
type BS a = ByteString
instance List BS