Hello! The file versuch.lhs (attachment) consists of a function gc2. If you try gc2 25 15, hugs produces a run time error. gc2 ist defined as:
gc2::Int->Int->Int gc2 a1 a2 = gc2 a2 (mod a1 a2) gc2 a2 0 = a2
CU Fabian Meier
Hi Fabian,
* Fabian Meier
The file versuch.lhs (attachment) consists of a function gc2. If you try gc2 25 15, hugs produces a run time error.
gc2 ist defined as:
gc2::Int->Int->Int gc2 a1 a2 = gc2 a2 (mod a1 a2) gc2 a2 0 = a2
You have to change the last two lines, and learn how pattern matching in Haskell works ;o)
gc2::Int->Int->Int gc2 a2 0 = a2 gc2 a1 a2 = gc2 a2 (mod a1 a2)
Regards, Olli -- {- IST & IIS _ INF _ UniBwM :: obraun@informatik.unibw-muenchen.de -} {- Tele-Consulting GmbH :: obraun@Tele-Consulting.com -} {- FreeBSD Commmitter :: obraun@FreeBSD.org -}
participants (2)
-
Fabian Meier -
Oliver Braun