
16 Dec
2008
16 Dec
'08
3:44 p.m.
You can get pretty far with the same trick oleg mentions at [1]. If you use local type signature then you can do things like this:
{- ghci infers this type: *Main> :t f f :: (Ord a) => Int -> a -> t -> String -} f i j x | False = (undefined (i::Int) (isOrd j)) :: String f i j x = error "not filled in"
isOrd :: Ord a => a -> () isOrd = undefined
Cheers, Chris [1] http://okmij.org/ftp/Haskell/types.html#partial-sigs