feat: Add function type
It's not currently possible to check arguments for curried functions, but there might be something on the horizon for attribute set functions.
This commit is contained in:
parent
103e0b4d25
commit
76f9b1638c
1 changed files with 3 additions and 2 deletions
|
@ -78,8 +78,9 @@ in (typeSet [
|
|||
(typedef "bool" isBool)
|
||||
(typedef "float" isFloat)
|
||||
(typedef "string" isString)
|
||||
(typedef "derivation" (ofType "derivation"))
|
||||
|
||||
(typedef "derivation" (x: isAttrs x && x ? "type" && x.type == "derivation"))
|
||||
(typedef "function" (x: isFunction x || (isAttrs x && x ? "__functor"
|
||||
&& isFunction x.__functor)))
|
||||
# Polymorphic types
|
||||
(poly "option" (t: v: (isNull v) || t.check v))
|
||||
|
||||
|
|
Loading…
Reference in a new issue