[Haskell-beginners] (no subject)

Brandon Allbery allbery.b at gmail.com
Thu Mar 28 23:38:41 CET 2013


On Thu, Mar 28, 2013 at 6:34 PM, Jamie F Olson <jamie.f.olson at gmail.com>wrote:

> Would it have been legal to define data JSValue as something like this
> instead?
>
> data JSValue
>     = JSValue
>     | JSValue     !Bool
>     | JSValue !Rational
>     | JSValue   JSString
>     | JSValue    [JSValue]
>     | JSValue   (JSObject JSValue)


No; the data constructor used tells it what to expect afterward.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130328/4258f873/attachment.htm>


More information about the Beginners mailing list