POV-Ray : Newsgroups : povray.off-topic : Try Haskell : Re: Try Haskell Server Time
4 Sep 2024 19:21:09 EDT (-0400)
  Re: Try Haskell  
From: Invisible
Date: 4 Mar 2010 10:44:28
Message: <4b8fd55c$1@news.povray.org>
scott wrote:
>>   data Suit = Diamonds | Hearts | Clubs | Spades
>>
>>   data Number =
>>     Ace | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten |
>>     Jack | Queen | King
>>
>>   data Card = Card Suit Number
> 
> I get "parse error on input 'data'" for all those.
> 
> Guess I'm missing some #include or whatever it's called.

Which way are you trying to execute this?

If you're trying to enter them interactively, don't. It doesn't work. ;-)

The GHC interactive interpretter ("GHCi") allows you to define variables 
and use them later, but doesn't allow any other kinds of definitions 
interactively.

If you write this stuff in a file and save it as, say, "Cards.hs", you 
should be able to double-click that file and have GHCi automatically 
open up and load it. You can then write expressions involving these types.

(Probably the next problem you'll trip over is that the types aren't 
printable...)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.