[Haskell] Re: Using implicit parameter constraints in data decl
Ben Rudiak-Gould
Benjamin.Rudiak-Gould at cl.cam.ac.uk
Sun Nov 7 17:19:29 EST 2004
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
More information about the Haskell
mailing list