Skip to content

Inconsistent unicode display for kinds

With :set -fprint-unicode-syntax, the kind * should always be printed as . However the output is extremely inconsistent. Here are a few examples from ghci, and I will add more as I run across them.

:t fmap
fmap ∷ ∀ {f ∷ ★ → ★} {a} {b}. Functor f ⇒ (a → b) → f a → f b

:i fmap
class Functor (f ∷ * → *) where
  fmap ∷ forall a b. (a → b) → f a → f b
-- (note that forall is also not displayed properly as ∀ here)

:k Functor
Functor ∷ (★ → ★) → Constraint

:m + GHC.Generics

:i Functor
-- (among other output)
instance ∀ (f ∷ * → ★). Functor f ⇒ Functor (Rec1 f)
  -- Defined in ‘GHC.Generics’
instance Functor Par1 -- Defined in ‘GHC.Generics’
instance ∀ i (c ∷ Meta) (f ∷ * → ★). Functor f ⇒ Functor (M1 i c f)
  -- Defined in ‘GHC.Generics’
instance ∀ i c. Functor (K1 i c) -- Defined in ‘GHC.Generics’
instance ∀ (f ∷ * → ★) (g ∷ * → *).
         (Functor f, Functor g) ⇒
         Functor (f :.: g)
  -- Defined in ‘GHC.Generics’
instance ∀ (f ∷ * → ★) (g ∷ * → ★).
         (Functor f, Functor g) ⇒
         Functor (f :+: g)
  -- Defined in ‘GHC.Generics’
instance ∀ (f ∷ * → ★) (g ∷ * → ★).
         (Functor f, Functor g) ⇒
         Functor (f :*: g)
  -- Defined in ‘GHC.Generics’

:t datatypeName
datatypeName
  ∷ ∀ {d} {t ∷ ★ → (* → *) → ★ → ★} {f ∷ * → *} {a}.
    Datatype ★ d ⇒
    t d f a → [Char]

:i datatypeName
class Datatype k (d ∷ k) where
  datatypeName ∷ forall {k1} (t ∷ k → (* → *) → k1 → *) (f ∷ *
                                                             → *) (a ∷ k1).
                 t d f a → [Char]
  ...
  	-- Defined in ‘GHC.Generics’

:t (:*:)
(:*:) ∷ ∀ {g ∷ ★ → *} {p} {f ∷ ★ → *}. f p → g p → (:*:) ★ f g p
-- Note that  ★ and * are reversed from what :i displays!

Note that :t datatypeName causes a panic in 8.1; I have filed a separate bug https://ghc.haskell.org/trac/ghc/ticket/12549

Edited by johnleo
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information