【发布时间】:2015-04-06 09:17:25
【问题描述】:
我在 Haskell 中定义函数时遇到问题。我想要做的是输入一个EnvV 类型的变量和Store 类型之一并返回一个State 类型变量:
type Variable = String
type Z = Integer
type T = Bool
type State = Variable -> Z
type Location = Z
type Store = Location -> Z
type EnvV = Variable -> Location
search :: EnvV -> Store -> State
search envV store = envV(store)
【问题讨论】:
-
EnvV类型的函数采用Variable又名String,而您将其应用于Store。请详细说明你想做什么。 -
无关注意:函数应用不需要括号(所以你应该写
envV store而不是envV(store))。
标签: haskell