fact n = if n == 0 then 1 else n * fact n - 1res = fact 10 // testResults [("res", DoubleValue 3628800)] . checkResults)
fact n = n & \"hello\" {- propper scoping this fact is not the inner fact -}f n = {- Test partially applied functions -}fact n = if n == 0 then 1 else n * fact(n - 1)app n factapp v f = f vres = f 8 // testResults [("res", DoubleValue 40320.0)] . checkResults)
f b = {- test that the function closes over local scope -}timesb n m = n * b * mtimesbapp v f = f vq = f 8z = f 10res = (app 9 (app 8 q)) - ((z 8 9) + (z 1 1)) // testResults [("res", DoubleValue (-154))] . checkResults)
On Dec 16, 9:07 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> Well, it's been a month since I announced the whole Visi thing. When I
> announces, I had a barely functional type checker and inferencer and a
> barely functional expression evaluator.
>
> That's all changed in the last month. As I've gotten my Haskell Foo on and
> gone with an existing
> implementation<http://dysphoria.net/2009/06/28/hindley-milner-type-inference-in-scala/>of
> Hindley-Milner <http://en.wikipedia.org/wiki/Type_inference> type checking
> tests<https://github.com/visi-lang/visi/blob/b73f83220f975d8f532a2367548993...>to
> get a better sense of both the Visi language and the test harness that
> I'm using for Test Driven Development.
>
> --
> Visi.Pro, Cloud Computing for the Rest of Ushttp://visi.pro
> Lift, the simply functional web frameworkhttp://liftweb.net
Sorry for offtopic, can it be run in ios emulator ?