[Haskell-cafe] basic field questions

Alex Queiroz asandroq at gmail.com
Wed Jan 24 06:27:08 EST 2007


Hallo,

On 1/24/07, jamin1001 <jamin1001 at yahoo.com> wrote:
>
> So then how should this be done?  What if I want to do something like
>
> data Chair = Chair {pos:: Int, color :: Int}
> data Table = Table {pos:: Int, color :: Int}
>

    data Chair = Chair { chairPos :: Int, chairColor :: Int }

>
> Also, could someone tell me why this doesn't compile in GHC:
>
> data Test = A {a::Int} | B {a::Int, b::Int}
> data Test2 = C {c::A}
>

     'A' is not a type, is a constructor for type 'Test'.

-- 
-alex
http://www.ventonegro.org/


More information about the Haskell-Cafe mailing list