[Haskell-cafe] ATs vs FDs

2010-08-14 Thread Andrew Coppin
As I understand it, ATs were invented because FDs are evil and must never be used ever for any purpose. However, it doesn't seem to be possible to use ATs to do the same things that FDs can do. You can use ATs to write type functions, which take one type and return another type. This allows

Fwd: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Gábor Lehel
-- Forwarded message -- From: Gábor Lehel illiss...@gmail.com Date: 2010/8/14 Subject: Re: [Haskell-cafe] ATs vs FDs To: Andrew Coppin andrewcop...@btinternet.com You're missing equality constraints for classes. In other words: class (a ~ Smaller (Bigger a), a ~ Bigger (Smaller

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Ivan Lazar Miljenovic
Andrew Coppin andrewcop...@btinternet.com writes: As I understand it, ATs were invented because FDs are evil and must never be used ever for any purpose. However, it doesn't seem to be possible to use ATs to do the same things that FDs can do. You can use ATs to write type functions, which

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Andrew Coppin
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

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Stephen Tetley
On 14 August 2010 11:19, Andrew Coppin andrewcop...@btinternet.com wrote: As I understand it, ATs were invented because FDs are evil and must never be used ever for any purpose. However, it doesn't seem to be possible to use ATs to do the same things that FDs can do. You might want to read

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Ivan Lazar Miljenovic
Andrew Coppin andrewcop...@btinternet.com writes: 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

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Andrew Coppin
Andrew Coppin wrote: Ivan Lazar Miljenovic wrote: 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

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Antoine Latter
What's wrong with fun-deps? The associated type synonym syntax is prettier, but I didn't tknow that fun-deps were evil. Do you have any links? Take care, Antoine On Aug 14, 2010 5:19 AM, Andrew Coppin andrewcop...@btinternet.com wrote: As I understand it, ATs were invented because FDs are evil

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Gábor Lehel
I think that was exaggeration for effect. FDs aren't evil, but TFs do the same thing in a nicer way, and there's a long-term effort to move over from one to the other, and ideally get TFs into Haskell' at some point. But there's no problem with using FDs if you need them or just like them better.

Re: [Haskell-cafe] ATs vs FDs

2010-08-14 Thread Alexander Solla
On Aug 14, 2010, at 9:01 AM, Antoine Latter wrote: What's wrong with fun-deps? The associated type synonym syntax is prettier, but I didn't tknow that fun-deps were evil. Do you have any links? They're not evil, they are tricky and can lead to non-termination, inconsistency, etc.