Ben Sless
Ben Sless
Sounds good. One issue I'd appreciate directions on is how to compile it to be performant. A naive approach would be building up a map of all the bindings, but...
I figured I can use malli to parse the query :)
First not so successful attempt at translating the datalog spec directly to malli Not so successful because `::clause` can't be built into a schema. Any tips @ikitommi ? https://gist.github.com/bsless/632b4040a2b2ad7469369f52cd610c06
Update: the parser works. Data patterns are a bit too general so I'm considering adding specialized EA and EAV patterns but they're slightly ugly. Regarding execution model: I'll start with...
Note: It can be implemented poorly using: ```clojure (def Foo [:tuple [:= :a] int?]) (def Bar [:tuple [:= :b] boolean?]) (def Quux [:or Foo Bar]) (def Mm [:-map {:min 1}...
One thing I'm missing wrt entries is the ability to say "the map should contain at least one but could be more", for example" ``` ::a [:or [:entry [:a int?]]...
As I was working on it I was afraid protocols would have to be extracted to their own NS for full acceptance. How about a different PR to extract the...
Took a swing at an implementation without knowing this discussion existed, here is what I originally came up with: ```clojure (ns malli.time (:require [clojure.string :as str] [malli.core :as m]) (:import...
Since tuples are also defined by their size, is a correct behavior here to no even enter if it's the wrong size?
I believe the difference is significant enough to consider this given the benefit for larger schemas: ```clojure (cc/quick-bench ;; 1.799482 µs -> 1.694608 µs (m/-parse-entries [[:x int?] [:y {:optional true}...