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:
Vincent Ambo 2019-08-08 13:13:31 +01:00
parent 103e0b4d25
commit 76f9b1638c

View file

@ -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))