Name: Anonymous 2013-12-17 15:06
# sqrt -1;;
Error: This expression has type float -> float
but an expression was expected of type int
Error: This expression has type float -> float
but an expression was expected of type int
(sqrt) - 1.
$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
ghci> :m + Data.Complex
ghci> sqrt (1 :+ 0)
1.0 :+ 0.0
ghci> sqrt ((-1) :+ 0)
Segmentation fault
$
CL-USER> (sqrt -1)
#C(0.0 1.0)
CL-USER> (sqrt #C(-1.0 0.0))
#C(0.0 1.0)