[Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Hugh Perkins
Trying to create a datatype/constructor given just its constructor as a string, something like: mkConstr :: String -> Constr parseData :: (Data a) => String -> a ***without knowing in advance anything about the datatype apart from the string contents*** So, not something like: parseData "Just

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Neil Mitchell
Hi mkConstr :: String -> Constr parseData :: (Data a) => String -> a fromConstr, plus a bit of work to create the constructor. http://www.haskell.org/hoogle/?q=fromConstr Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://ww

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Hugh Perkins
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? ___ Haskell

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Donald Bruce Stewart
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? Entirely possib

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-24 Thread Tomasz Zielonka
On Sun, Jun 24, 2007 at 10:55:40PM +0200, Hugh Perkins wrote: > 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? If you want a function like fromConstr, where the 'a' depends on the inp

Re: [Haskell-cafe] Constructing a datatype given just its constructor as a string?

2007-06-25 Thread Benja Fallenstein
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 >