ekmett / zippers

Zippers based on lenses and traversals
Other
38 stars 14 forks source link

Add possibility to serialize zippers using binary #8

Open wdanilo opened 9 years ago

wdanilo commented 9 years ago

Hello! Would it be possible somehow to serialize zippers using binary? In particular I would like the following code to compile:

{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE TemplateHaskell #-}

import Control.Lens
import Control.Zipper
import Data.Binary
import GHC.Generics (Generic)

data A = A { _x :: A }
       | AEnd
       deriving (Generic)

instance Binary A

makeLenses ''A

main = do
    let z = zipper (A AEnd)
    return ()

Or would it be simply impossible?