Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eeue56/elm-simple-data
A collection of methods for dealing with data and simplifying converts
https://github.com/eeue56/elm-simple-data
Last synced: about 1 month ago
JSON representation
A collection of methods for dealing with data and simplifying converts
- Host: GitHub
- URL: https://github.com/eeue56/elm-simple-data
- Owner: eeue56
- License: bsd-3-clause
- Created: 2015-08-17T01:37:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-26T03:31:20.000Z (about 8 years ago)
- Last Synced: 2024-05-21T12:33:38.268Z (8 months ago)
- Language: Elm
- Size: 188 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elm-simple-data
A collection of methods for dealing with data and simplifying converting between differnet types.At the moment Convert provides ways of attempting to convert data, with some default to return if it fails.
Convert exposes two methods, `defaultResult` and `defaultMaybe`. These can be used to either pull out `Ok x` or `Just x`, but default to value passed in. This is useful in a few cases, unwanted in most other cases however.
Working with values (String) in your views that are Ints in your models
```
type Number = Hour Int
hoursView : Signal.Address Update -> Html.Html
hoursView address =
numberSelectView
[on "input" targetValue (Signal.message address << AlarmTime << Hour << String.attemptToInt 0)]
0
23
```