valhallac

Compiler for set-theoretic programming language.
git clone git://git.knutsen.co/valhallac
Log | Files | Refs | README | LICENSE

commit cf4ec231e8c8c009b7bd5f9a80c63e2f8fdedab4
parent 5c5f5e73feef74d021e878ce09b8ead1141ab840
Author: Demonstrandum <moi@knutsen.co>
Date:   Sat, 13 Jun 2020 17:19:11 +0100

Remove old `.ideas' folder

Diffstat:
D.ideas/__MAIN.vh | 51---------------------------------------------------
1 file changed, 0 insertions(+), 51 deletions(-)

diff --git a/.ideas/__MAIN.vh b/.ideas/__MAIN.vh @@ -1,51 +0,0 @@ -import :Prelude -import :puts from :IO as :put - -open Prelude - -div_by_three = [n : Nat => n mod 3 is 0] -div_by_five = [n : Nat => n mod 5 is 0] - -fizz : div_by_three -> String -fizz n = "Fizz" - -fizz : div_by_five -> String -fizz n = "Buzz" - -fizz : div_by_five | div_by_three -> String -fizz n = "FizzBuzz" - -# The order here doesn't matter, that's because if -# a number is part of both those sets, and neither set -# is a subset of eachother, it will give -# the number to the function that has a set that -# is a superset of both. If that function didn't exist, -# it would just run the first function. -# This is quite a unique scenario. - -map fizz 1..100 |> each puts - - -# Type declarations don't have to be directly over -# the implementation of the function. Only the order -# matters. - -int? : Real -> Boolean -int? : Int -> Boolean - -int? x = False -int? x = True - -# The function that it runs is the more specific one. -# (By specific I mean the function that has a domain -# that is a subset of the other functions domain.) - - -# Another way: - -is_int? : Real -> Boolean -is_int x = x <- Int - -# <- is read as "is element of ...?". It returns a bool. - -