Is a second order type one whose instances (values?) are ordinary types?
Are kinds *->* second order types?
Is Species without the argument a second order type?
But with the argument Species is a first order type?
Thanks,
Pat
-- Elephant and Dog types
data Elephant = Elephant deriving Show
data Dog = Dog deriving Show
-- The LHS "Species a" is a type constructor?
data Species a = Species a deriving Show
-- is-a means “Dog is a species” rather than “Fido is a dog”
class Taxonomy f where
isA::f a -> a
instance Taxonomy Species where
isA (Species x) = x
{-
isA (Species Elephant)
isA (Species Dog)
:t Species Dog ===> Species Dog :: Species Dog
:k Species Dog ===> Species Dog :: *
:k Species ===> Species :: * -> *
((isA (Species Elephant))::Species) ===> Expecting an ordinary type, but found a type of kind * -> *
-}
Tá an teachtaireacht seo scanta ó thaobh ábhar agus víreas ag Seirbhís Scanta Ríomhphost de chuid Seirbhísí Faisnéise, ITBÁC agus meastar í a bheith slán. http://www.dit.ie
This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie