[Haskell-cafe] ANNOUNCE: graphviz-2999.0.0.0

Ivan Miljenovic ivan.miljenovic at gmail.com
Sun Jul 19 20:00:33 EDT 2009


2009/7/20 Brandon S. Allbery KF8NH <allbery at ece.cmu.edu>:
> Shouldn't String then be replaced by a sum type?  In fact, as described this
> would subsume the Either as well.
>
>> -- replace Either Bool String: AttrN are the strings, AltValue the bool
>> data upstreamValue = AttrA | AttrB | AltValue

Yes, as I said.  I didn't for a few reasons:

1. I was running out of time and wanted to make a release on the
weekend (I'm heading overseas in just over a week and have a fair few
things to do before then).  In future, this will probably be improved.

2. I forgot to replace those ones with the custom constructors :s
Though IIRC, most of those that still have Either are those which
probably aren't likely to be used, etc.

Note also that (and this is also a problem with using Either) I have
to think of a way to parse the values with a possible Bool field
properly, since if a Bool is a valid value then just the attribute
name is equivalent to name = true.  At the moment, most attributes use
a parseField function (that consumes the attribute name, the equals
sign and then parses and returns the result) but those with just Bool
attributes use a slight variant where if there is no equals sign, then
True is returned.  This will obviously not work too well with sum
types :s.

>
> --
> brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
> system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
> electrical and computer engineering, carnegie mellon university    KF8NH
>
>
>



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
Pablo Picasso  - "Computers are useless. They can only give you
answers." - http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html


More information about the Haskell-Cafe mailing list