[Haskell-cafe] type class constraints headache

Miguel Mitrofanov miguelimo38 at yandex.ru
Thu Mar 4 01:21:58 EST 2010


Which "a" should it use for "methods"?


On 4 Mar 2010, at 09:07, muneson wrote:

>
> When writing a command-line interface I ran into type class conflicts
> I don't understand. Could anyone explain why ghc 6.10.4 compiles this
>
>> methods :: (Eq a) => [(String, a)]
>> methods =
>>  [ ("method1", undefined )
>>  , ("method2", undefined)
>>  ]
>
>
> but not the following?
>
>> methods :: (Eq a) => [(String, a)]
>> methods =
>>  [ ("method1", undefined )
>>  , ("method2", undefined)
>>  ]
>>
>> enumerateMethodNames :: [String]
>> enumerateMethodNames = map fst methods
>
>
> thanks,
>
> Marcus
>
> --  
> View this message in context: http://old.nabble.com/type-class-constraints-headache-tp27752745p27752745.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at  
> Nabble.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list