Hello, I'm fairly new to haskell and functional programming and i'm still trying to get my head around certain concepts.
I'm wondering if anyone can help me convert this abstract syntax into Haskel data and type declarations:
<prolog> ::= (<assertion> ".")*
<assertion> :: = <structure> | <rule>
<rule> ::= <structure> ":-" <structure>("," <structure>)*
<structure> ::= <name> [�(� <term> (�,� <term>)* �)�]
<term> ::= <number> | <variable> | <structure>
<variable> ::= <name>
<name> is simply a String and <number> an Int
type Prolog = Assertion
data Assertion = Structure | Rule
type Rule = Structure Structure (Structure)
type Structure = Name [ Term (Term)]
data Term = Number | Variable | Structure
type Variable = String
type Name = String
type Number = Int
Any help would be appreciated
TIA
Patrick.