(@pablisco) , . .
, :
A datatype is implemented by a data class,
or a sealed hierarchy of data classes and objects.
These datatypes are generalised by having one or several generic parameters,
and to become a type constructor they implement the interface Kind for these generic parameters.
Datatypes work over themselves,
never directly over the values defined by its generic parameters
:
Typeclasses are interfaces that define a set of extension functions
associated to one type. You may see them referred as "extension interfaces".
The other purpose of these interfaces, like with any other unit of abstraction,
is to have a single shared definition of a common API
and behavior shared across many types in different libraries and codebases.
, , , common API → flatMap/map/just, costume Implementation.
,
-:
- , .
- , , ,
common API's . - , , - Codegen, Arrow Team , .
- - : arrow-test kotlin-test, , , .
However, if you are really trying to implement your own data type. You can also create a problem, and one of those accompanying you will be happy to help you :)
Imran source
share