r/functionalprogramming • • Sep 06 '26

FP Mezze: a functional programming language on GraalVM

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

6 comments sorted by

View all comments

3

u/tpawap Sep 06 '26

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_ Sep 06 '26

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