LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > primenu
User Name
Password

Notices


Uncategorized Entries with no category
Old

Creating a Random Expression in Haskell

Posted 12-22-2009 at 06:10 AM by primenu

I have a Haskell program for parsing and evaluating an mathematical expression of type:
data Expr
= Num Double
| Add Expr Expr
| Mul Expr Expr
| Sin Expr
| Cos Expr
| Var Name
| Neg Expr
deriving (Eq,Show)

type Name = String

I have the defined a property to perform quickcheck: to check the readExpr and showExpr are valid bothway round, here readExpr takes a string of type "2*3+x" and converts it...
LQ Newbie
Posted in Uncategorized
Views 1457 Comments 0 primenu is offline

  



All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration