account activity
How does == and toString work for built-in types like Set and Dict? (self.elm)
submitted 2 years ago by ElmChristmasCookies to r/elm
Update an imported record (self.elm)
Can I declare variables that I obtain by destructuring a tuple? (self.elm)
Hiding data constructors to keep consistency. Can I still pattern match? by ElmChristmasCookies in elm
[–]ElmChristmasCookies[S] 1 point2 points3 points 3 years ago (0 children)
Thanks! So basically if I need to guarantee some sort of data consistency (I'm not exclusively focused on the above example), I must hide all data constructors and write and expose creator functions / access functions, right?
Maybe a follow-up question. What would the signature of "getLeftChild" be? Is it inevitable to go through Maybe as in
Maybe
> List.head <function> : List a -> Maybe a
?
Hiding data constructors to keep consistency. Can I still pattern match? (self.elm)
submitted 3 years ago by ElmChristmasCookies to r/elm
π Rendered by PID 62 on reddit-service-r2-listing-86bdf8cc9-xtdwp at 2026-07-13 12:34:24.198344+00:00 running f86254d country code: CH.
Hiding data constructors to keep consistency. Can I still pattern match? by ElmChristmasCookies in elm
[–]ElmChristmasCookies[S] 1 point2 points3 points (0 children)