Using the stack with lts-9.2 (and singletons-2.1), I have this:
$(singletons [d|
data EventScans
= PassThrough
| SuiteProgress
-- cn :: EventScans -> [Char]
cn PassThrough = "all-events"
cn SuiteProgress = "suite-progress"
|])
I cannot assign a type signature to this function, and a signature of type inferred - cn :: IsString t => EventScans -> t
. AFAIK IsString
does not stand out.
Without a type signature on, cn
I get a type family cn
, as expected. If I try to add a type signature, I get:
* Expected kind `[Char]', but `"all-events"' has kind `Symbol'
* In the type `"all-events"'
In the type family declaration for `Cn' (haskell-stack-ghc)
What is the right way to do this?
edit If I try to enable a type signature cn :: IsString t => EventScans -> t
, I get the following error:
Variable `a_agPb' used as both a kind and a type
Did you intend to use TypeInType? (haskell-stack-ghc)
Not in scope: type constructor or class `SIsString'
Perhaps you meant `IsString' (imported from Data.String) (haskell-stack-ghc)
source
share