On Tue, 2008-12-30 at 17:12 +0000, ra...@msn.com wrote: 
> Hi, how can I make the following code work? (show all the possible values of 
> a type 'a')
> 
 
> > showAll :: (Eq a, Bounded a, Enum a) => a -> [a]
> > showAll a = [minBound..maxBound]::[a]

The bottom 'a' has nothing to do with the 'a' in the type signature.
Your code is equivalent to
 
> > showAll :: (Eq a, Bounded a, Enum a) => a -> [a]
> > showAll a = [minBound..maxBound]::[b]

Which is not type correct as [minBound..maxBound] :: (Bounded a, Enum a) => [a]
You don't need that type annotation (or the type signature for that matter), so 
just omit it.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to