[Haskell-cafe] ATs vs FDs

Andrew Coppin andrewcoppin at btinternet.com
Sat Aug 14 06:43:04 EDT 2010


Ivan Lazar Miljenovic wrote:
> I assume you mean something like this?
>
> ,---- 
> | class NextOneUpFD this previous | this -> previous where ...
> | 
> | instance NextOneUpFD Vector3 Vector4 where ...
> `----
>   

More like

  class NextPrevFD next prev | next -> prev, prev -> next where...

but yeah, that's the general idea.

> If so, how does this not solve the issue?
>
> ,----
> | class NextOneUpAT v where
> |   type Next v
> |   ...
> | 
> | instance NextOneUpAT Vector3 where
> |   type Next Vector3 = Vector4
> |   ...
> `----
>   

Can I use that to go both up and down? Would the types be unambiguous? I 
guess I'll have to go try it out...



More information about the Haskell-Cafe mailing list