Skip to content

:type hangs on coerce

This works

$ ghci -ignore-dot-ghci
GHCi, version 8.2.1: http://www.haskell.org/ghc/  :? for help
Prelude> import Data.Coerce
Prelude Data.Coerce> :t [fmap, coerce]

<interactive>:1:8: error:
    • Occurs check: cannot construct the infinite type: b ~ f b
        arising from a use of ‘coerce’
    • In the expression: coerce
      In the expression: [fmap, coerce]

But doing it with contra

Prelude Data.Coerce> contra = undefined :: Functor f => (b -> a) -> (f a -> f b)

it hangs

Prelude Data.Coerce> :t [coerce, contra]
^CInterrupted.
Prelude Data.Coerce> :t [contra, coerce]
^CInterrupted.
Edited by Icelandjack
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information