How to provide explicit type declarations for functions when using GHCi?

Is there a way provide type declarations in GHCi? let numUniques’ :: (Eq a) => [a] -> Int; numUniques’ = length . nub Or is there another way to define functions like these which doesn’t require type declarations? If you turn off the monomorphism restriction with -XNoMonomorphismRestriction, it will infer the right type.

Why does ghci desugar type lists and type families? Can this be selectively disabled?

The workaround that I know of is using :kind. For instance, ghci> :kind (Container ‘[String,String,String,String,String]) Gives: ( Container ‘[String,String,String,String,String]) :: * While ghci> :kind! (Container ‘[String,String,String,String,String]) Will print something like this: Container ((‘:) * [Char] ((‘:) * [Char] ((‘:) * [Char] ((‘:) * [Char] ((‘:) * [Char] (‘[] *)))))) Officially, of course, you’re asking ghci … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)