Hi Hugh,
2007/6/25, Donald Bruce Stewart <[EMAIL PROTECTED]>:
hughperkins:
>
> Just noticed that all my responses have been going only to
> Neil, not to the group.
> Anyway, the jist of our conversation was that it's not
> possible to create arbitrary datatypes/constructors from
> strings in Haskell. Can anyone deny/confirm?
Anyway there was a thread on this last week.
That thread starting here:
http://www.haskell.org/pipermail/haskell-cafe/2007-June/026777.html
The takeaway was Stefan O'Rear's suggestion that if you don't want to
create a table of datatypes manually, you can use hs-plugins --
something along the lines of
data Foo = forall a. MyClass a => Foo a
read' typeName s = eval ("Foo (gread \"" ++ s ++ "\" :: " ++ typeName
++ ")") :: Foo
- Benja
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe