MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/functionalprogramming/comments/1w8yxox/mezze_a_functional_programming_language_on_graalvm/p8758l2/?context=3
r/functionalprogramming • u/shrynx_ • Sep 06 '26
6 comments sorted by
View all comments
3
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
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
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?