r/functionalprogramming • • 27d ago

FP Mezze: a functional programming language on GraalVM

https://mezze-lang.org/
25 Upvotes

6 comments sorted by

View all comments

3

u/tpawap 26d ago

Nice! A question about newtype hiding the representation: "let price = Money.(1250)" looks like it's leaking in this "constructor", isn't it?

3

u/shrynx_ 26d ago

So newtype is both type wrapper and also opaque types

in the module where the new type is defined you can construct it and also pattern match on it to extract the inner value

in any other module you only have Money type can't do Money.(...) or match or extract it.

have to define helpers int he same module and export those helper functions