Hi, I have a question!

NamO kang at archi.cse.cau.ac.kr
Sat Jan 10 13:02:45 EST 2004


Hi.

I am a student, who get interesting in Haskell.
So, nowdays, I study Hakell with "Introduction to Functional Programming
using Haskell - second edition"
And today, I face an error from bellow code.

----------------------------
module OperationTest where

data Nat = Zero | Succ Nat
                deriving (Show)

(+) :: Nat  -> Nat -> Nat
m + Zero = m
m + Succ n = Succ (m + n)
----------------------------

But above source make an error like bellow

Reading file "g:\Haskell\OperationTest.hs":
Dependency analysis
ERROR "g:\Haskell\OperationTest.hs":8 - Ambiguous variable occurrence "+"
*** Could refer to: OperationTest.+ Prelude.+

above source is from the text book - "Introduction to Functional Programming
using Haskell - second edition"
and I use Hugs to interpret it.

I understand what interpreter say, but I don't know How I can solve this
problem.
Please, Help me!!!

                                                                            
                              - 5 -

P.S. Tank you very much to read my broken english letter.





More information about the Haskell-Cafe mailing list