{"title":"typedKanren: Statically Typed Relational Programming with Exhaustive Matching in Haskell","authors":"Nikolai Kudasov, Artem Starikov","doi":"arxiv-2408.03170","DOIUrl":null,"url":null,"abstract":"We present a statically typed embedding of relational programming\n(specifically a dialect of miniKanren with disequality constraints) in Haskell.\nApart from handling types, our dialect extends standard relational combinator\nrepertoire with a variation of relational matching that supports static\nexhaustiveness checks. To hide the boilerplate definitions and support\ncomfortable logic programming with user-defined data types we use generic\nprogramming via GHC.Generics as well as metaprogramming via Template Haskell.\nWe demonstrate our dialect on several examples and compare its performance\nagainst some other known implementations of miniKanren.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"23 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-08-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.03170","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
We present a statically typed embedding of relational programming
(specifically a dialect of miniKanren with disequality constraints) in Haskell.
Apart from handling types, our dialect extends standard relational combinator
repertoire with a variation of relational matching that supports static
exhaustiveness checks. To hide the boilerplate definitions and support
comfortable logic programming with user-defined data types we use generic
programming via GHC.Generics as well as metaprogramming via Template Haskell.
We demonstrate our dialect on several examples and compare its performance
against some other known implementations of miniKanren.