`Functor class``fmap`的定义是这样的：

``````Prelude> :info Functor
class Functor (f :: * -> *) where
fmap :: (a -> b) -> f a -> f b
``````

``````f :: * -> *
``````

``````f a -> f b
``````

``````Prelude> :info Maybe
data Maybe a = Nothing | Just a 	-- Defined in ‘GHC.Base’
``````

``````Prelude> j = Just 3 :: Maybe Integer
Prelude> :t j
j :: Maybe Integer
``````

``````Prelude> x = Just
Prelude> :t x
x :: a -> Maybe a
``````

``````Prelude> j = Just 3 2

<interactive>:19:5: error:
• Couldn't match expected type ‘Integer -> t’
with actual type ‘Maybe Integer’
• The function ‘Just’ is applied to two arguments,
but its type ‘Integer -> Maybe Integer’ has only one
In the expression: Just 3 2
In an equation for ‘j’: j = Just 3 2
• Relevant bindings include j :: t (bound at <interactive>:19:1)
``````

``````	• The function ‘Just’ is applied to two arguments,
but its type ‘Integer -> Maybe Integer’ has only one
``````

``````Prelude> :k Maybe
Maybe :: * -> *
``````

``````Prelude> :k Integer
Integer :: *
``````

``````Prelude> type MaybeInteger = Maybe Integer
Prelude> :k MaybeInteger
MaybeInteger :: *
``````

• 不带参数，或者是已经把参数具体化的数据类型的kind是`*`
• 带参数的数据类型的kind是`* -> *`

``````Prelude> :info Functor
class Functor (f :: * -> *) where
fmap :: (a -> b) -> f a -> f b
``````

`f b`是一样的含义，比如`Maybe Char`，那么b就是Char。

``````Prelude> :t map
map :: (a -> b) -> [a] -> [b]
``````

``````Prelude> :k []
[] :: * -> *
``````