You have two choices (other people have enumerated the first while I
was typing):

First choice:

Wrap your Stringlist with a newtype:

newtype StringList = StringList [String]

The downside of this your code gets "polluted" with the newtype.

Second choice:

Write special putStringList and getStringList functions. Hand-code the
binary instances where you are wanting [String] to be special and call
putStringList and getStringList rather than put and get.

Downside - cannot automatically derive Binary. That's if Binary can be
automatically derived anyway?, the times when I need Binary I write
the instances myself anyway.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to