5 ms·
So in essence I could think of types as functions (possibly nullary) from types to types? Bool = sum(False, True) Maybe = λ a . sum(Nothing, Just(a))
by earleybird 5y ago
So in essence I could think of types as functions (possibly nullary) from types to types?
Bool = sum(False, True)
Maybe = λ a . sum(Nothing, Just(a))
- pwm 5y ago> So in essence I could think of types as functions (possibly nullary) from types to types? Type constructors, yes. In Haskell the type of type constructors are called kinds: λ> :kind Bool Bool :: Type λ> :kind Maybe Maybe :: Type -> Type λ> :kind Maybe Int Maybe Int :: Type λ> :kind Either Either :: Type -> Type -> Type λ> :kind Eq Eq :: Type -> Constraint λ> :kind Functor Functor :: (Type -> Type) -> Constraint