Find Related products on Amazon

Shop on Amazon

APL Interpreter – An implementation of APL, written in Haskell (2024)

Published on: 2025-06-09 15:22:24

APL Interpreter January 11, 2024 Why APL? APL is an array programming language. Its only data type is the (multidimensional) array. While this might seem like a huge limitation, the generality it provides leads to a syntax that is incredibly compact and expressive, which forces the programmer to approach problems at a higher level. I was first drawn to APL by the nature of its syntax: with the exception of user-defined variables, all built-in functions and operators are single unicode symbols. As a result, code looks like this. ⍝ My solution to day 7 of Advent of Code '23 c2n ← '23456789TJQKA' ∘ ⍳ classify ← ( 5 -≢ ⍤ ∪ ) , ( ⌈ / ( + /∘. = ⍨ )) , (( 5 ≡∪ ) × ( ⌈ / c2n)) h2n ← 13 ⊥ classify , ( ¯1 ∘ + c2n) hands bids ← ↓⍉↑ (( ' ' ∘ ≠ ) ⊆⊢ ) ¨ input bids ← ⍎ ¨ bids ⎕ ← + / ( ⍳≢ bids) × bids [ ⍋ h2n ¨ hands ] modes ← { ⍵ ≡ ⍬ : ⍬ ⋄ ∪ ⍵ ⌷ ⍨ ⊂ ( ⍸⌈ / =⊢ ) + /∘. = ⍨ ⍵ } change_joker ← { ( ⊃ 'A' , ⍨ modes (⍵ ~ 'J' )) @ ( ⍸ ⍵ = 'J' ) ⊢ ⍵ } c2n ← 'J23456789TQKA' ∘ ⍳ h2n ← 13 ⊥ (classify chan ... Read full article.