I don't know, take a look at this random Haskell function from Yesod[1]:
isValidPass :: Text -- ^ cleartext password
-> SaltedPass -- ^ salted password
-> Bool
isValidPass ct salted =
PS.verifyPassword (encodeUtf8 ct) (encodeUtf8 salted) || isValidPass' ct salted
The stuff after `::`, including the following indented lines, are the type of this function. The text after the `--`s are comments.
That's a very, very simple one. Take look at this other type signature:
widgetToPageContent :: (Eq (Route site), Yesod site)
=> WidgetT site IO ()
-> HandlerT site IO (PageContent (Route site))
or this one:
selectFieldHelper
:: (Eq a, RenderMessage site FormMessage)
=> (Text -> Text -> [(Text, Text)] -> WidgetT site IO () -> WidgetT site IO ())
-> (Text -> Text -> Bool -> WidgetT site IO ())
-> (Text -> Text -> [(Text, Text)] -> Text -> Bool -> Text -> WidgetT site IO ())
-> HandlerT site IO (OptionList a)
-> Field (HandlerT site IO) a
Do you think it would be more readable if the type came before the identifier?
I know these types might look needlessly complicated to someone that doesn't know how to read them, but when you learn to understand them, they are a blessing. Most of the time, a type will tell you everything you need to know about a function or other value. They're often better than the documentation to know what they do.
Another advantage is that they simplify looking for the type signature of a function. You just need to `grep '^identifier'` instead of what you would do for C++, for example, `grep 'identifier\('` and manually filter out the calls.
Also, having it on the right permits one to comment on different parts of it, just like one would do with non-type code.
I don't see the sense in ever having it on the left (where's the benefit? just having it look like C?), but I guess it's not unacceptably bad on unexpressive type systems where the type is hardly more than a type identifier.
[1] https://www.yesodweb.com/