hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/classes.json
{
"name": "hydra.core.classes",
"metadata": {"description": "Registry of Hydra's built-in type classes.", "comments": [], "seeAlso": [], "provisions": []},
"dependencies": [
{"module": "hydra.core.lib.equality"},
{"module": "hydra.core.lib.logic"},
{"module": "hydra.core.model"},
{"module": "hydra.core.strip"},
{"module": "hydra.core.typing"}],
"definitions": [
{
"term": {
"name": "hydra.core.classes.classIsSatisfiedByType",
"signature": {
"typeParameters": [],
"parameters": [
{"name": "arg0", "type": {"variable": "hydra.core.model.Name"}, "isLazy": false},
{"name": "arg1", "type": {"variable": "hydra.core.model.Type"}, "isLazy": false}],
"result": {"type": {"literal": "boolean"}}},
"body": {
"annotated": {
"body": {
"lambda": {
"parameter": "className",
"domain": {"variable": "hydra.core.model.Name"},
"body": {
"lambda": {
"parameter": "typ",
"domain": {"variable": "hydra.core.model.Type"},
"body": {
"let": {
"bindings": [
{
"name": "isIntegerLiteral",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "literal",
"handler": {
"lambda": {
"parameter": "lt",
"domain": {"variable": "hydra.core.model.LiteralType"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.LiteralType",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "integer",
"handler": {
"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.IntegerType"}, "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "lt"}}}}}}]}},
"argument": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"let": {
"bindings": [
{
"name": "isFloatLiteral",
"term": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.Type",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "literal",
"handler": {
"lambda": {
"parameter": "lt",
"domain": {"variable": "hydra.core.model.LiteralType"},
"body": {
"application": {
"function": {
"cases": {
"typeName": "hydra.core.model.LiteralType",
"default": {"literal": {"boolean": false}},
"cases": [
{
"name": "float",
"handler": {
"lambda": {"parameter": "_", "domain": {"variable": "hydra.core.model.FloatType"}, "body": {"literal": {"boolean": true}}}}}]}},
"argument": {"variable": "lt"}}}}}}]}},
"argument": {"application": {"function": {"variable": "hydra.core.strip.deannotateType"}, "argument": {"variable": "typ"}}}}},
"typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
"body": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "className"}}},
"argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "equality"}}}}}}}},
"argument": {"literal": {"boolean": true}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "className"}}},
"argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "ordering"}}}}}}}},
"argument": {"literal": {"boolean": true}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "className"}}},
"argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "numeric"}}}}}}}},
"argument": {
"application": {
"function": {"application": {"function": {"variable": "hydra.core.lib.logic.or"}, "argument": {"variable": "isIntegerLiteral"}}},
"argument": {"variable": "isFloatLiteral"}}}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "className"}}},
"argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "integral"}}}}}}}},
"argument": {"variable": "isIntegerLiteral"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"application": {
"function": {"typeApplication": {"body": {"variable": "hydra.core.lib.logic.ifElse"}, "type": {"literal": "boolean"}}},
"argument": {
"application": {
"function": {
"application": {
"function": {
"typeApplication": {"body": {"variable": "hydra.core.lib.equality.equal"}, "type": {"variable": "hydra.core.model.Name"}}},
"argument": {"variable": "className"}}},
"argument": {"wrap": {"typeName": "hydra.core.model.Name", "body": {"literal": {"string": "fractional"}}}}}}}},
"argument": {"variable": "isFloatLiteral"}}},
"argument": {"literal": {"boolean": false}}}}}}}}}}}}}}}}}}}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "Check whether a type is an instance of a constraint class, by the class's short name."}}}]}}}}},
{
"term": {
"name": "hydra.core.classes.equality",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.typing.TypeClass"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.typing.TypeClass",
"fields": [{"name": "description", "term": {"literal": {"string": "Equality: instances support structural equality."}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The equality type class: instances support structural equality."}}}]}}}}},
{
"term": {
"name": "hydra.core.classes.fractional",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.typing.TypeClass"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.typing.TypeClass",
"fields": [
{"name": "description", "term": {"literal": {"string": "Fractional: instances support total floating-point division."}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The fractional type class: instances support total floating-point division."}}}]}}}}},
{
"term": {
"name": "hydra.core.classes.integral",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.typing.TypeClass"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.typing.TypeClass",
"fields": [
{
"name": "description",
"term": {"literal": {"string": "Integral: instances support integer division, modulus, remainder, and parity."}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The integral type class: instances support integer division, modulus, remainder, and parity."}}}]}}}}},
{
"term": {
"name": "hydra.core.classes.numeric",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.typing.TypeClass"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.typing.TypeClass",
"fields": [
{
"name": "description",
"term": {"literal": {"string": "Numeric: instances support arithmetic (addition, subtraction, multiplication, negation)."}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {"string": "The numeric type class: instances support arithmetic (addition, subtraction, multiplication, negation)."}}}]}}}}},
{
"term": {
"name": "hydra.core.classes.ordering",
"signature": {"typeParameters": [], "parameters": [], "result": {"type": {"variable": "hydra.core.typing.TypeClass"}}},
"body": {
"annotated": {
"body": {
"record": {
"typeName": "hydra.core.typing.TypeClass",
"fields": [{"name": "description", "term": {"literal": {"string": "Ordering: instances support total ordering (and equality)."}}}]}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "The ordering type class: instances support total ordering (and equality)."}}}]}}}}}]}