4 ms·
> The type is different. Functions are a class of types. The output of function composition is absolutely a different type but within the class of function type
by sfvisser 7y ago
> The type is different. Functions are a class of types. The output of function composition is absolutely a different type but within the class of function types.
I know how types and type constructors work, it's completely irrelevant in the context of what I was trying to say about composition in FP.
It seems to me you're probably talking about a very specific technical form of composition. I'm not.
To me a simple function like `vertically :: [Ui] -> Ui` is also about composition. The input and output types of the `vertically` function are not the same no, but informally we're still composing UIs into UIs. Which is exactly the level of detail I care for in this discussion.
- crimsonalucard 7y agoTypes can be composed in two ways. This is fundamental to type theory. It can be composed via a product or a sum.
- gowld 7y agoAlmost Every language has data composition if all you mean is "it's possible to wrap two things in a container" or "you can apply a function to two things and get a third thing".