[Haskell-cafe] netwire example error message
joachifm at fastmail.fm
joachifm at fastmail.fm
Sun Mar 22 06:15:09 UTC 2015
On Sun, Mar 22, 2015, at 05:57 AM, briand at aracnet.com wrote:
> The error message:
>
> time.hs:13:8:
> No instance for (Show e0) arising from a use of ‘testWire’
> The type variable ‘e0’ is ambiguous
> Note: there are several potential instances:
> instance Show Double -- Defined in ‘GHC.Float’
> instance Show Float -- Defined in ‘GHC.Float’
> instance (Integral a, Show a) => Show (GHC.Real.Ratio a)
> -- Defined in ‘GHC.Real’
> ...plus 45 others
> In the expression: testWire clockSession_ pos
> In an equation for ‘main’: main = testWire clockSession_ pos
> Failed, modules loaded: none.
The problem is that `testWire` wants to print the inhibition value but
has no way of choosing which `Show` instance to use, because the type of
`e` is left unspecified in your snippet. This is obvious if you look at
the constraints on `testWire`, but not so obvious from the error
message. The solution is to fix the inhibition type to `()` (or
whatever).
More information about the Haskell-Cafe
mailing list