I was trying to get a ghc going in my shell account the other day and
found that the data at
http://haskell.org/ghc/docs/6.6/html/building/sec-porting-ghc.html
didn't apply at all.
The system is a netbsd alpha which turns up as alpha-unknown-netbsd
through configure.
I didn't find any configure.in to modify, but there is a config.guess.
Is that what I'm supposed to modify?
I was using the source distribution of ghc 6.6.
So how do I get off to s start on the netbsd system at my ISP?
Here is the uname data for my system with the hostname x'd out:
NetBSD xxx 2.1.0_STABLE NetBSD 2.1.0_STABLE (sdf) #0: Mon Nov 13
08:11:09 UTC 2006
root@ol:/var/src/netbsd/src/sys/arch/alpha/compile/sdf alpha
Brian McQueen
Hello,
I've been playing around with Dan Piponi's work on automatic
differentiation (from
http://sigfpe.blogspot.com/2005/07/automatic-differentiation.html and
http://sigfpe.blogspot.com/2006/09/practical-synthetic-differential.html)
and I'm getting some odd behavior with the inferred types of functions
in GHCi 6.4.2. My test case is as follows:
> data Dual a = D a a deriving (Show,Eq)
> instance Num a => Num (Dual a) where
> fromInteger i = D (fromInteger i) 0
> (D a a')+(D b b') = D (a+b) (a'+b')
> (D a a')-(D b b') = D (a-b) (a'-b')
> (D a a')*(D b b') = D (a*b) (a*b'+a'*b)
> evalDeriv f x = (v, v')
> where D v v' = f (D x 1)
> f x = x^3
> f' = snd . (evalDeriv f)
When I load this in GHCi, I get:
*Main> :t f
f :: (Num a) => a -> a
*Main> :t snd . (evalDeriv f)
snd . (evalDeriv f) :: (Num a, Num (Dual a)) => a -> a
*Main> :t f'
f' :: Integer -> Integer
Why is the type of f' Integer -> Integer, especially when the type of
the expression it's defined as is more general? Is this something I'm
not understanding about Haskell, or is it more to do with GHC 6.4.2
specifically?
Any help appreciated,
--Grady Lemoine