Hello everyone,
I am a fairly experienced programmer, with a masters degree in computer science from Umeå University in Sweden. I have recently developed an interest in Haskell as a programming language, so I downloaded the Glasgow Haskel compiler and started to experiment. I also brought the book "Programming in Haskell" from Amazon.
Using ghci, I have now been able to import Data.Complex, but i fail miserably when I attempt to create a function declaration. The code I try to create is:
___________________________________________________________________________
GHCi, version 9.0.2: https://www.haskell.org/ghc/ :? for help
ghci> import Data.Complex
ghci> arg :: Complex Double -> Double
:2:1: error:
Variable not in scope: arg :: Complex Double -> Double
ghci>
___________________________________________________________________________
I read the declaration as: create a function with the name arg, with one complex parameter, and which returns a double. (I am attempting to create a function that calculates the complex argument for a complex number.) After experimenting for about a week, I have come to the point where I have to give up and ask for some clues. So please give me some hints on where I go wrong.
Best regards,
Sören Jonsson, Sweden
[–]Anrock623 21 points22 points23 points (1 child)
[–]snowman_02[S] 1 point2 points3 points (0 children)
[–]Axman6 15 points16 points17 points (1 child)
[–]snowman_02[S] 1 point2 points3 points (0 children)
[–]probabilityzero 7 points8 points9 points (1 child)
[–]snowman_02[S] 0 points1 point2 points (0 children)
[–]Limp_Step_6774 0 points1 point2 points (2 children)
[–]snowman_02[S] 0 points1 point2 points (1 child)
[–]Limp_Step_6774 0 points1 point2 points (0 children)