<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by COSC4315 TT on Medium]]></title>
        <description><![CDATA[Stories by COSC4315 TT on Medium]]></description>
        <link>https://medium.com/@cosc4315?source=rss-e0d45fa97be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TJ4NINVVca1JHoBD.jpg</url>
            <title>Stories by COSC4315 TT on Medium</title>
            <link>https://medium.com/@cosc4315?source=rss-e0d45fa97be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 30 May 2026 16:47:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cosc4315/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Elm Language — Conclusion:]]></title>
            <link>https://medium.com/@cosc4315/elm-language-conclusion-45fc88de97f0?source=rss-e0d45fa97be------2</link>
            <guid isPermaLink="false">https://medium.com/p/45fc88de97f0</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[COSC4315 TT]]></dc:creator>
            <pubDate>Mon, 22 Apr 2019 13:43:08 GMT</pubDate>
            <atom:updated>2019-04-22T13:43:08.489Z</atom:updated>
            <content:encoded><![CDATA[<h3>Elm Language — Conclusion:</h3><p>Benchmarking speed, memory footprint, safety, ease of use, reasons to use the language</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKymh0vl1A2BpKyL6wMxJw.png" /><figcaption><a href="https://medium.com/@cosc4315/elm-language-getting-started-c16d98e3fa8b">part 1</a>, <a href="https://medium.com/@cosc4315/elm-language-acquaint-yourself-1bf368255b0d">part 2</a>, <a href="https://medium.com/@cosc4315/elm-language-fine-tuning-e2dad1a33dad">part 3</a>, and <a href="https://medium.com/@cosc4315/elm-language-familiarization-a96fbf936f0c">part 4 </a>of series on Elm</figcaption></figure><p><strong>Benchmarking:</strong></p><p>Changes to upgrade performance for some input on one platform can deteriorate performance for a different input or platform. Using different platforms, browsers and types to test with, is a significant step to ensuring that the performance improvement really is a universal improvement.</p><p>The performance of a a &gt; b heavily depends on the type. Some changes will work better for smaller datasets, others on larger datasets. Or changes might result in Javascript that might initially perform better, but can’t be handled efficiently by an optimising JIT. Developing for performance isn’t explicit. However, in terms of speed, Elm is second to none that can be statistically proven.</p><p>Creator of Elm, Evan Czaplicki created a benchmark that compares the renderer performance of Elm, Ember, React, and Angular. The benchmark is a TodoMVCapp where items are added and removed rapidly using for loops.</p><p>Here are the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ew34mZ05AD_t9BvH3_x03g.jpeg" /></figure><p>As we can see, Elm is the fastest among the four languages. Elm is at least 30% faster than others.</p><p><strong>Memory Footprint:</strong></p><p>Elm compiles to JavaScript. JavaScript is a lightweight programming language. It is designed to have a small memory footprint. This is the amount of main memory that it uses. Low memory utilization is an essential feature for languages that are geared towards building websites and web applications. Part of the reason why, is because these applications have to be able to run on mobile devices. Elm is outstanding for this purpose.</p><p><strong>Safety:</strong></p><p>Elm is a functional language. One of its features is that it has no runtime errors. These are errors that occur during the execution of a program. Furthermore, all data in Elm is immutable. This means that a value can not be changed after it is created. This prevents side effects from occurring. Side effects modify state. State is the data stored at a given time that a function can access. Because of this, all functions in Elm are pure. They will always return the same output given the same input. These characteristics allow Elm to be easy to debug. Pure functions remove the dependencies that functions may have on code that was executed before them. This occurs in languages that do not implement pure functions. In Elm, a function’s output depends solely on its arguments and other immutable data in its scope. An error in Elm will most likely be the product of incorrectly applied logic inside a function. Naturally, this translates to easy testing as well. Verifying the proper output of each function is easier. This translates to unit testing in Elm. Qualities of this sort make Elm a safe language to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Y5TR6tnkbVKImja7rWSL8A.png" /><figcaption>The function doubleNumbers does not change the list. This is an example of immutability.</figcaption></figure><p><strong>Ease of Use:</strong></p><p>Being a declarative language, ease of use is an inherent quality of Elm. The focus is on describing what the programmer wants to accomplish, rather than how it is to be done. The implementation of actual algorithms explicitly is oftentimes bypassed in declarative languages. This is left up to the given language’s implementation. For the programmer, this means that he can focus his energy on specifying what solution is needed for a given problem, rather than focusing on how to implement said possible solutions. This translates to a straightforward, easier way of programming that quite appealing.</p><p><strong>Reasons to Use Elm:</strong></p><p>Throughout this five part series on Elm, we have related many of the winning qualities of this wonderful language. Elm builds upon more than four decades of work on typed functional reactive languages. Many of the features that make this language attractive, are free, easy, and built-in in Elm. Other languages require a stack of libraries to accomplish the same objectives. Elm includes a package manager. Elm has immutable values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/117/1*eRT2946fyPH6mrzh-l0ARg.png" /></figure><p>Elm implements control abstraction thoroughly. This means that it hides complicated code behind a simpler set of operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*NqXhKs6tQk_hovFagbJIYA.png" /><figcaption>Sorting and reversing a list is handled for the programmer</figcaption></figure><p>Its compiler error detection is top-notch, giving descriptive error messages and useful suggestions and hints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*3ZsLJXI4UqjtTdTsnKi0wA.png" /><figcaption>helpful hints</figcaption></figure><p>Testing and debugging are a breeze. All in all, Elm is a superb tool for creating websites and web apps. It emphasizes simplicity, ease of use, and superior tooling. Good luck and bon voyage!</p><p><strong>References:</strong></p><p><a href="https://elm-lang.org/docs">https://elm-lang.org/docs</a></p><p><a href="https://elm-lang.org/blog/blazing-fast-html-round-two">https://elm-lang.org/blog/blazing-fast-html-round-two</a></p><p><a href="https://github.com/evancz/react-angular-ember-elm-performance-comparison">https://github.com/evancz/react-angular-ember-elm-performance-comparisonh</a></p><p><a href="https://elmprogramming.com/">Beginning Elm</a></p><p><a href="https://en.wikipedia.org/wiki/Declarative_programming">https://en.wikipedia.org/wiki/Declarative_programming</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45fc88de97f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elm Language — Familiarization:]]></title>
            <link>https://medium.com/@cosc4315/elm-language-familiarization-a96fbf936f0c?source=rss-e0d45fa97be------2</link>
            <guid isPermaLink="false">https://medium.com/p/a96fbf936f0c</guid>
            <category><![CDATA[elm]]></category>
            <dc:creator><![CDATA[COSC4315 TT]]></dc:creator>
            <pubDate>Mon, 01 Apr 2019 13:41:48 GMT</pubDate>
            <atom:updated>2019-04-01T13:41:48.993Z</atom:updated>
            <content:encoded><![CDATA[<h3>Elm Language — Familiarization:</h3><p>Toolchains, Internals, and Intermediate Representations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKymh0vl1A2BpKyL6wMxJw.png" /><figcaption><a href="https://medium.com/@cosc4315/elm-language-getting-started-c16d98e3fa8b">Part 1</a>, <a href="https://medium.com/@cosc4315/elm-language-acquaint-yourself-1bf368255b0d">Part 2</a>, and <a href="https://medium.com/@cosc4315/elm-language-fine-tuning-e2dad1a33dad">Part 3</a> of series on Elm</figcaption></figure><p><strong>Toolchains:</strong></p><p>A toolchain is a set of tools (programs) that developers use to aid in the development, maintenance, and support of a software task or product. The basic tools used in software development are source code editors and compilers or interpreters. A basic toolchain may comprise a compiler and linker, libraries, and a debugger. As mentioned earlier in this series, it is recommended that you install a text editor like <a href="https://atom.io">Atom</a> to use when writing Elm programs. Unlike other languages, where a lengthy tool stack is often necessary, Elm has many desirable features built-in. For example, if you are using JavaScript as your language of choice, you would have to install a package manager like npm to get packages. This feature is built-in in Elm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/117/1*eRT2946fyPH6mrzh-l0ARg.png" /></figure><p>Furthermore, if you wanted static type-checking and immutability, you would have to add these features. This is not the case when you use Elm. These features are not libraries that you have to install. These features are part of the language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*SCrMTcU-ykuS9UKJxQKAqg.png" /><figcaption>static type checking</figcaption></figure><p><strong>Internals and Intermediate Representations:</strong></p><p>Elm compiles to JavaScript. A web browser then interprets this code. elm make builds Elm projects. It can compile Elm code to HTML or JavaScript. It is the most general way to compile Elm code, so if your project becomes too advanced for elm reactor, you will want to start using elm make directly.</p><p>Say you want to compile Main.elm to an HTML file named main.html. You would run this command:</p><pre>elm make Main.elm --output=main.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*UhMf7Ab3EQCS2friDaV0kQ.png" /><figcaption>compiling Elm file to JavaScript</figcaption></figure><p>Compiling this program to an HTML file, allows you to view it in your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FIUXWTIFjGyH-1dDhdADCg.png" /><figcaption>a simple program</figcaption></figure><p>The provided examples above shows the most common commands in elm. However, there are a few more commands that provides easy support in implementing programs. To see a full list of commands just type elm into your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p9AUC3sRMIdLQ-BQghYJlA.png" /></figure><h3><strong>Publish/Bump/Diff:</strong></h3><p>What makes Elm a powerful language is how easy to create a package by running a simple command <em>elm publish</em>. It’s vast package ecosystem makes it easier to for people to share ideas, mainly through Github, and test the packages to ensure the package is working properly.</p><p>The command <em>elm bump</em> takes the published package version number and bump the version if any modifications to the package were made. Then enter the <em>elm publish </em>command to release that version.</p><p>Finally, the <em>elm diff </em>command detects API changes. For example, if you updated a newer version of a package and wondered what is the difference between the new version and the old version.</p><p>For more information on publishing a package on elm, the provided link below is a great start:</p><p><a href="https://korban.net/posts/elm/2018-10-02-basic-steps-publish-package-elm-19/">The basic steps to publish a package with Elm 0.19 | Korban.net</a></p><p><strong>References:</strong></p><p><a href="https://elm-lang.org/">https://elm-lang.org/</a></p><p><a href="https://guide.elm-lang.org">https://guide.elm-lang.org</a></p><p><a href="https://en.wikipedia.org/wiki/Elm_(programming_language)">Elm (programming language) - Wikipedia</a></p><p><a href="https://www.youtube.com/watch?v=kEitFAY7Gc8&amp;t=959s">https://www.youtube.com/watch?v=kEitFAY7Gc8&amp;t=959s</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a96fbf936f0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elm Language - Fine-Tuning:]]></title>
            <link>https://medium.com/@cosc4315/elm-language-fine-tuning-e2dad1a33dad?source=rss-e0d45fa97be------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2dad1a33dad</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[platuh]]></category>
            <dc:creator><![CDATA[COSC4315 TT]]></dc:creator>
            <pubDate>Wed, 20 Mar 2019 14:01:58 GMT</pubDate>
            <atom:updated>2019-03-20T14:01:58.577Z</atom:updated>
            <content:encoded><![CDATA[<p>Testing &amp; Debugging</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKymh0vl1A2BpKyL6wMxJw.png" /><figcaption><a href="https://medium.com/@cosc4315/elm-language-getting-started-c16d98e3fa8b">Part 1</a> and <a href="https://medium.com/@cosc4315/elm-language-acquaint-yourself-1bf368255b0d">Part 2</a> of series on Elm</figcaption></figure><p><strong>Introduction</strong></p><p>Testing and debugging in Elm is straightforward. The tools explored here, are the compiler, the debug library, and the elm test package. To start with, there are no run-time errors in Elm. These are errors that occur during program execution. For example, Elm takes into consideration the possibility of incorrect input with the implementation of custom types. This rids Elm of many of the errors seen in other languages. Furthermore, functions in Elm are pure functions, meaning that they return the same value given the same arguments. These sorts of functions do not cause side effects. Side effects occur when a function performs anything else other than returning a calculated value. Obviously, pure functions make a program easier to debug. These characteristics, coupled with efficient compiler error detection, immutable data, and useful packages, allow for painless debugging and testing.</p><p><strong>Compiler Error Detection</strong></p><p>The Elm compiler is quite capable of detecting many common errors. One of the major features of Elm that is frequently praised by developers, is its compiler error detection. Compiler error messages in Elm are user-friendly. These appear in the terminal or in the text editor if it is being used instead. They often contain suggestions or hints that are quite useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*3ZsLJXI4UqjtTdTsnKi0wA.png" /><figcaption>useful compiler hint</figcaption></figure><p><strong>Testing</strong></p><p>Unit testing which focuses on testing each unit(component,class, content object), and fuzz testing which inputs large amounts of random data(fuzz) to the program in an attempt to make it crash, can be implemented in Elm using the elm test package.</p><p>To install enter npm install -g elm-test from your terminal. Next, cd into the project’s root directory. After, enter elm-test init from your terminal. This will create a tests directory with some files inside. We can open Example.elm to write a test. By entering elm-test from the terminal, we can see the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUgf_WujlfxZ29vqtSoP_g.png" /><figcaption>editing Example.elm</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*XyfSykzgoyoyZeWCyuocjw.png" /><figcaption>3+3 does in fact equal the expected value which is 6</figcaption></figure><p><strong>Debugging</strong></p><p>The Debug library is part of the core Elm core package. One of its functions is called log.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*E7oN4Qr6GyYwp9Xg5dEkDw.png" /></figure><p>Another function in the debug library is called crash. As the name implies, this function terminates the program with an error message. This can be used when a case expression is unfinished. The error will point to the related module name and line number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*khKf0fsp8QoWP4rGCSgblg.png" /></figure><p>The quickest way to debug in elm is through the console in your web browser. Once you configure the launch.json settings to properly run the file, go into your terminal or command prompt and enter “elm reactor” (without the parentheses). Then go find your elm file that you wanted to debug and run it. Right click on the screen and click inspect, then click the console tab to keep track of your program. A video to show how the debugger is used can be found here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvYvsbei2BX0%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvYvsbei2BX0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvYvsbei2BX0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d73e6b859393b73ddc7d6352238e833/href">https://medium.com/media/3d73e6b859393b73ddc7d6352238e833/href</a></iframe><p><strong>Time Travel Debug Tool</strong></p><p>One of the greatest debug features included with the Elm language is the ability to record a snapshot of the session history and updates made to the model using the Time Travel debug tool. The process for this is shown in the video below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fn4484k8eaKU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dn4484k8eaKU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fn4484k8eaKU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/af97cc5f32c2675d4e7178214b7bc422/href">https://medium.com/media/af97cc5f32c2675d4e7178214b7bc422/href</a></iframe><p><strong>References:</strong></p><p><a href="https://elm-lang.org">https://elm-lang.org</a></p><p><a href="https://elmprogramming.com/">https://elmprogramming.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2dad1a33dad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elm Language - Acquaint Yourself:]]></title>
            <link>https://medium.com/@cosc4315/elm-language-acquaint-yourself-1bf368255b0d?source=rss-e0d45fa97be------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bf368255b0d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[platuh]]></category>
            <dc:creator><![CDATA[COSC4315 TT]]></dc:creator>
            <pubDate>Mon, 25 Feb 2019 08:08:06 GMT</pubDate>
            <atom:updated>2019-02-25T08:08:06.215Z</atom:updated>
            <content:encoded><![CDATA[<p>Data Types, Expressions, &amp; Abstractions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKymh0vl1A2BpKyL6wMxJw.png" /><figcaption>If you’ve not read part 1 please go <a href="https://medium.com/@cosc4315/elm-language-getting-started-c16d98e3fa8b">here</a></figcaption></figure><p><strong>Basics:</strong></p><p>Elm is a Functional Reactive Programming (FRP) language for building web apps. Functional, in that it treats computation as the evaluation of mathematical functions and it avoids mutable (changeable) data. Reactive, in that it is affected by change. In other words, the variable a, in a = b+c, in an imperative language, maintains the same value regardless of the possible changes made to b or c later in the program. This is not the case with reactive programming. In reactive languages, the value of a is updated when the values of b or c change.</p><p><strong>Data Types:</strong></p><p>The primitives(simplest elements) in Elm are standard types: integer, float, string, and boolean.</p><p>Integers in Elm (Int) are whole numbers that can be represented in either normal base 10 or base 16 (hexadecimal) with mathematical operation being well-defined in the range: -2³¹:2³¹-1. When generating JavaScript code in the compiler the range safely expands to -2⁵³:2⁵³-1. Floating point numbers (float) follow the IEEE 754 standard utilized by the vast majority of hardware in existence. These can be defined using the standard form of 1.1112 or in scientific notation as 6.022e23. It is interesting to note that Elm has been designed to make all conversions between integers and floats explicit, rather than implementing an automatic conversion like JavaScript. For example, you cannot add an Int and a Float directly without first converting them to the same data type through the use of functions such as toFloat() or round. A third type is called ‘number’. This type will set itself to the correct data type, either int or float, based upon how it is used.</p><p>Text based data types include String and Char. In Elm you are required to use double quotes for Strings and single quotes for characters where a char must be a single character. For a multi line String you may utilize a set of three double quotes. This allows the compiler to view everything in between as a string containing newline characters without explicit escaping.</p><p>Boolean literals must either be True or False. Elm does not equate True and False to a number, like 1 and 0, but requires the evaluation of conditions to precisely match True or False.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*SCrMTcU-ykuS9UKJxQKAqg.png" /><figcaption>To do this install <a href="https://nodejs.org/en/">Node.js</a>. After, type elm repl.</figcaption></figure><p>Elm also has Collections which include Lists (require same type), Tuples(muti-type support), and Records(like dictionaries in Python) which hold key/value pairs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*MNxoXF4QPvIUiZD15-L0HA.png" /></figure><p><strong>Functions and Control Abstraction:</strong></p><p>Being a declarative language, Elm implements control abstraction thoroughly. This means that it hides complicated code behind a simpler set of operations. In a declarative language, the focus is on what the computer is to do as opposed to how the computer should do it. For example, the core module, List, contains functions to work with lists. Creation, sorting, and ordering are handled for the programmer. Logically, the programmer can create them as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*NqXhKs6tQk_hovFagbJIYA.png" /></figure><p>Elm does not natively support the traditional loop structure of other languages and relies on recursive functions to implement a similar structure. There does exist a package, <a href="https://package.elm-lang.org/packages/Chadtech/elm-loop/latest/">elm-loop</a>, that you can install to provide the more familiar while loop structure, but even this warns the programmer that they should be using mapping, folding, and recursion for the vast majority of operations.</p><p>Folds can be thought of as collapsing a structure into a value in a particular direction(left or right). Below is an example of how a for loop can be expressed as a recursive definition in Elm utilizing a left fold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*bW3CsfOF8MDD68cKV5qHVQ.png" /></figure><p>Mapping in Elm and JavaScript refers to applying a function to each item in the list using the List.map function. The code below shows an example of a map operation on a list of integers. It simply multiplies each item by 2 and returns a new list of number type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*-dbppi027W55JgTMcR7NqQ.png" /></figure><p>This shows an example of a map operation being used to concatenate two lists into a new list having every possible combination of the two,(a1, a2, a3,…f5, f6)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*Tb8ihHgKkmTkWZtRbTY_bA.png" /></figure><p>For branching Elm uses case statements and traditional if/else assertions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Vk63_aP2LcGVviRv_xdtgQ.png" /></figure><p><strong>Expressions:</strong></p><p>Elm supports many standard expression evaluations. Strings for example can be concatenated using the “++” operator. In addition, math utilizes the normal syntax and operators [+, -, *, /, //] that represent addition, subtraction, multiplication, floating point division, and integer division respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*8RY8l4B4ZGWYQ0ozpWED0g.png" /></figure><p>Some unique expressions in Elm include: Let(values are defined in specific expression), Custom Types (new types), Type aliases(shorter name for another type), and function application operators.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*i4sqx1bfTjMHMvTf4rVgWQ.png" /><figcaption>let, custom type, and type alias</figcaption></figure><p>Function application operators allow the programmer to not have to use parentheses. It is a nice way to call functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*rxGfZc7EeevWB1AucZrZkQ.png" /></figure><p><strong>Modules and Data Abstraction:</strong></p><p>Modules are at the core for data abstraction in Elm. Data abstraction, allows the programmer to reduce cognitive load and risk of name conflicts. Data abstraction also hides data that is not explicitly imported. Modules allow programmers to work on the same project simultaneously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jl6_bzrjNcDCjReTHRFz7Q.png" /><figcaption>importing modules</figcaption></figure><p><strong>References:</strong></p><p><a href="https://guide.elm-lang.org/">https://guide.elm-lang.org/</a></p><p><a href="https://elm-lang.org/docs">https://elm-lang.org/docs</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bf368255b0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elm Language - Getting Started:]]></title>
            <link>https://medium.com/@cosc4315/elm-language-getting-started-c16d98e3fa8b?source=rss-e0d45fa97be------2</link>
            <guid isPermaLink="false">https://medium.com/p/c16d98e3fa8b</guid>
            <category><![CDATA[platuh]]></category>
            <category><![CDATA[elm]]></category>
            <dc:creator><![CDATA[COSC4315 TT]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 04:47:01 GMT</pubDate>
            <atom:updated>2019-02-18T04:47:01.402Z</atom:updated>
            <content:encoded><![CDATA[<h3>Installation, Package Manager, &amp; Demo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKymh0vl1A2BpKyL6wMxJw.png" /></figure><h3>Introduction to Elm</h3><p>Elm is a Functional Reactive Programming (FRP) language focused on creating reactive graphical user interfaces (GUIs). Functional reactive programming for those that are unaware, is essentially, the implementation of the reactive programming model applied using functional programming techniques. Although Elm compiles to Javascript, the architecture of Elm provides an easier and more concise understanding, so for users who are familiar with functional programming, Elm is definitely an upgrade. Elm provides an elegant command-line interface, a supportive compiler, and an intuitive debugger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXJSkdLmXkN_hlMMS3xI5g.png" /></figure><h3>Installation</h3><p>The first step, is to install the Elm language compiler. This can be done <a href="https://elm-lang.org/">here</a>.</p><p>Once you have installed the compiler on your device, you will need a text editor. <a href="https://atom.io/">Atom</a> is a great one, but there are other options available, all with Elm plugins. These include: <a href="http://brackets.io/">Brackets</a>, <a href="https://www.gnu.org/software/emacs/">Emacs</a>,<a href="https://www.jetbrains.com/"> IntelliJ</a>, <a href="http://lighttable.com/">Light Table</a>, <a href="https://www.sublimetext.com/">Sublime Text</a>, <a href="https://github.com/Krzysztof-Cieslak/vscode-elm">VS Code</a>, and <a href="https://www.vim.org/">Vim</a>.</p><p>Installing Elm on your workstation is made simple by a packaged executable which can be found either through the official <a href="https://guide.elm-lang.org/install.html">install guide</a> or through the <a href="https://github.com/elm/compiler">project GitHub</a>. Running this executable will make the binaries available to your environment through the terminal and allow you to become productive with the language in a short amount of time.</p><h3>Package Manager</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/117/1*eRT2946fyPH6mrzh-l0ARg.png" /></figure><p>Following the installation of the binaries you will want to install a number of packages that will increase Elm capabilities without having to write a large library yourself. Elm makes this extremely simple as well as all packages are located in a single repository, <a href="https://package.elm-lang.org/">package.elm-lang.org</a>, and are installed through the terminal by using the command:elm install &quot;root&quot;/&quot;package&quot;. This command modifies the compiler file elm.json to add the required dependencies that your code will call upon when compiling. For example, to install the package that allows you to make HTTP requests, you would type: elm install elm/http.If you find yourself in need of a reminder and don’t want to go searching the web, typing the command elm --help will provide you with a number of helpful reminders.</p><h3>Basic Elm Demo</h3><p>The <a href="https://guide.elm-lang.org/">official Elm guide</a> provides a great demo program which I have included below:</p><pre>import Browser<br>import Html exposing (Html, button, div, text)<br>import Html.Events exposing (onClick)<br><br>main =<br>  Browser.sandbox { init = 0, update = update, view = view }<br><br>type Msg = Increment | Decrement<br><br>update msg model =<br>  case msg of<br>    Increment -&gt;<br>      model + 1<br><br>    Decrement -&gt;<br>      model - 1<br><br>view model =<br>  div []<br>    [ button [ onClick Decrement ] [ text &quot;-&quot; ]<br>    , div [] [ text (String.fromInt model) ]<br>    , button [ onClick Increment ] [ text &quot;+&quot; ]<br>    ]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdZH_XcvWGB_OxText-qEA.png" /></figure><p>After you type your code into your editor, run the project in your command-prompt or terminal. In order to do that, create a directory where you would store your projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-AuwUyGnL-G-d-eALkaIlg.png" /></figure><p>Once you created and change to the desired directory, type “elm init” to initialize your source folder that will store all of your elm files. The prompt will also provide a link so the user will have a deeper understanding on how to add files, how to see it in your browser, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mi51alrqD8eMn-_OibcAA.png" /></figure><p>To compile the program, type “elm make” and the destination of the elm file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gSuz1Lq8jGEAWDOSwoy6xg.png" /></figure><p>Once you receive this message, type “elm reactor” to build your project and the prompt will return a link to your server which you can navigate to your elm file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gSuz1Lq8jGEAWDOSwoy6xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzMdEPN6fdGQSCJG6FvAYg.png" /></figure><p>Once you enter to your server, go to your source folder and your elm file should be available. If you followed this demo your screen should like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sneXEJeTAIXorbwOdJjXxQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgKGNRbARgV859MFTUbcdQ.png" /></figure><h3>References:</h3><p><a href="https://elm-lang.org/">elm-lang.org</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c16d98e3fa8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>