
6 Dec
2000
6 Dec
'00
5:45 a.m.
You could try wheeling out Haskell's Least Used Keyword:
module Defs where
default(Double, Int)
n = 3 -- This is defaulted to Double x = 12.3
test = ceiling (x / n)
Other than that, I only know an answer that starts with "Design and implement a language extension for ...", sorry.
Never mind - thank you for the hint concerning the "default" declaration; I didn't know about that keyword yet. When writing the module as follows, no "fromIntegral" is necessary: module Defs where n :: Num a => a n = 3 x :: Fractional a => a x = 12.3 test = ceiling (x / n) However, I would like to have it without writing the type signature. Who knows a way to do this? Christian