fdef
Define functions using haskell-like syntax
Usage example
(see it live at https://runkit.com/munizart/5bfef7ba07b85400123ee291)
const fdef = const def = const fib = def `fib ` 1 def `fib ` 1 def `fib ` + const fisrt10 = 0 1 2 3 4 5 6 7 8 9console // [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
Documetation
fdef
:: ( namespace: String ) => DefTemplateTag
fdef
take a namespace and returns a def
template tag used to define functions.
def
) :: ([name: String], types: ...Contructors) => ((...Constructors) => a) => Function
DefTemplateTag (def `identifier ` {...}
Defines a implementation for identifier
that matches positional arguments withing type constructors
def
) :: ([name: String], types: ...Contructors) => ((...LiteralValues) => a) => Function
DefTemplateTag (def `identifier ` {...}
Defines a implementation for identifier
that matches the first param being 0
and the second being 1
.
def
) :: ([name: String], types: ...Contructors) => ((...LiteralValues | Constructors) => a) => Function
DefTemplateTag (def `identifier ` {...}
Defines a implementation for identifier
that matches the first param being 0
and the second being any instance of TypeConstructor2
.