小编jus*_*man的帖子

我可以在“let”块内定义类型同义词吗?

我想要得到这样的东西。这是可能的?

something :: String
something = 
  let
    type FirstName = String
    type LastName = String
    
    fullName :: FirstName -> LastName -> String
    fullName = a ++ " " ++ b
  in
    fullName "Haskell" "Curry"
Run Code Online (Sandbox Code Playgroud)

我一直在尝试寻找能够执行此操作的语言扩展,但无济于事。

syntax haskell types

5
推荐指数
1
解决办法
138
查看次数

标签 统计

haskell ×1

syntax ×1

types ×1