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
-- 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
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
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
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
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
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
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
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.
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.
10 matches
Mail list logo