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
| -- Make sure you have the eslint lsp set up https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#eslint | |
| -- Or set up another LSP at the bottom | |
| -- Open a project that a linter works on normally and hovering over an error with neo-tree open will not display a popup | |
| -- If you close neo-tree with `:Neotree close`, the popup will display properly | |
| local fn = vim.fn | |
| local options = { | |
| backup = false, | |
| clipboard = "unnamedplus", |
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
| -module (learnlists). | |
| -export ([product/1, product2/1]). | |
| % recursive | |
| product([]) -> 1; | |
| product([X|Xs]) -> X * product(Xs). | |
| % tail recursive | |
| product2(List) -> product2(List, 1). | |
| product2([], P) -> P; |
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
| -module (shapes). | |
| -export ([perimeter/1, area/1, enclose/1]). | |
| % Shapes is a module that calculates perimeter, area, and smallest | |
| % bounding box given properties of different shapes. | |
| % We assume on each of these that the shape will be stored | |
| % as {type, measurements}. For example, a circle with a radius | |
| % of 2 would be {circle, 2}, a rectangle with height of 4 and | |
| % width of 10 would be {rectangle, 4, 10}, and a triangle | |
| % can either be stored with {triangle, base, height} or |
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
| -module(first). | |
| % First module, based on instructions | |
| % Author: Matthew Secrist | |
| -export([double/1, mult/2, area/3, square/1, treble/1]). | |
| % Multiply two numbers. | |
| mult(X, Y) -> | |
| X*Y. |