Reading Types Signatures


#1

What does this type signature say?

for mapUrl type is: 'a => '_b. for url: 'a

mapUrl(url)

source

A first shot. mapUrl is a funtion that takes a value of type 'a and return '_b. The url of type 'a is what we are passing to satisfy the first expected parameter of mapUrl of 'a. How did i do?

Where are docs on type 'a and underscore type?


#2

I would read it like

takes some value of type a and returns some type b which can be unused (no compiler error)

Here is a which explains the syntax very well. Read the section about Special prefixes and suffixes for variable names


Decifering Type Error message
#3

Nice link. I knew I had read that page before but couldnt find it. Bookmarked now. Thanks.