malli

https://github.com/metosin/malli :malli:
ikitommi 2020-11-22T15:58:42.114100Z

hi all. comments on the function schema syntax? some alternatives:

;;
;; many ways to present function schemas
;; - 2 ints to int
;; - int to int
;; - no args to int
;; - no args to irrelevant
;;

;; 1: current
[:=> [:tuple int? int?] int?]
[:=> [:tuple int?] int?]
[:=> [:tuple] int?]
[:=> [:tuple]]

;; 2: shortcut
[:=> [int? int?] int?]
[:=> [int?] int?]
[:=> [] int?]
[:=> []]

;; 3: separator
[:fn int? int? :=> int?]
[:fn int? :=> int?]
[:fn :=> int?]
[:fn :=>]

rutledgepaulv 2020-11-23T11:47:13.122900Z

Suppose another question is should a "irrelevant" return be a special case or should you just use a 'any? schema

ikitommi 2020-11-22T16:03:42.115400Z

I think as Aave already provides the short variant, so the official (malli-like) syntax doesn’t have to be that terse, just formal. But the 1 is still.. ugly.