Ticket #6030 (new feature request)
Typeclass constraint should pick the OverloadedString type.
| Reported by: | GregWeber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | _|_ |
| Component: | Compiler | Version: | 7.4.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
{-# LANGUAGE OverloadedStrings #-}
import Data.Text as T
class NoDefault a where noDefault :: a -> Text
instance NoDefault T.Text where noDefault = id
main = print (noDefault "Hello!")
default.hs:7:15:
Ambiguous type variable `a0' in the constraints:
(NoDefault a0) arising from a use of `noDefault'
at default.hs:7:15-23
(Data.String.IsString a0) arising from the literal `"Hello!"'
at default.hs:7:25-32
Probable fix: add a type signature that fixes these type variable(s)
In the first argument of `print', namely `(noDefault "Hello!")'
In the expression: print (noDefault "Hello!")
In an equation for `main': main = print (noDefault "Hello!")
Change History
Note: See
TracTickets for help on using
tickets.
