Re: representation getting verbose...

2002-10-22 Thread Andrew J Bromage
G'day all. On Thu, Oct 17, 2002 at 11:08:57AM -0400, [EMAIL PROTECTED] wrote: > For an > interpreter I'm writing, I found myself writing a function > "constructVarExpr :: String -> Expr" just to make it easier. As an alternative opinion, I don't think there's anything wrong with this. A constru

Re: representation getting verbose...

2002-10-22 Thread Claus Reinke
> Variable (VVariable(varName, (Value (Number > (NNumber (varValue, varDimension)) > > Here VVariable and NNumber are newtype constructors of tuples, and the > entire expression is an "Expression" which, among other things has: > > data Expression = > V

Re: representation getting verbose...

2002-10-22 Thread haskell-cafe-admin
Thanks for your reply... Paul Hudak <[EMAIL PROTECTED]> writes: > > case expr of > > C f -> ... > > V (Variable (VVariable s)) -> ... > > ... > > I think you mean: > > case expr of > C f -> ... > V (VVariable s) -> ... > > which is not quite as verbose. Yes, I think I should h

Re: representation getting verbose...

2002-10-18 Thread Paul Hudak
> In Paul Hudak's SOE, I find a definition of expression: > > data Expr = C Float | V String | Expr :+ Expr | Expr :- Expr > | Expr :* Expr | Expr :/ Expr > > Now this is compelling, but sometimes, I might want to have a function > that takes a variable only, not just any kind of expr

representation getting verbose...

2002-10-17 Thread haskell-cafe-admin
Greetings Haskellers, I'm running into a problem representing some fairly complicated types, and I'll try to put together a simpler example to get your suggestions. In Paul Hudak's SOE, I find a definition of expression: data Expr = C Float | V String | Expr :+ Expr | Expr :- Expr |