RE: Yet more on functional dependencies

2001-02-02 Thread Simon Peyton-Jones
| | I am finding functional dependencies confusing. (I suspect I am | | not alone.) Should the following code work? | | | | class HasConverter a b | a - b where | |convert :: a - b | | | | instance (HasConverter a b,Show b) = Show a where | |show value = show (convert value) | |

RE: Yet more on functional dependencies

2001-01-15 Thread Mark P Jones
| I am finding functional dependencies confusing. (I suspect I am | not alone.) Should the following code work? | | class HasConverter a b | a - b where |convert :: a - b | | instance (HasConverter a b,Show b) = Show a where |show value = show (convert value) It's a separate issue.

Re: Yet more on functional dependencies

2001-01-15 Thread Jeffrey R. Lewis
Mark P Jones wrote: | I am finding functional dependencies confusing. (I suspect I am | not alone.) Should the following code work? | | class HasConverter a b | a - b where |convert :: a - b | | instance (HasConverter a b,Show b) = Show a where |show value = show (convert

Yet more on functional dependencies

2001-01-08 Thread George Russell
I am finding functional dependencies confusing. (I suspect I am not alone.) Should the following code work? class HasConverter a b | a - b where convert :: a - b instance (HasConverter a b,Show b) = Show a where show value = show (convert value)

Yet more on functional dependencies

2001-01-08 Thread Tom Pledger
George Russell writes: I am finding functional dependencies confusing. (I suspect I am not alone.) Should the following code work? class HasConverter a b | a - b where convert :: a - b instance (HasConverter a b,Show b) = Show a where show value = show (convert value)