normalcalc
Jump to navigation
Jump to search
Paradigm(s)  functional 

Designed by  User:Itoh Shimon 
Appeared in  31 July 2024 (JST) 
Computational class  Turing complete 
Major implementations  Original 
Influenced by  Unlambda Lazy K brainfuck 
File extension(s)  .nc 
Normalcalc, designed by User:Itoh Shimon in 2526 November 2023 (JST) and appeared in 31 July 2024 (JST), is a purely functional esoteric programming language based on combinatory logic and monadic IO.
Syntax
<program> ::= "`" <value> <value> <value> ::= "*"  "/"  ""  "_"  ","  "."  <program>
Operators
Operator  Description 

`

Function application operator 
*

Substitution function (the S combinator; takes three values and applies the result applying the first one to the third one, to the result applying the second one to the third one) 
/

Constant function (the K combinator; takes two values and returns the first one) 


Bind function (also called flatMap; takes a monad and a function that takes a value in that monad and returns a monad, and returns a monad) 
_

Return function (also called pure and unit; takes a value and returns a monad containing it) 
,

Input function (takes a value, discards it, and returns a monad containing an input byte) 
.

Output function (takes an output byte and returns a monad containing an empty tuple) 
#

Line comment 
Other characters are ignored.
Specifications
 Lazy evaluation
 Functions are curried.
 Normalcalc programs return a monad (also called procedure).
 Bytes are represented as Church numerals.
 Empty tuples are represented as identity functions (the I combinator; takes a value and returns it).
Examples
noop
`_/
cat (for a single character)
```,/.