7 Nov
2004
7 Nov
'04
10:19 p.m.
Benjamin Franksen wrote:
data (?val::Bool) => Test = Test { name :: String }
is rejected by the compiler:
TestBug.hs:3: Illegal constraint ?val :: Bool In the context: (?val :: Bool) While checking the context of the data type declaration for `Test' In the data type declaration for `Test'
which is unfortunate since it means that you cannot put a function that depends on an implicit parameter into a data structure.
Does this do what you want?: data Test = Test { name :: (?val::Bool) => String } -- Ben