Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-09-01 Thread Sebastian Fischer
does anybody know of anything on Hackage for testing whether two values are approximately equal? http://hackage.haskell.org/package/approximate-equality -- Underestimating the novelty of the future is a time-honored tradition. (D.G.) ___

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-09-01 Thread John Meacham
On Mon, Aug 30, 2010 at 11:24:06PM -0700, strejon wrote: I'm aware of phantom types and the like, but I've been unable to work out how to use them (or another type system extension) to properly track validity on the type level. I'd want something like: validate :: Certificate Possibly_Valid

[Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread strejon
Hello. I'm using Haskell to write a specification for some software. The software uses certificates (standard X.509 certificates) and stores user name information in the Subject's CommonName field. The X.509 standard doesn't actually require the presence of a CommonName field so the contents of

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Chris Eidhof
On 31 aug 2010, at 08:24, strejon wrote: Hello. I'm using Haskell to write a specification for some software. The software uses certificates (standard X.509 certificates) and stores user name information in the Subject's CommonName field. The X.509 standard doesn't actually require the

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Erik Hesselink
On Tue, Aug 31, 2010 at 08:24, strejon strej...@yahoo.com wrote: Hello. I'm using Haskell to write a specification for some software. The software uses certificates (standard X.509 certificates) and stores user name information in the Subject's CommonName field. The X.509 standard doesn't

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread strejon
Erik Hesselink wrote: If you want to use types instead of modules and hiding as Chris suggested, you can use a type index like this: {-# LANGUAGE EmptyDataDecls, GADTs, KindSignatures #-} data Nothing data Just a data Subject :: * - * where NoName :: Subject Nothing Name ::

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Luke Palmer
I have a description of the design pattern you need, appropriately named: http://lukepalmer.wordpress.com/2009/03/24/certificate-design-pattern/ On Tue, Aug 31, 2010 at 12:24 AM, strejon strej...@yahoo.com wrote: Hello. I'm using Haskell to write a specification for some software. The software

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Andrew Coppin
Luke Palmer wrote: I have a description of the design pattern you need, appropriately named: http://lukepalmer.wordpress.com/2009/03/24/certificate-design-pattern/ Mmm, I like that. There are two small problems: * In my web browser, some of the code snippets get the right-hand edge

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Vo Minh Thu
2010/8/31 Andrew Coppin andrewcop...@btinternet.com: Luke Palmer wrote: I have a description of the design pattern you need, appropriately named: http://lukepalmer.wordpress.com/2009/03/24/certificate-design-pattern/ Mmm, I like that. There are two small problems: * In my web browser,