Existential type... problem...

John Meacham john at repetae.net
Tue Jul 27 20:17:29 EDT 2004


On Tue, Jul 27, 2004 at 07:48:01PM -0400, Scott West wrote:
> Hello all,
> 	Just got an interesting error, which I can't really understand (but that DOES happen a lot...). Trying to work with existention types, record types, and wrapping the whole thing up in a nice IORef for my uses:
> 
> data ETable = forall a. EditableTable a => ETable a
> 
> data GuiRecord = GuiRecord
>      {gtable :: ETable,
>      moz :: MozEmbed,
>      pos :: Position,
>      ent :: Entry}
> 
> type GuiState = IORef (GuiRecord)
> 
> Generates the following error:
>     Couldn't match `* -> Type bx' against `*'
>     In the type synonym declaration for `GuiState'
> 
> Anyone have any ideas?? Thanks in advance!

I wried the following, and didn't get an error:

data ETable = forall a. Eq a => ETable a

data GuiRecord = GuiRecord
     {gtable :: ETable,
     moz ::(),
     pos :: (),
     ent :: ()}

type GuiState = IORef (GuiRecord)          

are you sure 
EditableTable, MozEmbed, Position, and Entry don't take type arguments?
because that would explain the error message (but it is odd that it is
being reported at the type declaration)
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 


More information about the Glasgow-haskell-users mailing list