Re: [Haskell-cafe] class Bytestringable or ToBytestring

2012-11-24 Thread Vincent Hanquez
On 11/23/2012 08:19 AM, Silvio Frischknecht wrote: i recently found the convertible package Thanks. quite a cool package, I'll probably use it in the future for some of my programs. Not sure that's appropriate for my cases unfortunately. -- Vincent

Re: [Haskell-cafe] class Bytestringable or ToBytestring

2012-11-23 Thread Silvio Frischknecht
i recently found the convertible package http://hackage.haskell.org/packages/archive/convertible/1.0.11.1/doc/html/Data- Convertible-Base.html convert :: Convertible a b = a - b I've only used it once but it looks good to me. sure the type checker does not guartantee that you get a ByteString

[Haskell-cafe] class Bytestringable or ToBytestring

2012-11-22 Thread Vincent Hanquez
Hi cafe, I've been adding lots of types recently that looks more or less like: newtype A = A ByteString data B = B ByteString This is great for extra type safety and letting the compiler do its job, however getting the bytestring back requires boiler plate. At the moment either you

Re: [Haskell-cafe] class Bytestringable or ToBytestring

2012-11-22 Thread kudah
Why not use http://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html instead? On Thu, 22 Nov 2012 14:15:00 + Vincent Hanquez t...@snarc.org wrote: Hi cafe, I've been adding lots of types recently that looks more or less like: newtype A = A

Re: [Haskell-cafe] class Bytestringable or ToBytestring

2012-11-22 Thread Vincent Hanquez
On 11/22/2012 03:42 PM, kudah wrote: Why not use http://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html instead? interesting i didn't know about it, however it's seems relatively unknown (can't find any library on hackage that use it) and just like Serialize

Re: [Haskell-cafe] class Bytestringable or ToBytestring

2012-11-22 Thread kudah
On Thu, 22 Nov 2012 21:14:31 + Vincent Hanquez t...@snarc.org wrote: can't find any library on hackage that use it http://packdeps.haskellers.com/reverse/newtype ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org