Sat Apr 20 16:37:36 EDT 2019
Lists and Functor, Traversable, Zip
I'm going to need structured arrays, e.g. matrices of complex numbers,
that will have to flatten down to just lists of things.
Is there a simple way to create a data structure such that it
automatically has Functor, Traversable and Zip?
I've been here before. What is a representable functor?
Not for now. I need to focus on the application.
data C t = C t t deriving (Eq, Show, Functor, Foldable, Traversable)
instance Zip C where zip (C ar ai) (C br bi) = C (ar,br) (ai,bi)
c2 f a b = sequence $ zipWith f a b