https://github.com/lue-bird/who-leighed-the-hay
thank u hayleigh
https://github.com/lue-bird/who-leighed-the-hay
Last synced: 8 months ago
JSON representation
thank u hayleigh
- Host: GitHub
- URL: https://github.com/lue-bird/who-leighed-the-hay
- Owner: lue-bird
- Created: 2024-07-26T00:33:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-26T15:10:48.000Z (over 1 year ago)
- Last Synced: 2025-03-18T07:44:33.908Z (8 months ago)
- Language: Elm
- Homepage:
- Size: 45.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Goal is creating a typechecking
```elm
main =
state 0 <| \count setCount ->
state "" <| \message setMessage ->
render <| \model ->
Html.div []
[ Html.button [ Html.Events.onClick <| setCount <| (count model) + 1 ] [ Html.text "+" ]
, Html.p [] [ Html.text <| String.fromInt <| count model ]
, Html.input [ Html.Attributes.value (message model), Html.Events.onInput setMessage ] []
]
```
I claim that I got it. My solution can run snippets that look _exactly_ like above and can be found in `src/FinalSolutionIdenticalToRequest.elm`
To run:
```bash
elm reactor
```
then click on `src/FinalSolutionIdenticalToRequest.elm` or some other file:
- my original solution: `src/FinalSolution.elm`
- a better, simplified attempt: `src/FinalSolutionSimplified.elm`
- a version that converts any of these functions into runnable elm programs: `src/FinalSolutionSimplifiedAbstracted.elm`
- a version that additionally uses tuples instead of records for get,set: `src/FinalSolutionSimplifiedAbstractedWithTuples.elm`
- a version that additionally uses 2 arguments instead of records for get,set: `src/FinalSolutionSimplifiedAbstractedWithArguments.elm`