I have a newtype
I'd like to save in a file, something like this:
type Index = (Int, Int)
newtype Board a = Board { unboard :: Array Index a }
So basically an Array
. But maybe I want to add some other data one day like this:
data BoardWithInfo a = BWI {
bwiBoard :: Board a,
bwiRef :: String,
bwiStart :: Index
}
And so on. I just want to know, are there any convenient, optimised functions to do this, Array
to ByteString
and combined data - and the other way around. Or how to write my own, if there are not.