f :: (Show a, Ord b) = (a - String, b - b - Bool)
f = let commond_definitions = undefined in
let f1 = id.show
f2 x = ( x)
in
(f1, f2)
From: Ting Lei tin...@hotmail.com
To: haskell-cafe@haskell.org
Cc:
Date: Wed, 28 Mar 2012 23:42:30 -0700
Subject: [Haskell-cafe] a code
Ting Lei tin...@hotmail.com writes:
(f1, f2) =
let commond_definitions = undefined in
let f1 = id.show
f2 x = ( x)
in
(f1, f2)
I think the type signatures should be:
f1 :: Show a = a - String
and
f2 :: Ord b = b - b - Bool
When I define these
Ketil Malde wrote:
Ting Lei tin...@hotmail.com writes:
(f1, f2) =
let commond_definitions = undefined in
let f1 = id.show
f2 x = ( x)
in
(f1, f2)
I think the type signatures should be:
f1 :: Show a = a - String
and
f2 :: Ord b = b - b - Bool
When I
I think the error message tell you how to fix:
use -XNoMonomorphismRestriction
One approach is add following line into top of your hs file and it works for me.
{-# LANGUAGE NoMonomorphismRestriction #-}
Regarding the deeper reason, I think you would be able to find via GHC
user guide and
Ketil, Thanks for the response. It seems that defining them as a pair only
postphones the error.GHC will give an error when you extract the components of
the pair, no matter whether you addthe NoMonomorphismRestriction flag or not.
--{-# LANGUAGE NoMonomorphismRestriction #-}p :: (Show a, Ord