Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图了解 Yesod 的以下类型同义词在做什么。
type HtmlUrlI18n msg url = Translate msg -> Render url -> Html
我找不到一个例子来学习一些 haskell 或与->present 同义的类型的 haskell wikibook。非常感谢任何链接或解释。谢谢。
->
它只是(长记下来)函数类型的同义词。例如,以下应该是有效的 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 ++ "?"