PREV: Map it like it's hot!
NEXT:
Filtering is a powerful feature in functional programming that allows you to refine and manipulate datasets efficiently, ensuring that only elements meeting specific criteria are retained for further processing.
PREV: Map it like it's hot!
NEXT:
Filtering is a powerful feature in functional programming that allows you to refine and manipulate datasets efficiently, ensuring that only elements meeting specific criteria are retained for further processing.
PREV: Types and Values Ninjery!
NEXT: Filter like a real star
This batch of exercises is designed to enhance your understanding of mapping in Elm. Mapping is a fundamental concept in functional programming that allows you to transform lists by applying a function to each element in the list. These exercises will provide you with practical scenarios to apply this concept, reinforcing your ability to manipulate and process data efficiently in Elm.
PREV: Conditionals Ninjery
NEXT: Map it like it's hot!
A series of exercises for getting familiar with types and their possible values.
PREV: Type Ninjery
NEXT: Types and Values Ninjery
A series of exercises with unique tasks for playing around with the basic Elm types we've come across so far, and getting more familiar with conditional logic.
NEXT: Conditionals Ninjery
🌟 Elm Type Challenge! 🌟
Hey Team,
To sharpen our understanding of Elm's type system, I've prepared some (hopefully) intriguing exercises. I encourage you to refrain from using your REPL or any other tools for evaluation. The real value lies in manually working through these problems and enhancing your intuitive grasp of Elm's types as you do so.
module Main exposing (main) | |
import Browser | |
import Html exposing (Html, div, h1, input, label, text) | |
import Html.Attributes exposing (value) | |
import Html.Events exposing (onInput) | |
main : Program () Model Msg | |
main = |
module Main exposing (main) | |
import Browser | |
import Html exposing (Html, text) | |
main : Program () Model Msg | |
main = | |
Browser.sandbox | |
{ init = myInit |
http.Handle
vs http.Handler
vs Http.HandlerFunc
net/http
gives us a function http.Handle
, for attaching handlers to paths.
A handler is anything that satisfies the http.Handler
interface, which is defined this way (I'm refusing to Google sh!t up, so I'm probably going to get the syntax wrong, and I crave your forgiveness for that):
interface Handler {
[ | |
{ | |
"name": "Afghanistan", | |
"code": "AF", | |
"capital": "Kabul", | |
"region": "AS", | |
"currency": { | |
"code": "AFN", | |
"name": "Afghan afghani", | |
"symbol": "؋" |
module Main exposing (..) | |
import Browser | |
import Html exposing (..) | |
import Html.Events exposing (onClick) | |
import Task | |
import Time | |
main = |