Categories
- Category Theory (4)
- Computer Science (5)
- Economics (4)
- Education (2)
- Ethics (2)
- Evolution (6)
- Functional Programming (4)
- Linguistics (3)
- Mathematics (4)
- Philosophy (4)
- Politics (1)
- Psychology (3)
Category Archives: Linguistics
Recursive Tuples
Started 2021-04 Haskell does not expose the recursive structure of tuples; for each natural number n (up to a certain limit which happens to be 62), Haskell provides a data type for a tuple of size n1, but there is … Continue reading
Posted in Computer Science, Functional Programming, Linguistics
Tagged generic, hlist, Recursive, Tuple
Leave a comment
Infix Order Reversal
In Haskell, given any function with two arguments (curried) we can choose to use it infix position. The syntax for this depends on how we name the function; if we name the function in the form (s) then s is the infix form of the function, and otherwise an arbitrary function f can be converted to infix form by wrapping in backticks, as in `f`.
In either case, the infix form of the function expects the arguments in a certain order, and the order used in Haskell is:
(s) x y := x s y
I think it would be more natural if the order was the other way around, so:
(s) x y := y s x Continue reading
Posted in Computer Science, Functional Programming, Linguistics
3 Comments
Grammar is like a Type System
In an analogy between natural language and programming language, grammar can be compared to a type system, which provides a great way to learn about one if you know about the other1. Continue reading
RSS - Posts