# 'none' is a value
none of None
# 'True' and 'False' are higher-order exists
True is not False
False is not True
# TODO 'True or False' looks evaluation. Can this be a justification of 'type' keyword?
type Bool = True or False
# Types are ordered by logical implication
# Incorrect statement raises error immediately
True is True or False # Correct
True and False is True # Correct
True or False is True # Raises error (rather than returns 'False')
type Day = Mon or Tue or Wed or Thu or Fri or Sat or Sun
Mon is Day
# Named disjunction
type T = a of A or b of B
# Syntactic type definition
type Point = (I32, I32) # Numbered, '(I32,)' when only an item
type Person = (name of String, age of I8) # Named
# Operational (function) type
add(x of I8, y of I8) of I8 = x + y
add of I8(x of I8, y of I8) # Correct
# Higher-order operational (function) type
I8(I8)(I8) # TODO = (I8(I8))(I8) = I8((I8)(I8)) = I8(I8(I8)) ?
# TODO Python's indentation rule is made not only by indent and newline but also by ':'.
# Dependent type
# TODO Is this a statement on the type or the function 'x. x != 0'?
type Nonzero = I8 and not x = 0 for x of it
# IDEA
type Nonzero
it is I8
not x = 0 for x of it
type Set(items of (T, ...))
...
it.add(item of T)
...
# There are type-level operations ('and', 'or', 'not', 'is') and value-level operations ('*', '+', '=').
# Evaluation
# 'if' statement is a type-level error handling
if a
...
# Judgement on if 'x' is of 'I8'
if x of I8 and not x = 0
...
# Structural judgement
point = (1, 2)
if point of Point # Correct
point(0) ** 2 + point(1) ** 2 # Refer the values by 'object(n)' or 'object::n'
person of Person = (name = 1, age = 30) # Error: Type of 'name' should be 'String'.
person::name # Refer the values by 'object.name' or 'object::name'.
# Literal processing
if 1 = 1 # Correct
...
if (1, 2) = (1, 2) # Correct
...
# Assignment
Left side: without evaluation, literal
Right side: with evaluation
(a = x, b = (c = y)) = (a = 0, b = (c = 1)) # x, y = 0, 1
SomeType(x, y) = SomeType(0, 1) # x, y = 0, 1
"Hello, {name}!" = "Hello, Me!" # name = "Me"
Though Albino is , it has procedural aspect which is evoked by ':' like Haskell's 'do'. In Albino, ':' is spared from many places compared to Python such as annotation, 'dict' type. Because. Causer.
# Module definition
module hoge
...