Re: Time Library

2006-03-21 Thread Taral
On 3/20/06, Ashley Yakeley [EMAIL PROTECTED] wrote:
 Never as far as I can imagine. The 'a' parameter will be taken by a
 phantom type.
 http://haskell.org/haskellwiki/Phantom_type

Now I don't recall, but is it allowed to do:

data HasResolution a = Fixed a = ...?

--
Taral [EMAIL PROTECTED]
You can't prove anything.
-- Gödel's Incompetence Theorem
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime


Re: Time Library

2006-03-21 Thread Ashley Yakeley

Taral wrote:


Now I don't recall, but is it allowed to do:

data HasResolution a = Fixed a = ...?


Not usefully.

 data T a = MkT a
 data C a = T a = MkT a

It's allowed, but it doesn't do what you probably want. All it does is 
change the type of the constructor MkT.


If the parameter a to Fixed is free, we don't particularly want to 
hide away the HasResolution constraint on it somehow. Of course, once 
it's specialised as a particular type (e.g. Fixed E12), then it's not 
needed anymore.


--
Ashley Yakeley, Seattle WA
WWED? http://www.cs.utexas.edu/users/EWD/

___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime


Re: Time Library

2006-03-21 Thread Taral
On 3/21/06, Ashley Yakeley [EMAIL PROTECTED] wrote:
 Not usefully.

   data T a = MkT a
   data C a = T a = MkT a

 It's allowed, but it doesn't do what you probably want. All it does is
 change the type of the constructor MkT.

I think it also allows the inference of HasResolution a from Fixed a,
thus removing the HasResolution condition on your instances.

--
Taral [EMAIL PROTECTED]
You can't prove anything.
-- Gödel's Incompetence Theorem
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime


Re: Time Library

2006-03-19 Thread Taral
On 3/19/06, Ashley Yakeley [EMAIL PROTECTED] wrote:
 1. Adding my Data.Fixed module to the base package.
   http://semantic.org/TimeLib/doc/html/Data-Fixed.html
   http://darcs.haskell.org/packages/time/fixed/Data/Fixed.hs

When would you used a (Fixed a) without (HasResolution a)?

--
Taral [EMAIL PROTECTED]
You can't prove anything.
-- Gödel's Incompetence Theorem
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime