✍️Elm-pen 0.0.6 - Generate your own Elm modules

Hello everyone.
Im currently working on a little tool called Elm-pen and i think its about time to go into a first alpha phase and ask for feedback.

What is it?

Elm-Pen lets you generate any Elm module that you want, just from a set of json values.

Why use it?

:heavy_plus_sign: proper Enum types with all the untility functions you would expect.
:heavy_plus_sign: No more problems with nested records. just use the generated mappers :wink:
:heavy_plus_sign: json encoders/decoders for records an custom types.

How can i use it?

  1. Install it with npm install -g elm-pen.
  2. Call elm-pen. This will generate a elm-pen.json file and some additional folders that you can ignore for now.
  3. Add elm-pen/generated to you elm.json source directories.

In the elm-pen.json file you can specify the Enums, records and custom types and then call elm-pen again to generate the files.

Feedback Needed

Next time you create a new elm project, consider using elm-pen. I personally noticed that I’m getting the most out of it by generating my model with it.

But what do you think?
:question:How does it help your project?
:question:Are there any feature you are missing?
:question:Would you use it a second time?


Hi! Looks very interesting. Do you think you could add the generated files that correspond to the example JSON you’ve provided? Cheers!

Sure, here you are.

1 Like

I’ve thought about similar things a lot while working on our elm app! Super interesting approach and I like the flexibility handlebars gives you.

It is also fun to grab other people standards “for free” when reusing their templates (e.g. I never used this index based functions for ordered enums - never needed them but I found them really interesting!)

The thing I usually think about as well is that it would be great to use elm when defining these templates somehow… similar to elm-review. I think Elm would benefit a lot from a standard templating layer used across the community!


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.