'`foreach` in Haskell
This code type-checks:
type T :: Type -> foreach (r :: Type) -> Type -> Type
data T k r a
type T' :: Type -> Type
type T' a = T a Identity a
- Why is it that the compiler requires a type of kind
Type -> Type(ie.,Identity) here? It fails to type-check if you replaceIdentitywith sayInt. - What is
foreachkeyword, and how does one use it in Haskell?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
