[Haskell-cafe] How to fix ambiguous type variable?

Sandeep.C.R sandeep at sras.me
Thu Jun 13 05:45:23 UTC 2019


This seems to work for me...


someCheck :: forall a . (Show a, Read a, Eq a) => String -> a -> Bool

someCheck s v = (read . show . (read :: String -> a) $ s) == v


Probably requires 'ScopedTypeVariables'...


On 13/06/19 11:06 AM, Boris wrote:
> someCheck :: (Show a, Read a, Eq a) => String -> a -> Bool
> someCheck s v = (read . show . read $ s) == v


More information about the Haskell-Cafe mailing list