Could you copy and paste the error message here?
The type signature `a` means it could be anything, `String`, `[String]`, or any ADT you could come up with. So in a type signature if you write
func :: a -> a -> a
func a b = a
this funciton is telling ghc that I have a function that accepts two parameters that must be of the same type, whatever the type is. So `a` could be an ADT, a list, a list of lists, etc. But if you write
func :: a -> [b] -> a
func a bs = a
you are essentially saying this function would only take two parameters of two types (`a` and `b` could be of the same type) and the second parameter must be a list. This, however, does not suggest mean that `[b]` could not be `[[String]]`, for `[String]` could just be thought of as a `b`. The way I use to think about type signature is, when you trying to substitute type variables such as `a`, substitute it into a concrete type that you are working with.
On Nov 23, 2017, 03:19 -0500, mrx <patrik.mrx@gmail.com>, wrote:
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners