What are uses of polymorphic kinds?

前端 未结 3 751
走了就别回头了
走了就别回头了 2021-02-13 00:06

Polymorphic kinds are an extension to Haskell\'s type system, supported by UHC, allowing

data A x y = A (y x)

to be typed (kinded?) as a

3条回答
  •  忘了有多久
    2021-02-13 00:16

    They are useful for defining functions that operate over data constructors with arbitrary arity, of course!

    A concrete example could be a function that, given a data constructor with arbitrary arity, returns a new data constructor that wraps the given constructor in Some().

提交回复
热议问题