vasiliu iorgu
vasiliu iorgu

Reputation: 109

Printing non string values in haskell

How can i print a value that is a non string type to console? The type is below.

data Expr = Var String | Con Bool | Uno Unop Expr | Duo Duop Expr Expr | List [Expr]
 deriving Show

I have a list of the above type values and i would like to print them to screen each on a separate line( not the classic list view). Thanks

Upvotes: 0

Views: 167

Answers (1)

sepp2k
sepp2k

Reputation: 370142

Just use print on each element of your list:

mapM' print exprs

Upvotes: 2

Related Questions