An open API service indexing awesome lists of open source software.

https://github.com/mrmurphy/elm-type-extractor

A small module to transform a string of Elm source into a list of type declarations.
https://github.com/mrmurphy/elm-type-extractor

Last synced: 4 months ago
JSON representation

A small module to transform a string of Elm source into a list of type declarations.

Awesome Lists containing this project

README

          

# Extract Types

This small module will take a string of Elm source, and extract all top-level type declarations.

For example, some source that looks like this:

```Elm
foo : String
foo = "Foo"

bar : Int -> Int
bar i = i + 1
```

Would return a list of type declarations, looking like this:

```Elm
[ {identifier = "foo", type' = "String"}
, {identifier = "bar", type' = "Int -> Int"}
]
```