Haskell type synonym

I'm trying to figure out what the next type synonym is from Yesod.

type HtmlUrlI18n msg url = Translate msg -> Render url -> Html

I could not find an example to find out how you use haskell or haskell wikibook a synonym like c ->. Any links or explanations are greatly appreciated. Thank.

+5
source share
1 answer

Its just a synonym for function type (long for writing). For example, the following should be valid: Haskell

--Example of a function type synonym
type StrFn = String -> String

foo :: StrFn
foo s = s ++ "!"

--Example of a function type synonym with type parameters
type Fn a = a -> a

bar :: Fn String
bar s = s ++ "?"
+4
source

All Articles