🧮Algebraic EffectsStephen DiehlContent type: Blog

Prism: An Impure Functional Language With Typed Effects (opens in new tab)

Prism: An Impure Functional Language With Typed Effects This is going to be a very nerdy post so bear with me. Here is a function. Read it the way you would read any other function, and then tell me its type. fn fib(n) = var a := 0 var b := 1 repeat(n) fn let t = a + b a := b b := t a That is a mutable loop. There is a var, there is assignment, there is a temporary so the swap does not eat itself. It is, line for line, the fib you would write in Python after deciding that recursion was a youn...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help