Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell static computation

Tags:

haskell

I was reading the "Fun with functional dependencies"

This part is said to statically computed ie performed at the compile time

data Nat = Zero | Succ Nat
three = Succ(Succ(Succ Zero)))
even Zero = True
even (Succ n) = odd n
odd Zero = False
odd (Succ n) = even n

(odd three)

But I don't quite get what would be statically computed. And I also don't find anything unusual the compiler to compute to check types

like image 271
vinothkr Avatar asked Sep 24 '26 11:09

vinothkr


1 Answers

Nothing in that code is computed statically. Note that the code you've posted is from the section "Dynamic Computation", not "Static Computation".

like image 148
sepp2k Avatar answered Sep 27 '26 04:09

sepp2k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!