Last active
July 24, 2019 06:02
-
-
Save johnwesonga/b84687ba0757ab666475b88ad56790bf to your computer and use it in GitHub Desktop.
elm type alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SortDirection = Asc | Desc | |
type alias SortedLabels = {labels: List String , direction: SortDirection } | |
type alias Article = { name: String, keywords: SortedLabels } | |
addArticles: String -> List Article -> List Article | |
addArticles name article = | |
Article name (SortedLabels [] Asc) :: article | |
--Call the function | |
addArticles "food" [Article "start" (SortedLabels ["foo", "bar"] Asc), Article "start" (SortedLabels ["foo", "bar"] Asc)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment